I am trying to set up a code to calculate the equation of motion of a rocket using ode45
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Jose Camorlinga Medina
el 8 de Oct. de 2018
Comentada: Jose Camorlinga Medina
el 8 de Oct. de 2018
My equation for the EOM are
dv/dt= T/m - D/m - g*sin(gam): at=tangential acceleration, T=thrust, D=drag, g=acceleration of gravity, gam= path angle
dgam/dt= -1/v*(g-(v^2/(Re+h)))*cos(gam): v=velocity, Re=radius of earth, h= altitude
dx/dt=Re/(Re+h)*v*cos(gam): x is downrange distance
dh/dt=v*sin(gam):
I have been watching videos, but I am not sure how to use ode45 with multiple functions, I would appreciate the help.
2 comentarios
Torsten
el 8 de Oct. de 2018
Name v=y(1), gam=y(2), x=y(3) and h=y(4) and set up the ODE system for ODE45 like in the examples of the documentation.
Respuestas (0)
Ver también
Categorías
Más información sobre Ordinary Differential Equations en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!