Results 1 to 16 of 16

Thread: Equation??

  1. #1

    Thread Starter
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    Here i am again. Can someone solve this equation. For which values of x the equation is correct. I solvd like a million of this, but this one is a small problem.
    Code:
    sin2x = sinx + 1 - cosx
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

  2. #2
    Fanatic Member
    Join Date
    Sep 2000
    Location
    UK.
    Posts
    728

    Question More Info?

    For what range of values do you want solutions of x for? i.e. -180 < x < 180 etc? I'm assuming this is a trig-equation...?

    Does sin 2x mean (sin (x))^2 (sin of x, squared) or sin(2x) (sin of 2*x)? Sorry for the confusion, i just want to get it straight.

    Later
    Digital-X-Treme
    Contact me on MSN Messenger: [email protected]

    [VBCODE]Debug.Print Round(((1097) - ((55 ^ 5 + 311 ^ 3 - 11 ^ 3) _
    / (68 ^ 5))) ^ (1 / 7), 13)[/VBCODE]

  3. #3
    Banned
    Join Date
    Feb 2001
    Location
    Back to sh*tland
    Posts
    294
    In the first case given by [Digital-X-Treme] I end up with:

    cos(x) + tan(x) = 1

    From here I'm stuck.

  4. #4

    Thread Starter
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    No, sin2x = sin(2x), if it was square i would have said it.
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

  5. #5
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    If I wasn't feeling quite so lazy, I'd (try to) solve this Instead I'll suggest you try using one of the formulae that looks like:

    Sin(A + B) = Sin(A)Cos(B) + Cos(A)Sin(B)

    I've fogotten if that's correct, but there are 4 trig identities that are a bit like that, for Sin(A+B), Sin(A-B), Cos(A+B) and Cos(A-B). I think you might find your answer there.

    You can substitute something like Sin(0) or Cos(90) (that's in degrees not radians obviously) for zero.
    Harry.

    "From one thing, know ten thousand things."

  6. #6
    Banned
    Join Date
    Feb 2001
    Location
    Back to sh*tland
    Posts
    294
    So far I have got x >= 90º
    Not much but...

  7. #7
    Frenzied Member
    Join Date
    Jul 1999
    Location
    Huntingdon Valley, PA 19006
    Posts
    1,151

    Try newton-Raphson

    There might be some analytical way to solve this, but brute force Newton-Raphson will find roots if there are any. Do successive approximations on the Lastx formula until the result does not change much.

    Function(x) = sin(2x) - sin(x) + cos(x) - 1

    Derivative(x) = 2cos(2x) - cos(x) -sin(x)

    Nextx = Lastx - Function(Lastx) / Derivative(Lastx)

    I used MathCad7 to work on the above, getting, 45 & 225 degrees as solutions.

    It seems as though adding multiples of 360 to the above solutions would give other trivial solutions.

    Knowing the roots suggests that a little manipulation might have yielded those roots without using Newton-Raphson.

    Whenever I can find the derivative and have my MathCad7 software available, I go for this method. Even writing a VB program is not tuff for something like the above.

    Even if you do not know anything about derivatives (calculus is the name of the general subject), you can use a table from a handbook and work it out for a lot of functions.
    Live long & prosper.

    The Dinosaur from prehistoric era prior to computers.

    Eschew obfuscation!
    If a billion people believe a foolish idea, it is still a foolish idea!
    VB.net 2010 Express
    64Bit & 32Bit Windows 7 & Windows XP. I run 4 operating systems on a single PC.

  8. #8
    romanize
    Guest

    trying

    ive never had trigo... but is that possible?:
    1. sin2A = 2*sinA*cosA
    2. 1 = sinA*sinA + cosA*cosA

    wich means:
    sin2A = sinA + 1 - cosA is the same like
    2*sinA*cosA = sinA + (sinA*sinA + cosA*cosA) - cosA

    then

    cosA-sinA = (sinA*sinA + cosA*cosA) - 2*sinA*cosA
    or

    cosA-sinA = (sinA - cosA)^2 or
    cosA-sinA = (cosA - sinA)^2 .. so
    either
    cosA - sinA = 1 or
    cosA - sinA = 0

    reply

  9. #9
    romanize
    Guest

    further

    -1<sinA,cosA<1, so the first cannot be
    so: sinA = cosA -> A = 45° ?

  10. #10
    romanize
    Guest

    2nd

    180 + 45 = 225, that would be the 2nd solution..

    *feelgood*

    laterz

  11. #11
    Fanatic Member
    Join Date
    Sep 2000
    Location
    UK.
    Posts
    728

    Smile Infinite Number of Solutions

    romanize, there are an infinite number of solutions for trigonometric equations like these. That is why you specify a range, such as -360º < x < 360º.

    e.g. Solve
    f(x) = sin(2x) - sin(x) + cos(x) - 1 for 0º < x < 720º

    Laterz
    Digital-X-Treme
    Contact me on MSN Messenger: [email protected]

    [VBCODE]Debug.Print Round(((1097) - ((55 ^ 5 + 311 ^ 3 - 11 ^ 3) _
    / (68 ^ 5))) ^ (1 / 7), 13)[/VBCODE]

  12. #12
    romanize
    Guest

    thx

    yeah, if that's what i think, that's clear .. i just wanted to link to Guv's reply&MathCad7..
    bye

  13. #13
    Frenzied Member
    Join Date
    Jul 1999
    Location
    Huntingdon Valley, PA 19006
    Posts
    1,151

    Well done!

    Romanize: A job well done! Your manipulation of the equation led to correct solutions.

    Contrary to other posts, (cosA - sinA) can be equal to one.

    cosA - sinA = 1 when A = -90 degrees. (cos-90 = 0 & sin-90 = -1)

    Hence there are three basic solutions: 45, 225, & -90 (or +270). A myriad more can be found by adding 360 to one of the basic solutions.

    I did not find the one at -90 degrees. Newton-Raphson would have founds it if I had made a guess closer to -90(or +270), but the initial guesses I used were closer to the other soultions.
    Live long & prosper.

    The Dinosaur from prehistoric era prior to computers.

    Eschew obfuscation!
    If a billion people believe a foolish idea, it is still a foolish idea!
    VB.net 2010 Express
    64Bit & 32Bit Windows 7 & Windows XP. I run 4 operating systems on a single PC.

  14. #14
    romanize
    Guest

    ok

    u r right there..
    i'm going 2 install w95 now on my old machine for assembly programming only *s*,
    laterz

  15. #15

    Thread Starter
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    Thanks for the fast (and correct) replies, guys.
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

  16. #16
    romanize
    Guest

    vb7

    u have the vb7 installed, he (not qb7, i think)? how is it ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width