Solving an equation on the HP50G (as compared to the Prime) - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html) +--- Forum: General Forum (/forum-4.html) +--- Thread: Solving an equation on the HP50G (as compared to the Prime) (/thread-13307.html) |
Solving an equation on the HP50G (as compared to the Prime) - rrpalma - 07-20-2019 05:51 AM Hello, Long time HP50G user, but started using the Prime a couple of months ago -- and I find that I quite like it! Anyways, on page 6-13 of the HP50G User's Guide there is an example of an equation to be solved: exp(x) - sin((pi*x)/3) = 0 The guide uses the Numerical Solver to solve this equation, and provides 4.5006E-2 as an example solution -- as also found on the HP50G. This however, does not seem to be a correct solution to the equation, for when it is substituted for x on the left side of the equation, we don't get 0. However, when solved on the Prime, with an initial guess of 1, an initial (correct) solution of {−3.04544793088} is obtained. Any ideas on how to solve this on the HP50G? Thanks!!!! RE: Solving an equation on the HP50G (as compared to the Prime) - Thomas Okken - 07-20-2019 08:24 AM 4.5006e-2 is not a solution, but it is a local minimum, which is why the numerical solver can converge there. The HP-42S solver does this, too, but it at least helpfully tells you "Extremum" when it does so. With different starting values, you can guide it to the actual root. My copy of the HP-50g manual (edition 1, April 2006) has this example on page 6-10, and while it also fails to point out that 4.5006e-2 is an extremum and not a root, it does show how to enter a starting value of -3 to get the root -3.045. RE: Solving an equation on the HP50G (as compared to the Prime) - RMollov - 07-20-2019 08:28 AM (07-20-2019 05:51 AM)rrpalma Wrote: Hello, You need to specify interval to find a solution in, then figure out the result. If you supply x as {-10 0} solver gives -3.04544793089 Sign Reversal, with 0: - 4.50061385902E-2 Extremum. It's up to you to decide which answer to use. You could also plot it and select interval there. HP50 and Prime have different accuracy therefore the two sides of equation may differ. BTW DM42 finds 'exact' solutions at sign reversal points like: -3.045447930881649697415605577746648 -5.997627340756129979223366652843795 -9.000117833796755710867792548726015 and others RE: Solving an equation on the HP50G (as compared to the Prime) - Thomas Okken - 07-20-2019 08:37 AM (07-20-2019 08:28 AM)RMollov Wrote: You need to specify interval to find a solution in, then figure out the result. If you supply x as {-10 0} How do you get it to show the "Sign Reversal" or "Extremum" messages? I'm using the NUM.SLV menu, [↱] [7], and I'm getting the same numbers as you, but no messages explaining what those numbers are. EDIT: Oh, wait, never mind. Press [INFO]. Of course. RE: Solving an equation on the HP50G (as compared to the Prime) - RMollov - 07-20-2019 08:51 AM (07-20-2019 08:37 AM)Thomas Okken Wrote: How do you get it to show the "Sign Reversal" or "Extremum" messages? I'm using the NUM.SLV menu, [↱] [7], and I'm getting the same numbers as you, but no messages explaining what those numbers are. And [EXPR=] gives you Left: ... and Right: ... sides of equation values RE: Solving an equation on the HP50G (as compared to the Prime) - rrpalma - 07-20-2019 06:39 PM Thank you *very much* Thomas and RMollov for your help and detailed comments. I am amazed at how much one can learn on this forum. I just found out also that if I want to accomplish the same from a command and not use the SOLVE app on the HP50G, I need to use the ROOT command, which in fact takes three parameters on the stack: the equation, the variable you're solving for, and then the range in which to look for a solution. The SOLVE command only takes two arguments, whereas on the Prime it takes the three aforementioned (however, I'm still trying to learn how to specify a range on the Prime, as opposed as just a single numeric guess). Thanks again!!! |