File Exchange

image thumbnail

Bead sliding on rotating rod - Lagrange Mechanics

version (251 KB) by

solve and animate equations of motion



View License

The position of the bead is given by two coordinates : phi and rho - angle and radius in polar coordinates.
The 2x 2nd order Equations of motion are derived with Lagrange2 formalism.
In order to be solved numerically by matlab buildin ODE solvers the equations have to be
linearized to 4x 1st order ODE's as follows:
w - angular frequency
y0=[0.01 0 0 w]; % [ r dr/dt phi dphi/dt ] initial conditions at t=0
tspan = [0 60];
f=@(t,y)[y(2);w^2 * y(1) ; y(4);0];
[t,y]=ode45(f,tspan,y0); % call ode45 solver
The .zip file contains a mp4-video of the animation.

Comments and Ratings (0)

MATLAB Release Compatibility
Created with R2017b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

MATLAB Online Live Editor Challenge

Win cash prizes and have your live script featured on our website

Learn more

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video