Borrar filtros
Borrar filtros

Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

How to use ODE45 with two second order linear equation?

1 visualización (últimos 30 días)
Taylor McMillan
Taylor McMillan el 19 de Nov. de 2015
Cerrada: Walter Roberson el 19 de Nov. de 2015
Hello MatLab!
I am currently learning how to use MatLab for a physics research project at my university. I tried writing my own RK45 script but I am not sure if the results I got make any sense, so I want to compare my results with those of ODE45. However, I am unsure how to give ODE45 four first order equations. The equations I want to use are the following,
function vdot = quad_drag_density(t,v)
% Here we will define our constants
m = 1; % Mass of a shell, in kg
g = 9.81; % Acceleration of gravity, in m/s
r = 0.15; % Radius of shell, in m
C_d = 0.4; % Coefficient of drag such that the % drag is proportional to the square % of the speed
A = pi*r^2; % Cross sectional area of shell, in % m^2
x_ddot = (-(1.22)*exp(-y(1)/8500)*C_d*A*sqrt(vx(1)^2 + vy(1)^2) ... *vx(1))/2*m;
y_ddot = - g - ((1.22)*exp(-y(1)/8500)*C_d*A*sqrt(vx(1)^2 ... + vy(1)^2)*vy(1))/2*m;
I spilt each into two first order equations as follows,
dz(1) = z(2);
dz(2) = (-(1.22)*exp(-z(3)/8500)*C_d*A*sqrt(z(2)^2 + z(4)^2) ... *z(2))/2*m;
dz(3) = z(4);
dz(4) = - g - ((1.22)*exp(-z(3)/8500)*C_d*A*sqrt(z(2)^2 ... + z(4)^2)*z(4))/2*m;
vdot = [dz(1); dz(2); dz(3), dz(4)];
and I do not know where to go from here, or if anything I did was correct up to here.

Respuestas (0)

La pregunta está cerrada.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by