2nd order differential equations
조회 수: 21 (최근 30일)
이전 댓글 표시
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
Ganesh Gudipati
2022년 6월 15일
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.
답변 (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!