I'm studying mechanical engineering and I have to complete an assignment of animating a 2D graphic of a two degree of freedom system response presented on the picture below. I've calculated the response of the system in the code below:
kt1 = 3000(*Nm/rad*);
kt2 = 2000(*Nm/rad*);
L1 = 3(*m*);
L2 = 4(*m*);
L3 = 5(*m*);
m1 = 50(*kg*);
m2 = 70(*kg*);
m3 = 100(*kg*);
g = 9.81(*m/s^2*);
J1 = (m1 L1^2)/3;
Jt2 = (m2 L2^2)/12;
Jt3 = (m3 L3^2)/12;
sol = NDSolve[{J1 (\[Phi]1'')[
t] == ((4 kt2 L1^2 - 2 kt1 L3) \[Phi]1[t] +
2 (2 kt2 L1 (2 + L2) + kt1 L3) \[Phi]2[t] +
L1 (L1 (2 Jt3 - 2 L3 m2 + L3^2 m3) (\[Phi]1'')[
t] + L2 (2 Jt3 - L3 m2 +
L3^2 m3) (\[Phi]2'')[t]))/(2 L3),
Jt2 (\[Phi]2'')[t] ==
1/(4 L3) ((8 kt2 L1 L2 + 4 kt1 L3 - 2 kt2 L1 L3) \[Phi]1[t] +
2 (kt2 (2 + L2) (4 L2 - L3) - 2 kt1 L3) \[Phi]2[t] +
L2 (2 L1 (2 Jt3 - L3 m2 + L3^2 m3) (\[Phi]1'')[
t] + L2 (4 Jt3 - L3 m2 +
2 L3^2 m3) (\[Phi]2'')[t])),
\[Phi]1[0] == 0.1, \[Phi]2[0] == 0.2, \[Phi]1'[0] ==
0.5, \[Phi]2'[0] == 0},
{\[Phi]1[t], \[Phi]1'[t], \[Phi]1''[t], \[Phi]2[t], \[Phi]2'[
t], \[Phi]2''[t]},
{t, 0, 500, 0.001}, Method -> "ExplicitRungeKutta",
MaxSteps -> Infinity]
I'm interested in x-y motion so naturally I first have to convert the coordinates:
Yt2 = L1 \[Phi]1''[t] + (L2 \[Phi]2''[t])/2;
Yt3 = (L3 \[Phi]3''[t] )/2;
\[Phi]3[t] = -((L1 \[Phi]1[t] + L2 \[Phi]2[t])/2);
\[Phi]3''[t] = -((L1 \[Phi]1''[t] + L2 \[Phi]2''[t])/2);
This is where my problem occurs as I have little experience in animating 2D motion. The animation can be minimalistic without the torsion springs included. So id just need two support as shown in the picture and 3 beams that I would assign functions of motion to. My question is if such an animation of the system in the picture is possible in mathematica. And if possible how would i go about making such an animation(which function to use, are there any tutorials out there).
Edit: I fixed a typo and replaced graphic of the model with a more accurate graphic that shows angular displacements and coordinate system.
Animate
.Animate[Show[Graphics[{ Line[{{0, 0}, {1, .5 Sin[t]}, {2, 0}}], Line[{{-.1, -1}, {-.1, 1}}], Triangle[{{-.1, -.1}, {-.1, .1}, {0, 0}}] }]], {t, 0, 10}]
$\endgroup$