Solving EOM coupled equations using ode45
11 ビュー (過去 30 日間)
古いコメントを表示
Hello,
I've been having trouble trying to solve this in ode45. I've never worked on coupled equation before.
y''=(3/2)(9.81*sin(y)-x''*cos(y)) and 11*x''+(1/2)cosy*y''-(1/2)siny*y'^2+2x+0.3x'=10
If you can help me out, it would be greatly appreciated.
採用された回答
Stephan
2019 年 11 月 30 日
syms x(t) y(t)
eq(1)=diff(y,t,2)==(3/2)*(9.81*sin(y)-diff(x,t,2)*cos(y));
eq(2)=11*diff(x,t,2)+(1/2)*cos(y)*diff(y,t,2)-(1/2)*sin(y)*diff(y,t)^2+2*x+0.3*diff(x,t)==10;
[E,V] = odeToVectorField(eq)
fun = matlabFunction(E,'vars',{'t','Y'});
tspan = [0 10];
init = [0 0 1 0];
[t,y] = ode45(fun,tspan,init);
plot(t,y)
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Ordinary Differential Equations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!