Post Reply 
Solver inside of HP basic
02-26-2015, 02:59 PM
Post: #5
RE: Solver inside of HP basic
(02-26-2015 09:17 AM)Thomas Ritschel Wrote:  
(02-25-2015 02:04 PM)Tim Wessman Wrote:  Since this is just a plain numeric solving, just use the numeric solver command. FNROOT is what you are looking for. No other changes are needed in your first posted program.

By changing Jan's code into the following I get "Kepler Error: Bad Guess(es)":
Code:
EXPORT Kepler()
BEGIN
  LOCAL M=60, e=0.15, E;
  HAngle:=0;
  FNROOT(E-SIN(e)-M,E);
  PRINT(E);
  HAngle:=1;
END;

I also tried other variants, e.g. FNROOT('E-SIN(e)-M=0',E) or by providing some proper guess, but it keeps showing the error message. The problem may be caused by the use of local variables: By using the single letter HOME variables, e.g. by removing the LOCAL statement (and changing "e" into some other capital letter), the error message disappears. But then it's just printing "0" instead of the correct result...

BTW.: I'm using the latest (?) calculator software version 6975.

I have modified the code a little bit, because it shoeld solved in radians.
Still I get the same massage.
After change this code
EXPORT Kepler()
LOCAL M=60*pi/180,e=0.15,X;
X:=FNROOT(E-e*sin(E)-M,E);
PRINT(X*180/pi);
END;

And change the line of FNROOT into

X:=FNROOT(E-0.15*sin(E)-60*pi/180,E);

than it working, this tells me that FNROOT is not able to use variable.
Strange behavior.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Solver inside of HP basic - Powersoft - 02-25-2015, 01:06 PM
RE: Solver inside of HP basic - Angus - 02-25-2015, 01:41 PM
RE: Solver inside of HP basic - Powersoft - 02-26-2015 02:59 PM
RE: Solver inside of HP basic - Powersoft - 03-06-2015, 04:18 PM



User(s) browsing this thread: 1 Guest(s)