Question: Write a Matlab function to compute the true anomaly (), Given; The mean orbit rate (n), The eccentricity (e), and The time elapsed (t) since
Write a Matlab function to compute the true anomaly (), Given; The mean orbit rate (n), The eccentricity (e), and The time elapsed (t) since periapsis crossing. (Note: MATLAB code for the kepler_E.m function is pictured to aid in solving for E, Given; eccentricity (e) and mean anomaly M.
Test your function with the following inputs:
(a) n = 0.001, e = 0.01, t = 1, 000 sec.
(b) n = 0.00001, e = 0.3, t = 12, 000 sec.

kepler. E.m function E kepler-E(e, M) This function uses Newton's method to solve Keplers equation E - e*sin(E) = M for the eccentric anomaly, given the eccentricity and the mean anomaly. E eccentric anomaly (radians) eeccentricity, passed from the calling program M mean anomaly (radians), passed from the calling program pi 3.1415926... User m-functions required: none % set an error tolerance : error = 1.e-8; % Select a starting value for E: E=M+e/2; else E = M - e/2; end % Iterate on Equation 3.17 until E is determined to within % the error tolerance: ratio 1; while abs(ratio error ratio (E e*sin(E)- M)/(1 - e*cos (E)) E E-ratio; end end %kepler-E kepler. E.m function E kepler-E(e, M) This function uses Newton's method to solve Keplers equation E - e*sin(E) = M for the eccentric anomaly, given the eccentricity and the mean anomaly. E eccentric anomaly (radians) eeccentricity, passed from the calling program M mean anomaly (radians), passed from the calling program pi 3.1415926... User m-functions required: none % set an error tolerance : error = 1.e-8; % Select a starting value for E: E=M+e/2; else E = M - e/2; end % Iterate on Equation 3.17 until E is determined to within % the error tolerance: ratio 1; while abs(ratio error ratio (E e*sin(E)- M)/(1 - e*cos (E)) E E-ratio; end end %kepler-E
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
