Numerically Integrating the differential equation below?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Bilal Arshed
el 18 de Nov. de 2019
Editada: James Tursa
el 18 de Nov. de 2019
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/248897/image.png)
i know some boundary conditions such as, t0= 0 and v0=7000m/s (<===newly updated v0) and vf=0.... but do not know what, tf, i equal to.
4 comentarios
James Tursa
el 18 de Nov. de 2019
Editada: James Tursa
el 18 de Nov. de 2019
I'm not really sure what is being asked for here. The expressions for dr/dt and dtheta/dt are just going to be based on the integrals of your double_dot equations. What are you being asked for beyond that? The post doesn't ask for numerical solutions. Is that something you added?
Respuesta aceptada
James Tursa
el 18 de Nov. de 2019
Editada: James Tursa
el 18 de Nov. de 2019
You've got two 2nd order DE's, so that means you have a 4th order system (2x2=4) and thus your state vector will contain four elements. You could define them as follows:
y = your 4x1 state vector with the following definitions
y(1) = r_r
y(2) = v_r
y(3) = r_t
y(4) = v_t
Then your derivative function outline would be:
function dy = myeqn(t, y)
% put some constants here or pass them in, e.g. mu etc.
dy = zeros(size(y));
dy(1) = y(2); % derivative of r_r is v_r
dy(2) = ___; % you fill this in from your r_r doubledot equation
dy(3) = y(4); % derivative of r_t is v_t
dy(4) = ___; % you fill this in from your r_t doubledot equation
end
For the dy(2) and dy(4) code, you will need to calculate your gamma value from the y vector. You could either hardcode the other stuff (D, L, m, etc.) or pass them in as input arguments. To start with, you will need to define initial values for all four states, not just v0. Also, I would have expected to see a factor somewhere on the r_t double dot equation based on the atmospheric density (a function of altitude), but I don't see it ... and this seems suspicious to me.
2 comentarios
James Tursa
el 18 de Nov. de 2019
Editada: James Tursa
el 18 de Nov. de 2019
The y-vector is exactly what I have stated. It contains four elements as defined above. The radial position, radial velocity, tangential position, and tangential velocity.
Más respuestas (1)
darova
el 18 de Nov. de 2019
- Any guidance on it is much appreciated!
Helpfull page: ODE45
- I do not know what I can do if I no tf.
Try tf = 5. This should work
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!