Post Reply 
Solve Keplers equation
07-21-2022, 02:43 PM
Post: #1
Solve Keplers equation
I wont to solve Keplers equation with this program,
but something is wrong with my guess.
Is it possible to solve this with one of the build in commands?



Code:
EXPORT Kepler()
BEGIN
  LOCAL M:=5;
  LOCAL e0:=0.1;
  LOCAL E;
  AAngle:=2;  // do calculations in degree
  // --------------------------------
  // wont to solve Kepler's equation:
  // E = M + e0 * SIN(E)
  // ---------------------------------
  E:=FNROOT(E-M-e0*SIN(E),E,1);
  PRINT(E);
END;
Find all posts by this user
Quote this message in a reply
07-21-2022, 05:39 PM
Post: #2
RE: Solve Keplers equation
Code:
  E:=FNROOT(E-M-e0*SIN(E),E,1);

I think FNROOT cannot lookup local variables. If (M,e0) are globals, above work.

Code:
  AAngle:=2;  // do calculations in degree

You may have to do "AAngle:=0;", to restore HOME default setting.
Find all posts by this user
Quote this message in a reply
07-23-2022, 11:32 AM (This post was last modified: 07-23-2022 11:45 AM by matalog.)
Post: #3
RE: Solve Keplers equation
What equation do you actually want to solve? Give it in the form of var*bla1-bla2 (etc)=bla3, where var is the variable you want to solve for and bla1,2 and 3 are known numbers (even if they are stored as variables).

I'm sure we can write it in a form that the solve command will be able to work with.
Find all posts by this user
Quote this message in a reply
Post Reply 




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