dsolve running too long

4 ビュー (過去 30 日間)
David Togonidze
David Togonidze 2022 年 4 月 24 日
コメント済み: David Togonidze 2022 年 4 月 25 日
Hey guys, I have an issue where I am trying to solve 7 ODEs with 7 initial conditions but it takes way to long to compute. I let it run for an hour and no solution. What can i do about it? Thanks in advance for help.
Heres the code:
eul_d=[pi/2 pi pi/3];
quat_d=eul2quat(eul_d);
eul_0=[0 0 0];
quat_0=eul2quat(eul_0);
eta_d=quat_d(1,1);
eta_0=quat_0(1,1);
epsilon_d=[quat_d(1,2); quat_d(1,3); quat_d(1,4)];
epsilon_0=[quat_0(1,2); quat_0(1,3); quat_0(1,4)];
I=[250000 0 0;0 100000 0;0 0 110000];
syms omega1(t) omega2(t) omega3(t) eta(t) epsilon1(t) epsilon2(t) epsilon3(t)
ode1 = diff(omega1,t) == (80000-2*epsilon1*eta_d-2*epsilon2*epsilon_d(3,1)+2*epsilon3*epsilon_d(2,1)+eta*epsilon_d(1,1)-1.5*omega1+3+I(2,2)*omega3*omega2-I(3,3)*omega2*omega3)/I(1,1);
ode2 = diff(omega2,t) == (155000-2*epsilon2*eta_d+2*epsilon_d(3,1)*epsilon1-epsilon1*epsilon_d(3,1)+epsilon_d(2,1)*eta-1.5*omega2+1.5-I(1,1)*omega3*omega1+omega1*I(3,3)*omega3)/I(2,2);
ode3 = diff(omega3,t) == (-292300-2*epsilon3*eta_d-2*epsilon1*epsilon_d(2,1)-epsilon_d(1,1)*epsilon2+eta*epsilon_d(3,1)-1.5*omega3+0.75+omega1*omega2*I(1,1)+omega1*omega2*I(2,2))/I(3,3);
ode4 = diff(epsilon1,t) == -0.5*(-omega2*epsilon2+omega2*epsilon3-eta*omega1);
ode5 = diff(epsilon2,t) == -0.5*(omega3*epsilon1-omega1*epsilon2-eta*omega2);
ode6 = diff(epsilon3,t) == -0.5*(-omega2*epsilon1+omega1*epsilon2-eta*omega3);
ode7 = diff(eta,t) == -0.5*(omega1*epsilon1+omega2*epsilon2+omega3*epsilon3);
odes = [ode1; ode2; ode3; ode4; ode5; ode6; ode7];
cond1 = omega1(0) == 1;
cond2 = omega2(0) == 0;
cond3 = omega3(0) == 0;
cond4 = epsilon1(0) == epsilon_0(1,1);
cond5 = epsilon2(0) == epsilon_0(2,1);
cond6 = epsilon3(0) == epsilon_0(3,1);
cond7 = eta(0) == eta_0;
conds = [cond1; cond2; cond3; cond4; cond5; cond6; cond7];
S=dsolve([odes, conds], 'MaxDegree',2);
  2 件のコメント
Torsten
Torsten 2022 年 4 月 24 日
Your system of ODEs is nonlinear.
I think you can cancel the symbolic computation and use ODE45 or ODE15S to solve the system numerically.
David Togonidze
David Togonidze 2022 年 4 月 25 日
Thank you. With ode 45 it worked.. gives me wrong output but I guess that's me and my algebra :D

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

回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by