Closed robellebor closed 6 years ago
There is no way that ek and ekold have the same value at the start of the while loop. The code must go into it.
so why do we need a while loop ... if "(ek-ekold)>1.0e-14" is always true when will the loop end ??
Kepler's equation must be solved for the eccentric anomaly, but it has no algebraic solution. The numerical solution can be obtained by an iteration method. You can find more details in any orbital mechanics book.
am trying to write the whole program in java .... and i get "NaN" in the output of azel[0] , when i traceback the problem i found that
ek and ekold are the same even after adding +1 to ekold .... i printed out the result of both ek and ekold and they are the same ... that means am not able to go in to the while loop (which creates a problem because OneMinusecosE is 0)