Small Satellites

Home » Posts tagged 'Solver'

Tag Archives: Solver

Kepler’s equation Solver

In this example we will show how to solve Kepler’s equation M = E-e*sin(E)

clear all;
clc;
M = 0.3458;         % Mean anomaly [rad]
eps = 1E-9;         % Tolerance
e = 0.1;            % Eccentricity
	En  = M;
	Ens = En - (En-e*sin(En)- M)/(1 - e*cos(En));
	while ( abs(Ens-En) > eps )
		En = Ens;
		Ens = En - (En - e*sin(En) - M)/(1 - e*cos(En));
	end;
	E = Ens;         % Eccentric anomaly E [rad].
fprintf('Eccentric anomaly E = %4.4f [rad]\n',E);
Eccentric anomaly E = 0.3832 [rad]
%d bloggers like this: