How to use Eulers angle and ode45 to generate trajectory of aircraft

2 次查看(过去 30 天)
I am having trouble setting up Euler angles into the ode45 command.

回答(1 个)

Amir Kleiner
Amir Kleiner 2018-11-15
if you need to enter any kind of additional input into the function you are solving with any of the ode45 (or any other ode solver) you can do it in the following way:
First of all you should define your function with 3 input vectors.
dy = yourFunction(t, y, par)
the 3rd vector can be any type of array, which then you can use as you wish inside you function.
Then when you try to solve the ode system you first have to define the "par" array and call ode45 in the following way:
par = %whateve you like
[t, y]=ode45(@(t,y) yourFunction(t,y,par), tspan, y0, par)
hope this helps. If you upload your code the answer could be better :)

类别

Help CenterFile Exchange 中查找有关 Ordinary Differential Equations 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by