Space FM Assignment
Space FM Assignment
Assignment
Program for M vs E
function out=kepler(e) M=[0:30:360]*(pi/180); eps=.000001; for n=1:size(M,2) E1=M(n); % E1 = initial approximation of E i=1; while (i>eps) E2=E1-(((E1-e*sin(E1))-M(n))/(1-e*cos(E1))); i=abs(E2-E1); E1=E2; end E(n)=E2*(180/pi); end plot(M*(180/pi),E),xlabel('Mean Anomaly (M)'),ylabel('Eccentric Anomaly (E)'),xlim([0 360]),ylim([0 360]); % E = Eccentric Anomaly % e = eccentricity % M = Mean Anomaly % eps = max error value
Results
For error value of 0.001 -