Professional Documents
Culture Documents
Pendulum-Cart System: Analysis of The Equations of Motions
Pendulum-Cart System: Analysis of The Equations of Motions
Pendulum-Cart System: Analysis of The Equations of Motions
Denis Kartachov
2
Table of Contents
3
The pendulum-cart system
The pendulum-spring-mass system consists of two oscillating systems. The cart
is attached to a spring which is itself attached to a wall. The cart is then pulled from its
equilibrium position and engages in oscillatory motion. In addition there is a pendulum
hanging below the cart, which can also be given initial conditions by pulling it at some
angle to the vertical. The motion of the cart causes the pendulum to oscillate as well. In
the following diagram, the cart moves to the left with the pendulum following because of
the cart’s inertia:
4
Free-body-diagram of the pendulum
Figure 2 shows all the forces acting on the pendulum of mass . The tension in the rope
attached to the mass prevents it from flying away, and is given by . The gravitational
force, , acts vertically downward and affects the motion of the pendulum. The other
force is the frictional force . To find this force, one can assume that the torque friction is
proportional to the angular velocity of the pendulum, that is:
To find the friction force, one can express the left hand side term for torque as follows:
5
Hence the friction force is itself proportional to the angular velocity, with a constant of
proportionality given by , where is the coefficient of friction and is the length of the
pendulum. Before analyzing the forces acting on the pendulum, it is essential to derive
the position, velocity and acceleration of the pendulum. To do this, one can make the
following observations:
= +
=−
Where , are the horizontal and vertical positions of the pendulum, and is the
displacement of the cart from its equilibrium position. Differentiating these equations once
gives the velocity of the pendulum:
= +
= ′
= + ( −( ) )
= ( +( ) )
Now it is possible to analyze the forces acting on the pendulum using Newton’s second
law:
− cos − sin =
6
=
cos − sin − = ′′
Equations (1) and (2) are the equations of motions for the pendulum. Next, the equations
of motion for the cart will have to be derived.
The diagram above shows all the forces acting on the cart. The cart is being displaced
to the left by . The frictional force opposes this motion, and is assumed to be proportional
to the velocity of the cart, i.e.: , where is the coefficient of friction. Similarly, the
restoring force of the spring opposes the motion of the cart and is given by , where
7
is the spring constant. The tension from the pendulum’s rope as acts on the cart, given
by . Another important force to consider is the frictional force from the pendulum itself.
Just like the force of tension, Newton’s third law says that the frictional force acting on the
pendulum also acts on the cart, in the opposite direction. The other forces include the
gravitational force , which is countered by the normal force exerted by the surface
underneath, . Using Newton’s second law, the forces can be split into their horizontal
and vertical components as follows:
=0
+ sin − − cos =0
The only equation of motion that will be needed for the cart is equation (3), because the
cart does not accelerate in the vertical direction.
Equations of motion
So far, the following three equations of motions have been derived:
All the constants in the equations (4) are given except for the tension, . It would be
much simpler to work with two equations by eliminating the tension variable from the mix.
A new equation of motion can be derived by adding equations I and II of (4) as follows:
8
− − = [ + cos − ( ) sin ] +
− − =( + ) + cos − sin
( + ) + + = sin − cos (5)
To find a second equation of motion similar to (5), equation I of (4) can be multiplied by
cos and equation II of (4) can be multiplied by sin to obtain the following equations:
These two equations can be added together to yield the following equation of motion:
Now there are only two equations of motion which contain only known variables. The
following system of differential equations (5) and (6) can now be solved:
( + ) + + = sin − cos
(7)
cos + =− − sin
Upon quick inspection, the equations of motion (7) are non-linear because of the
cosine/sine terms as well as the angular velocity term squared. A numerical approach
must be utilized to solve this system of differential equations.
9
Uncoupling the equations of motion
Before proceeding with the solutions, the equations of motion in (7) must be written as a
system of four first order differential equations. First, the equations of motion must be
uncoupled, that is, they must be rewritten such that they contain only one second order
derivative. One equation can be derived by multiplying the second equation of (7) by
cos and adding the two equations, as follows:
Similarly, to find a second uncoupled equation of motion, the first equation of (7) can be
multiplied by cos , and the second equation can be multiplied by −( + ). These
two equations can then be added to obtain:
cos + cos − ( + )
− cos ( + )
10
Therefore the new uncoupled equations of motion are (8) and (9):
State-space representation
To numerically solve the equations of motion, the system of second order differential
equations (10) must be expressed as a system of first order differential equations.
Because there are two equations in (10), one can expect four first order differential
equations. The following change of variables can be made:
=
=
=
=
This change of variables transforms the system of equations (10) into a system of four
first order differential equations:
=
⎧
=
⎪
⎪ sin + sin cos + cos − −
=
+ sin (11)
(11)
⎨
⎪ − sin cos − 1+ −( + ) sin + cos ( + )
⎪ =
⎩ ( + sin )
This is the state-space form of the equations of motions that can be used to find numerical
solutions. Some constants will be substituted by the following values:
11
=5
⎧ = 0.05
⎪
= 25
⎨ = 9.8
⎪
⎩ = 0.25
The values for the coefficients of friction , are not determined as of now because they
will be constantly changed to study different cases. Substituting the values for the
constants above as well as changing the variables for more intuitive ones yields the
following state-space representation of the equations of motion:
′=
⎧ ′=
⎪ 1
⎪ sin + 0.49 sin cos + 4 cos − − 25
′= 80 (12)
⎨ 5 + 0.05 sin
⎪ 1
⎪ − 80 sin cos − 404 − 49.49 sin + cos ( + 25 )
⎩ ′= 1.25 + 0.0125 sin
Here, is the velocity of the cart and is the angular velocity of the pendulum.
(1) =
⎧
(2) =
⎨ (3) =
⎩ (4) =
12
The following figure shows the Matlab function for the equations of motion (12).
The following script can be used to input initial conditions for the equations of motion:
13
= =1
= = 0.001
The value for the coefficient of friction of the cart in this case is relatively high, and the
coefficient of friction for the pendulum is rather low. Inputting these initial values as well
as the coefficients of friction into the Matlab program results in the following graphs:
14
Figure 8: Position graphs for cart and pendulum
15
Figure 9: Velocity graphs for cart and pendulum
As expected, the cart barely experiences any motion. Its position remains almost
fixed at the equilibrium point = 0, and its velocity is almost zero as well. The position
and motion of the cart are not exactly constant, as there are very slight oscillations seen
in figures 8 and 9. Overall, however, the motion of the cart can be ignored. It’s important
to point out that the coefficient of friction for the cart did not influence its motion. This is
mainly due to the initial conditions. It was assumed that the cart started at the equilibrium
point with no initial velocity. Because the pendulum’s mass is small compared to the
cart’s mass, and because of the spring’s stiffness, the cart does not exhibit noticeable
motion.
The pendulum, on the other hand, experiences clear damped simple harmonic
motion. In figure 8, the pendulum’s amplitude decreases exponentially as a function of
time. This decrease is influenced by the pendulum’s coefficient of friction. Similarly in
figure 9, the pendulum’s maximum velocity also decreases exponentially. This first case
was trivial and showed intuitive results. It is also possible for the pendulum to remain
relatively stationary with the cart experiencing simple harmonic motion. The results are
very similar, so they will not be included. More interesting cases arise when the cart is
given an initial displacement.
It will also be assumed that the coefficients of friction are relatively low to allow the cart
and the pendulum to experience oscillatory motion:
16
= = 0.1
= = 0.001
Inputting these initial conditions and values for coefficients of friction in the Matlab function
solver script gives the following graphs:
17
Figure 11: Velocity graphs for cart and pendulum
This case is very interesting because both the cart and pendulum experience oscillatory
motion. Considering first figure 10, one can make the observation that the cart’s
amplitude of oscillation is constant. This makes quite some sense because the mass of
the cart is much larger than the mass of the pendulum, and its motion shouldn’t really be
affected by the pendulum. On the other hand, the pendulum’s position is heavily
influenced by the cart’s motion. As seen in figure 10, the pendulum tries to keep up with
the cart’s oscillation and results in weird patterns.
Similarly in figure 11, the cart’s motion is unaffected by the pendulum; the
amplitude of its velocity is constant, for the same reasons explained above. The
pendulum’s motion is also affected by the cart’s motion. One can also notice that in both
figures, the pendulum’s amplitude seems to converge toward the cart’s amplitude. This
18
can’t clearly be seen because of the short 10 second timespan. The timespan can be
increased to reveal the graphs’ intricacies:
Figure 12: Position graph for cart and pendulum (larger timespan)
19
Figure 13: Velocity graphs for cart and pendulum (increased timespan)
As expected, the amplitude oscillation for the pendulum in figures 12 and 13 converges
toward the cart’s amplitude before dropping even lower and remaining constant.
Obviously, the pendulum and cart start out by oscillating out of phase as seen in figures
10 and 11. However, given enough time, the cart and pendulum will eventually oscillate
in phase as figures 12 and 13 clearly show. As it turns out, the initial conditions do not
affect the change in phase difference over time. In fact, the spring constant has an effect
on the phase difference between both oscillations. This will be discussed in a separate
section.
20
Case 3: Cart & pendulum in motion, considerable friction
Another case of interest to be considered is when the cart and pendulum are both affected
by friction, although they are still capable of oscillatory motion. Similarly as in case 2,
both the pendulum and the cart will be given initial conditions, as follows:
As this case suggests, the coefficients of friction will be high enough to damp the
oscillatory motions of the pendulum and the cart. The following values are assigned:
= =1
= = 0.1
Inputting these initial conditions along with the coefficients of friction into the Matlab
function solver gives the following graphs for the position and velocity of both the
pendulum and the cart:
21
Figure 14: Position graphs for cart and pendulum
22
For this case, the frictions will have to be relatively high to damp the system:
= = 10
= = 0.9
Under these conditions, the Matlab function solver script reveals the following graphs
23
Figure 16: Position graphs for cart and pendulum
24
As mentioned previously, the phase difference seems to depend on the spring constant.
For a given set of masses, it is possible to alter the spring constant to achieve different
phase oscillations. After experimenting with different values in Matlab, it turns out that
increasing the spring constant up to a specific value will make both components oscillate
in-phase. For demonstration purposes, the following masses will be assigned for the cart
( ) and pendulum ( ):
=2
=1
By fixing these values and altering the value for the spring constant, it is possible to obtain
oscillations in phase and out of phase. Although the conditions for these combinations
aren’t explained in this paper, the results seem promising. The coefficients of friction in
this section are 0.1 for the cart and 0.001 for the pendulum. The initial conditions are the
same as in case 1. For example, consider the following position graphs for the cart and
pendulum with different values for the spring constant :
25
Figure 18: k=25N/m
26
Figure 20: k=100N/m
The lowest value for the spring constant shows the position of the cart and pendulum as
seen in figure 18. The phase difference seems pretty random; same goes for the higher
spring constant seen in figure 19. Actually, it also looks like they are in phase at some
points and out of phase in others. However, when the spring constant reaches a
numerical value of 100 it seems like the components oscillate in phase right from the
beginning. When the spring constant exceeds this value, the position graphs are similar
to the ones in figures 18 and 19. Obviously, there seems to be a sweet spot for the spring
constant which makes the components oscillate completely in phase. Apart from trial and
error, it is unlikely that there is an explicit way to calculate this value. In fact, there may
be other such values. Keep in mind that the length of the pendulum was held constant at
0.25 in all three trials. For such an oscillation to occur, the length of the pendulum has
to remain pretty small.
On the other hand, decreasing the spring constant tends to yield an out of phase
oscillation. For instance, the following graphs show the positions of the cart and
pendulum for very small values of :
27
Figure 21: k=5N/m
28
Figure 22: k=5N/m
As seen in figures 21 and 22, decreasing the spring constant makes the components
oscillate out of phase. Obviously, with such a low spring constant, the cart’s motion will
be heavily affected by the pendulum. There are most likely other combinations which can
give similar results, but the spring constant definitely seems to affect the phase difference
between both oscillations.
29
References
http://www.myphysicslab.com/pendulum_cart.html
http://www.mathworks.com/matlabcentral/
30