2nd order differential equations
Afficher commentaires plus anciens
For a Project I got to solve these Lagrange equations!
sdolve does not work
I tried formulating 2 equations of first order instead of one equation of second order, but this does not work either. Because there is no explicit solution. Start values would be: phi(0)==0.9424, phi_dot(0)==0
any ideas?
clear
Parameter
m= 100;
c= 3588;
g= 9.81;
syms phi(t) m c g
alpha=sin((1.7-2.1*cos(phi(t)))/3.6);
r1=((-2.1*sin(phi(t))+1.8*cos(alpha))^2+(2.1*cos(phi(t))+1.8*sin(alpha))^2)^0.5;
r1_d=diff(r1);
alpha_d=diff(alpha);
Energie
U=1/2*c*(1.8^2+0.6^2-2*1.8*0.6*cos(phi(t)));
W=m*g*(2.1*cos(phi(t))+1.8*sin(alpha));
V=U+W
T_trans=0.5*m*r1_d^2;
T_rot=1/3*m*3.6^2*alpha_d^2;
T=T_trans+T_rot
Lagrange
T_dv=diff(T,diff(phi(t)));
L_1=diff(T_dv,t);
L_2=diff(T,phi(t));
L_3=diff(V,phi(t));
F=L_1-L_2+L_3
F_s=simplify(F)
F_ss=solve(F_s,diff(phi(t), t, 2))
3 commentaires
Torsten
le 10 Juin 2022
any ideas?
Use "matlabFunction" to create a function handle for your differential equation(s)
matlabFunction(F)
and use "ode15i" to solve the equations numerically.
Patrick Nowohradsky
le 10 Juin 2022
Modifié(e) : Patrick Nowohradsky
le 10 Juin 2022
Ganesh Gudipati
le 15 Juin 2022
Since you didn't initialize the variable phi, MATLAB would be searching if there exists a function 'phi'.
Firstly, intialize the value of phi and procced. This should resolve your error.
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!