Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Hohmann Transfer-Simulation

Subject: Hohmann Transfer-Simulation

From: Brendan

Date: 16 Feb, 2010 15:45:19

Message: 1 of 3

Hi Everyone,
First time posting, Im fairly new to MATLAB and am doing my undergrad project on simulating the hohmann transfer to Mars. I have a code so far that allows me to plot the orbits of earth and Mars simulataneously by inputting initial conditions y0=[u(o),v(0),udot(0),vdot(0)] - for earth
[t,y]=ode23(@earth,[0 10*pi],y0,options);
z0=["""""""""""""""""""""""""""""]- similarly for Mars
and then plot the positions of both planets.
This seems to works fine (using ODE23) but I am wondering as to how I can show the planets actually moving along their trajectory? I have seen the "Movie" and "Drawnow" functions but am finding it difficult to understand how I can show the planets as particles moving in a time dependent fashion..
If someone could help me with this it would be great!
Thanks

Subject: Hohmann Transfer-Simulation

From: Brendan

Date: 17 Feb, 2010 12:13:02

Message: 2 of 3

"Brendan " <c_uboid88@hotmail.co.uk> wrote in message <hleeif$lu4$1@fred.mathworks.com>...
> Hi Everyone,
> First time posting, Im fairly new to MATLAB and am doing my undergrad project on simulating the hohmann transfer to Mars. I have a code so far that allows me to plot the orbits of earth and Mars simulataneously by inputting initial conditions y0=[u(o),v(0),udot(0),vdot(0)] - for earth
> [t,y]=ode23(@earth,[0 10*pi],y0,options);
> z0=["""""""""""""""""""""""""""""]- similarly for Mars
> and then plot the positions of both planets.
> This seems to works fine (using ODE23) but I am wondering as to how I can show the planets actually moving along their trajectory? I have seen the "Movie" and "Drawnow" functions but am finding it difficult to understand how I can show the planets as particles moving in a time dependent fashion..
> If someone could help me with this it would be great!
> Thanks

Anyone have any help on this please?!!

Subject: Hohmann Transfer-Simulation

From: Steven Lord

Date: 17 Feb, 2010 15:06:22

Message: 3 of 3


"Brendan " <c_uboid88@hotmail.co.uk> wrote in message
news:hlgmge$hgn$1@fred.mathworks.com...
> "Brendan " <c_uboid88@hotmail.co.uk> wrote in message
> <hleeif$lu4$1@fred.mathworks.com>...
>> Hi Everyone,
>> First time posting, Im fairly new to MATLAB and am doing my undergrad
>> project on simulating the hohmann transfer to Mars. I have a code so far
>> that allows me to plot the orbits of earth and Mars simulataneously by
>> inputting initial conditions y0=[u(o),v(0),udot(0),vdot(0)] - for earth
>> [t,y]=ode23(@earth,[0 10*pi],y0,options);
>> z0=["""""""""""""""""""""""""""""]- similarly for Mars
>> and then plot the positions of both planets.
>> This seems to works fine (using ODE23) but I am wondering as to how I can
>> show the planets actually moving along their trajectory? I have seen the
>> "Movie" and "Drawnow" functions but am finding it difficult to understand
>> how I can show the planets as particles moving in a time dependent
>> fashion..
>> If someone could help me with this it would be great! Thanks
>
> Anyone have any help on this please?!!

Take a look at the COMET, COMET3, or MOVIE functions or look in this section
of the documentation:

http://www.mathworks.com/access/helpdesk/help/techdoc/creating_plots/f10-1460.html

or look at the ORBITODE demo.

--
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us