spherical pendulum - lagrange mechanics - theoretical physics

solve the equations of motion and plot the pendulum's trajetory
다운로드 수: 188
업데이트 날짜: 2018/7/11

라이선스 보기

The problem is a nice simple example which can be found in any textbook on Theoetical Mechanics.
The position of the pendulum is described by two generalized coordinates (in spherical polar coordinates) theta and phi (r is constant). Using Lagrange2 equation a system of two second order nonlinear ordinary differential equations arises, which first has to be linearized to a system of 4x now first order ODEs in order to then be solved numerically by one of the matlab buildin solvers.
Here are the lines of code i'm refering to:
y10 = [0.4*pi 0 0 1.5]; % Initial Conditions for [ theta theta' phi phi'] at time t=0
f = @(t,y)[y(2);(( y(4))^2).*sin(y(1)).*cos(y(1))-(g/R).*sin(y(1)) ; y(4);-2.*(cos(y(1)).*y(2).*y(4))./(sin(y(1)))];
[t,y] = ode45(f,tspann,y10); % call ODE45 solver

인용 양식

Lucas Tassilo Scharbrodt (2024). spherical pendulum - lagrange mechanics - theoretical physics (https://www.mathworks.com/matlabcentral/fileexchange/67996-spherical-pendulum-lagrange-mechanics-theoretical-physics), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2017b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 General Physics에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

sphericalPendulum/

버전 게시됨 릴리스 정보
1.0.0.0

added a screenshot as cover