Various dynamics and MATLAB examples made while TAing for Andy Ruina's intermediate dynamics.
My conventions for files typically are:
- MAIN - usually the file that starts everything
- RHS - a function which can by integrated with ODE45
- derive/deriver - A script which derives equations of motion (usually) auto-writes a MATLAB function.
Examples include:
- Euler integration
- Using ODE45
- Event detection in MATLAB's ode solvers (bouncing ball example)
- Symbolic toolbox (solving arm kinematics example)
- Best practices for animation (interpolating in time, change plot object data)
Three masses attracted by gravity. Includes:
- Derivation script
- Animation and plotting of solutions
- FSOLVE root finding to look for periodic solutions given an initial guess
- A file containing ~15 periodic solutions I found that can be played back.
4 masses on a plate, some moving, some not. Find plate motion for 0 angular momentum. Full problem statement is inside the folder. Includes:
- Derivation script
- Animation
Weird derivation of simple pendulum with y being horizontal right and x being vertical down. Comes up with a single ODE for y acceleration.
- Mostly about the derivation -- lots of comments in derive.m
- Projectile launched with quadratic drag.
- Minimize velocity and find launch angle required to hit a target.
- fmincon with a nonlinear constraint.
- Derive equations symbolically for n-masses connected by springs with a wall on either side.
- Simulate and animate.