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!