I am trying to model a driven double pendulum acting as a slingshot- a mechanism similar to a Trebuchet. It's the same as shown here http://scienceworld.wolfram.com/physics/DoublePendulum.html but with the mass m1 = 0. I want to apply a torque to the inner arm (l1) of the double pendulum, allowing the outer mass m2 to react to inertial and gravity forces only. I want to be able to vary the torque throughout its cycle and track the motion of the outer mass.
http://scienceworld.wolfram.com/physics/DoublePendulum.html and Erik Mahieu's demonstartion of a driven spherical pendulum use practically the same Lagrangian. In the case of the double pendulum, for the generalised coordinate Theta1 I have just set the Euler equation = Torque, rather than 0.
eqns = {(m1 + m2) l1 \[Theta]1''[t] +
m2 l2 \[Theta]2''[t] Cos[\[Theta]1[t] - \[Theta]2[t]] +
m2 l2 \[Theta]2'[t]^2 Sin[\[Theta]1[t] - \[Theta]2[t]] +
g (m1 + m2) Sin[\[Theta]1[t]] == Torque,
m2 l2 \[Theta]2''[t] +
m2 l1 \[Theta]1''[t] Cos[\[Theta]1[t] - \[Theta]2[t]] -
m2 l1 \[Theta]1'[t]^2 Sin[\[Theta]1[t] - \[Theta]2[t]] +
m2 g Sin[\[Theta]2[t]] == 0, \[Theta]1[0] == 0, \[Theta]2[0] ==
5, \[Theta]1'[0] == 0, \[Theta]2'[0] == 0};
sol = NDSolve[eqns, {\[Theta]1, \[Theta]2}, {t, 0, 1},
MaxSteps -> Infinity, PrecisionGoal -> 4];
pos1[t_] := {l1 Sin[\[Theta]1[t]], -l1 Cos[\[Theta]1[t]]};
pos2[t_] := {(l1 Sin[\[Theta]1[t]] +
l2 Sin[\[Theta]2[t]]), (-l1 Cos[\[Theta]1[t]] -
l2 Cos[\[Theta]2[t]])}
In Mathematica, can I set up a list or matrix of time values of torque, and press run and see what happens? Or there an optimize command to do this?
Otherwise, what I'm looking at is setting up four first order differential equations for the problem, and solving them in Excel, and then playing around with the results. All advice or instructions would be most welcome.