From: Brendan on
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
From: Brendan on
"Brendan " <c_uboid88(a)hotmail.co.uk> wrote in message <hleeif$lu4$1(a)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?!!
From: Steven Lord on

"Brendan " <c_uboid88(a)hotmail.co.uk> wrote in message
news:hlgmge$hgn$1(a)fred.mathworks.com...
> "Brendan " <c_uboid88(a)hotmail.co.uk> wrote in message
> <hleeif$lu4$1(a)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(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ


 | 
Pages: 1
Prev: MathLab Assignment Outsorcing
Next: Neural network