Model a Planar Pendulum
Consider a point massmsuspended by a massless rod of lengthlunder the influence of gravity. The position of the mass can be expressed in Cartesian coordinates by(x,y).
Modeling the System
A force balance of the mass gives the equations of motion in thexandydirections.
Let(u, v)be the velocities in(x, y)respectively. The system can be rewritten as a system of first order ODEs
whereFis the tension in the rod. The system also possesses the geometric constraint
Differentiate (7) twice with respect to timetto arrive at
This relationship is useful since it allowsFto determined at every step for use in modeling the kinematics of the system.
Simulating the System
The system is simulated as shown in the figure below
Equation (8) contains one unknownFand is of the formf(z) = 0where. The Algebraic Constraint block constrainsf(z)to 0 and solves forFin accordance with (8).
References
Hairer, Ernst, Christian Lubich, and Michel Roche. "The Numerical Solution Of Differential-Algebraic Systems By Runge-Kutta Methods."Lecture Notes in Mathematics.Vol. 1409, Berlin: Springer-Verlag, 1989: pp. 8-9.