How can I retrieve dY when using ode15i

1 回表示 (過去 30 日間)
Zoé Cord'homme
Zoé Cord'homme 2022 年 7 月 18 日
コメント済み: Zoé Cord'homme 2022 年 7 月 18 日
Hello !
I have a program solving a DAE with ode15i, and the DAE looks like this :
where Y = (x, x1, dx) and therefore dY =(dx, dx1,d²x)
function res = f(t,Y,dY)
l0 = [0.09 0.2];
m_materiel = 265959;
course1 = l0(1) - Y(2);
coursetot = l0(1) + l0(2) - Y(1);
course2 = coursetot - course1;
forcemi79 = fmi79(course1,dY(2));
forcemi20 = fmi20(course2,Y(3)-dY(2));
res = [dY(1) - Y(3);
- forcemi20 + forcemi79;
dY(3) - 1/m_materiel*(forcemi20)];
Then, for post proccessing, I need to be able to plot dY(2) = dx1, but I don't understand how I can "retrieve" it after using ode15i like this :
[t,y] = ode15i(@f,tspan,y0,yp0)
Can you help ? thank you, have a great day !

採用された回答

Torsten
Torsten 2022 年 7 月 18 日
編集済み: Torsten 2022 年 7 月 18 日
sol = ode15i(@f,tspan,y0,yp0);
[Y,dY] = deval(sol,tspan);
plot(tspan,dY(:,2))
  1 件のコメント
Zoé Cord'homme
Zoé Cord'homme 2022 年 7 月 18 日
Thank you so much Torsten !!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNumerical Integration and Differential Equations についてさらに検索

製品


リリース

R2014b

Community Treasure Hunt

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

Start Hunting!

Translated by