Main Content

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.

$ $ & # xA; \开始{数组}{rclccr} & # xA; m \ ddot {x} & # 38; = & #38;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}
$$

whereFis 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 timetto arrive at

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

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$f(z) = m(u^2+v^2)-Fl-mgy$. 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.