HP Forums
Solve Keplers equation - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Solve Keplers equation (/thread-18580.html)



Solve Keplers equation - Powersoft - 07-21-2022 02:43 PM

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;



RE: Solve Keplers equation - Albert Chan - 07-21-2022 05:39 PM

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.


RE: Solve Keplers equation - matalog - 07-23-2022 11:32 AM

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.