Objective: Simulated the constrained dynamics of a multi-body planar system involving impacts, external forcing, and rigid-body motion using symbolic and numerical methods.
Requirements: Model a 2D system with at least two rigid bodies, rotational inertia, collisions, and external inputs. Derive equations using Euler-Lagrange mechanics, enforce impact constraints, and visualize the simulation with an animated trajectory.
Top Skills: dynamics modeling, Python (SymPy, NumPy), symbolic computation, Lagrangian mechanics, constrained systems
This ME314 final project involved simulating a jack bouncing inside a box (a planar system with six degrees of freedom, impacts, and external forcing). I modeled the system using rigid-body transformations and Euler-Lagrange equations, enforced impact constraints via energy and momentum conservation and visualized the simulation in Colab.
Simulation Video
Bodies:
A square box with four walls (modeled as a rigid body)
A jack with four protruding arms ("knobs")
Generalized Coordinates (6):
[x_box, y_box, θ_box, x_jack, y_jack, θ_jack]
Modeling Approach:
Rigid body transformations defined jack and wall points
Homogeneous coordinates used for all position mappings
Signed distances tracked to detect contact events
System Frames With Coordinate Systems
Lagrangian:
Built from kinetic and potential energy of both the box and jack
External Forcing Applied:
Horizontal force: Fₓ = 300·sin(2πt/3)
Torque: τ = 45000·sin(2πt/3)
Constant lift to counteract gravity
Impact Update Logic:
Contact detection when distance φ < 1e−1
Velocity jump handled via Lagrange multiplier
Energy conservation enforced using the Hamiltonian
Jack begins at rest towards the center of the box
External shaking causes the jack to bounce and rotate upon impact
Impacts correctly handled through constrained momentum updates
Accurate physics with visible bouncing, sliding, and torque-induced rotation
Configured symbolic expressions in SymPy and used lambdify function to evaluate dynamics over time
This project gave me experience with constrained multibody dynamics and impact modeling using conservation laws. I built confidence working with symbolic mechanics, rigid-body transforms, and dynamic visualization in Python. If I had more time, I would have explored a more complex aerospace-related system, such as simulating aircraft landing gear dynamics with a spring-mass-damper model.