How do I solve this differential equation?
Afficher commentaires plus anciens
Hi,
for a Project I have to solve the following differential equation:
y''=-((m*B0)/I)*sin(y)
m, B0 and I are numerical values
I already tried the following but it won't work.
B0=0.0354;
m=7.6563e-5;
I=1.2272e-14;
tspan=[0, 0.0001];
y0=0.139626;
[t,y] = ode45(@(t,y) odefcn(t,y), tspan, y0);
function dydt=odefcn(y,m,B0,I)
dydt=y;
dydt(1)=-(m*B0)/I*sin(y);
end
Thanks in advance!
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Ordinary Differential Equations dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


