how to solve 3dof point mass equations of motion of flight vehicle
10 views (last 30 days)
i have to solve 6 differential equations of 3dof system of flight vehicle abd plot them. i have run a code but i am not getting appropriate results.
plzz anyone help me how to do that.
clear all;close all;clc;
t = 0:0.1:15;
y0= [0.5 0.5 0.5 0.5 0.5 0.5];
[tsol ysol] = ode45(@threedof, t, y0);
velocity = ysol(:,1);
yaw_angle = ysol(:,2);
pitch_angle = ysol(:,3);
x = ysol(:,4);
y = ysol(:,5);
z = ysol(:,6);
function solveode = threedof(t,y);
T = 2000; m = 200; g = 9.81; gamma = 10*pi/180; V=100; phi = (10*pi/180); %Vvec= [V;0;0];
D = 00; S=00; L = 0000;
solveode = [fval(1);fval(2);favl(3);fval(4);fval(5);fval(6)];
Bjorn Gustavsson on 13 Jun 2022
A three-degrees-of-freedom dynamic system in three spatial coordinates doesn't have yaw and pitch degrees of freedom. It is effectively modeling the trajectory of a particle. As such your ODE-function looks dodgy. My standard way of writing equations-of-motion are, something like:
function d2ydt2dydt = threedof(t,y)
T = 2000; % describe units...
m = 200;
g = 9.81;
gamma = 10*pi/180;
phi = (10*pi/180); %Vvec= [V;0;0];
D = 0; % Drag?
S = 0; % Some other parameter?
L = 0; % Lift
V = y(1:3); % I prefer to order the state-vector as [r;v], but this is purely convention
T = T*V/norm(V); % Just setting the thrust parallel to V, adjust to your case.
F_drag = -D/m*V(:);
F_thrust = T(:)/m;
% Calculate the other forces on your particle too
dydt = V; %
d2ydt2 = [F_thrust + F_drag - g*[0 0 1]]; % add the forces together
d2ydt2dydt = [d2ydt2; dydt];