Graphics Programs Reference
In-Depth Information
it can swing through larger angles, even making a 360 rotation if given
enoughvelocity.
Though it is not precisely correct in practice, we often assume that the
magnitude of the frictional forces that eventually slow the pendulum to a
halt is proportional to the velocity of the pendulum. Assume also that the
length of the pendulum is 1 meter, the weight at the end of the pendulum
has mass 1 kg, and the coefficient of friction is 0.5. In that case, the
equations of motion for the pendulum are
x ( t ) = y ( t ) , y ( t ) =− 0 . 5 y ( t ) 9 . 81sin( x ( t )) ,
where t represents time in seconds, x represents the angle of the pendulum
from the vertical in radians (so that x = 0 is the rest position), y represents
the velocity of the pendulum in radians per second, and 9.81 is
approximately the acceleration due to gravity in meters per second squared.
Here is a phase portrait of the solution with initial position x (0) = 0 and
initial velocity y (0) = 5. This is a graph of x versus y as a function of t ,onthe
time interval 0 t 20.
g = inline('[x(2); -0.5*x(2) - 9.81*sin(x(1))]', 't', 'x');
[t, xa] = ode45(g, [0 20], [0 5]);
plot(xa(:, 1), xa(:, 2))
5
4
3
2
1
0
1
2
3
4
1.5
1
0.5
0
0.5
1
1.5
2
Recall that the x coordinate corresponds to the angle of the pendulum and
the y coordinate corresponds to its velocity. Starting at (0, 5), as t increases
we follow the curve as it spirals clockwise toward (0, 0). The angle oscillates
back and forth, but witheachswing it gets smaller until the pendulum is
virtually at rest by the time t = 20. Meanwhile the velocity oscillates as well,
taking its maximum value during each oscillation when the pendulum is in
Search WWH ::




Custom Search