Description
Problem 1: 100 points
q
1
q
2
r
1
r
2
Consider the double pendulum above. The link connected to ground is a long thin rod with mass
m1 = 1 kg, length l1 = 1 m, distance from the pin connecting it to ground to its center of mass r1
= 0.5 m, and mass moment of inertia I1 =
m1l
2
1
12 . The second link similarly has m2 = 1 kg, l2 = 1
m, r2 = 0.5 m, and I2 =
m2l
2
2
12 .
Attached to the assignment is a file called “double pend lagrange.m”. This file derives the
equations of motion of the double pendulum. It produces three files containing the Matlab
functions “compute accel.m”, “compute kinetic.m”, and “compute potential.m”, which compute
the angular accelerations ¨q1 and ¨q2 as a vector, the kinetic energy, and potential energy given the
constants, the joint configuration, and joint velocities.
(a) Solve equations of motion. Use “compute accel.m” and Euler integration to compute the
joint angles [q1 q2]
> and velocities [ ˙q1 q˙2]
> as functions of time for 5 seconds. Use the initial
conditions q1 = π/4 and q2 = ˙q1 q˙2 = 0.
(b) Animate your solution. Animate the motion of the pedulum. You might draw the two
links by creating a handle for each and using the command line(). You can then update the
positions of the ends of the two links given your solution from (a) and the commnands
set(h,’Xdata’,[]), set(h,’Ydata’,[]), and drawnow inside a loop.
(c) Plots. Make three plots:
1. A plot of the joint positions as functions of time with a legend labeling q1 and q2
2. A plot of the joint velocities as functions of time with a legend labeling ˙q1 and ˙q2
3. A plot of the kinetic energy, potential energy, and total energy as functions of time with a
legend labelling each. Your total energy should stay roughly constant over time.
2