Try   HackMD

Root of Kepler's Equation

The equation of eccentric anomaly is given by

(1)ψesinψ=ωt
Using simple iteration which can be written as
(2)ψn+1=ωt+esinψn

, in which I iterate over and over until the difference between
ψn+1
and
ψn
is less than
ε
. In this case I let
ε=1.D0
.

Code

!========================================================
!   Purpose: Solve Kepler eccentric anomaly
!
!   Methods: Simple iteration (E=M+e*sinE)
!       
!       Date        Programer       Description of change
!       ====        =========       =====================
!      9/30/20        Morris        Original Code
!========================================================
PROGRAM kepler
    IMPLICIT NONE
    REAL(16), PARAMETER :: pi = 3.1415926535898D0
    REAL(16) :: phi, e, M, tmp
    INTEGER :: i

    open(1, file='kepler_2.dat', status='unknown')
    e = 0.2D0
    do i = 1, 100
        M = pi * dble(i) / 50.D0
        do 
            tmp = phi
            phi = M + e * sin(phi) 
            write(*, *) abs(tmp-phi)
            if (abs(tmp - phi) <= 1D-8) then
                EXIT
            end if
        end do
        write(1, '(3F20.17)') M, phi
    end do
END PROGRAM kepler

Result

In this program, it tries to find

ψ as a function of
ωt
. By letting
ωt
go through
0
to
2π
. I can get the following relation. Futhermore, I can adjust different
e
to get a different function.