For this part, you will be using a built-in Matlab function called ode45. Using ode45 with
your two-body.m function will allow you to propagate your initial position and velocity in time.
Essentially the function ode45 integrates your derivative, Equation 15, over the time interval
that you specify to find the new position and velocity of the spacecraft. The initial position
and velocity of the spacecraft is:
ro = [6678.1363, 0, 0] km
U0 = [0, 7.725760634075587, 0] km/s
In order to propagate your orbit, use the following tolerances:
This is an example of an ode45 function call:
time, x y 2 Ux, Uy, vz], options, u)
Propagate your position in orbit for one full revolution around the Earth (8147 seconds) and
plot your trajectory around the Earth, with Earth in the middle. Note: we have added matlab
code to plot a nice Earth. This orbit is circular and equatorial.
Write a function that returns Va and AV, needed for the transfer to the moon. The function
accepts as inputs: the radius of the LEO, the radius of the final orbit of the moon and u. The
equations needed for this calculation are given ( 8 to 14). The function header should look like
[Va, Vb] = HohmannTransfer(initial.radius, final.radius, )
Apply the calculated Va to the last propagated position and velocity from Part 2 and propa-
gate until you reach the Moon (433061 seconds). Does this value seem reasonable to you? Give
examples of missions where a similar maneuver has been used.
Figure 3: The spacecraft have ignited its thrusters and performed Va to get into the right
position around the moon.
Once you reached the moons orbit, another tangential burn is needed for the spacecraft to
stay in the orbit. Add the calculated AV1 to the spacecraft's velocity and propagate the moon
orbit for a full revolution (the spacecraft needs to return to the same position) around the Earth.
Remember the conditions for a Hohmann transfer. Plot the trajectory, to make sure your code
is doing the right thing.
These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction
of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice.
Unethical use is strictly forbidden.
close all %empty variables in memory then close all windows, pictures etc start fresh
time1=8147; %time it takes for earth to do one revolution in seconds
r0=[6678.1363, 0, 0];
[propagatedtime,propagatedposvel] =ode45(@(t,x)twobody(t,x,mu),[0, time1],[r0, v0]',options);
N=length(propagatedtime); %length of the vector propagatedtime
% we plot the values x,y,z in 3d
a=propagatedposvel(N,:) % propagatedposvel is of size N times 6
% we note that the z component of the velocity is always zero by
% construction of the problem.
% we add dVa to the velocity vector at time 8147 seconds
% we normalize the velocity vector u=1/(a(4)^2+a(5)^2)*[a(4),a(5),0]
%after adding the boost dVa, the velocity is