Main Content

Model a Planar Pendulum

Consider a point mass m suspended by a massless rod of length l under 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 the x and y directions.

$$
\begin{array}{rclccr}
m\ddot{x}&=&F\sin\theta&&(1)\\
m\ddot{y} + F\cos\theta&=&-mg&&(2)\\
\end{array}
$$

Let (u, v) be the velocities in (x, y) respectively. The system can be rewritten as a system of first order ODEs

$$
\begin{array}{rclccr}
\dot{x} &=&u&&(3)\\
\dot{u}&=&-F\frac{x}{ml}&&(4)\\
\dot{y} &=&v&&(5)\\
\dot{v} &=&-F\frac{y}{ml} - g&&(6)
\end{array}
$$

where F is the tension in the rod. The system also possesses the geometric constraint

$$\begin{array}{rclccr}x^2 + y^2 &=& l^2&&(7)\end{array}$$

Differentiate (7) twice with respect to time t to arrive at

$$
\begin{array}{rclccr}
m(u^2 + v^2) -Fl-mgy&=&0&&(8)
\end{array}
$$

This relationship is useful since it allows F to 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 unknown F and is of the form f(z) = 0 where $f(z) = m(u^2+v^2)-Fl-mgy$. The Algebraic Constraint block constrains f(z) to 0 and solves for F in 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.