Graphics Programs Reference
In-Depth Information
the middle of its swing (the angle is near zero) and crossing zero when the
pendulum is at the end of its swing.
Next we increase the initial velocity to 10.
[t, xa] = ode45(g, [0 20], [0 10]);
plot(xa(:, 1), xa(:, 2))
10
5
0
5
0
5
10
15
This time the angle increases to over 14 radians before the curve spirals in to
a point near (12.5, 0). More precisely, it spirals toward (4 π , 0), because 4 π
radians represents the same position for the pendulum as 0 radians does.
The pendulum has swung overhead and made two complete revolutions
before beginning its damped oscillation toward its rest position. The velocity
at first decreases but then rises after the angle passes through π ,asthe
pendulum passes the upright position and gains momentum. The pendulum
has just enough momentum to swing through the upright position once more
at the angle 3 π .
Now suppose we want to find, to within 0.1, the minimum initial velocity
required to make the pendulum, starting from its rest position, swing
overhead once. It will be useful to be able to see the solutions corresponding
to several different initial velocities on one graph.
First we consider the integer velocities 5 to 10.
hold on
for a = 5:10
[t, xa] = ode45(g, [0 20], [0 a]);
plot(xa(:, 1), xa(:, 2))
end
hold off
Search WWH ::




Custom Search