Post Reply 
Solving an equation on the HP50G (as compared to the Prime)
07-20-2019, 05:51 AM (This post was last modified: 07-20-2019 06:02 AM by rrpalma.)
Post: #1
Solving an equation on the HP50G (as compared to the Prime)
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!!!!
Find all posts by this user
Quote this message in a reply
07-20-2019, 08:24 AM
Post: #2
RE: Solving an equation on the HP50G (as compared to the Prime)
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.
Visit this user's website Find all posts by this user
Quote this message in a reply
07-20-2019, 08:28 AM (This post was last modified: 07-20-2019 09:05 AM by RMollov.)
Post: #3
RE: Solving an equation on the HP50G (as compared to the Prime)
(07-20-2019 05:51 AM)rrpalma Wrote:  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!!!!

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 Smile
Find all posts by this user
Quote this message in a reply
07-20-2019, 08:37 AM (This post was last modified: 07-20-2019 08:40 AM by Thomas Okken.)
Post: #4
RE: Solving an equation on the HP50G (as compared to the Prime)
(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}
solver gives -3.04544793089 Sign Reversal, with 0: - 4.50061385902E-2 Extremum. It's up to you to decide which answer to use.

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. Smile
Visit this user's website Find all posts by this user
Quote this message in a reply
07-20-2019, 08:51 AM
Post: #5
RE: Solving an equation on the HP50G (as compared to the Prime)
(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.

EDIT: Oh, wait, never mind. Press [INFO]. Of course. Smile

And [EXPR=] gives you Left: ... and Right: ... sides of equation values Smile
Find all posts by this user
Quote this message in a reply
07-20-2019, 06:39 PM (This post was last modified: 07-20-2019 06:42 PM by rrpalma.)
Post: #6
RE: Solving an equation on the HP50G (as compared to the Prime)
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!!!
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: