Central difference method to obtain solutions for derived Equations of Motions of UAV aircraft
41 views (last 30 days)
Show older comments
Having trouble find a way to use the central difference method to obtain solutions for nonlinear derived Equations of Motion (EOM) of a UAV aircraft. I have already derived the Equations of Motions but just not sure if I am doing the coding correctly to obtain the solution for the EOM using the time integration method (Central difference method). Can anyone help please
7 Comments
Torsten
on 12 Apr 2024 at 10:55
Edited: Torsten
on 12 Apr 2024 at 10:55
Didn't you read my response ?
You try to use a value in the computation of du_dt that is not yet known, namely u(i+1).
If you hadn't initialized the arrays as
u = zeros(num_steps, 1); % velocity array
alpha = zeros(num_steps, 1);% angle of attack array
q = zeros(num_steps, 1); % pitch rate array
the above error message would have popped up already for i = 2. Now it appears for i = N because the above arrays are only initialized up to index N, but you try to access u(N+1).
It would be interesting to know how the central difference method to solve ODEs works correctly. I cannot find it anywhere in the web.
Answers (0)
See Also
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!