Solving EOM coupled equations using ode45
11 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Jose Narvaez
le 30 Nov 2019
Réponse apportée : Stephan
le 30 Nov 2019
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.
Réponse acceptée
Stephan
le 30 Nov 2019
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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Ordinary Differential Equations dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!