|
First let's solve the simultaneous equations for the pedagogical machine.
- soln = Solve[{m1 ax1==F -T -N, m2 ax2 == T, m3 ax3 == N, m3 ay3 == T - m3 g, ax3 == ax1, ax2 - ax1 + ay3 == 0},{ax1,ax2,ax3,ay3,T,N}]
复制代码 \begin{array}{cc}
\text{ax1}\to -\frac{-F \text{m2}-F \text{m3}+g \text{m2} \text{m3}}{\text{m1}
\text{m2}+\text{m1} \text{m3}+2 \text{m2} \text{m3}+\text{m3}^2} & \text{ax2}\to
-\frac{-F \text{m3}-g \text{m1} \text{m3}-g \text{m3}^2}{\text{m1} \text{m2}+\text{m1}
\text{m3}+2 \text{m2} \text{m3}+\text{m3}^2} \\
\text{ax3}\to -\frac{-F \text{m2}-F \text{m3}+g \text{m2} \text{m3}}{\text{m1}
\text{m2}+\text{m1} \text{m3}+2 \text{m2} \text{m3}+\text{m3}^2} & \text{ay3}\to
-\frac{-F \text{m2}+g \text{m1} \text{m3}+g \text{m2} \text{m3}+g
\text{m3}^2}{\text{m1} \text{m2}+\text{m1} \text{m3}+2 \text{m2}
\text{m3}+\text{m3}^2} \\
T\to \frac{\text{m2} \left(F \text{m3}+g \text{m1} \text{m3}+g
\text{m3}^2\right)}{\text{m1} \text{m2}+\text{m1} \text{m3}+2 \text{m2}
\text{m3}+\text{m3}^2} & N\to -\frac{-F \text{m2} \text{m3}-F \text{m3}^2+g \text{m2}
\text{m3}^2}{\text{m1} \text{m2}+\text{m1} \text{m3}+2 \text{m2}
\text{m3}+\text{m3}^2} \\
\end{array}Next get expressions for the accelerations for some particular choices of masses, and with $F=0$.- {ax1, ax2, ay3} /. soln /. {m1 -> 3, m2 -> 2, m3 -> 1, F -> 0, g -> 1}
复制代码 $$\left\{ -\frac{1}{7}, \frac{2}{7}, -\frac{3}{7} \right\}$$Define a function to produce the state of the machine, starting from rest at $t=0$.- state[t_] ={(-1/7),(2/7),(-3/7)} (1/2)t^2
复制代码 $$\left\{-\frac{t^2}{14},\frac{t^2}{7},-\frac{1}{14} \left(3 t^2\right)\right\}$$Define a function to draw the machine given its state.- machine[{x1_,x2_,y3_}]:= Show[Graphics[{RGBColor[1,0,0],Rectangle[{x1,0},{x1+2,2}],
- Rectangle[{x1+2,0},{x1+3,(1/2)}],Rectangle[{x1+3,0},{x1+4,2}],
- RGBColor[0,1,0],Rectangle[{x2,2},{x2+1,2+1/3}],RGBColor[0,0,1],Rectangle[{x1+2,3/2+y3},{x1+3,2+y3}]}],Axes->True,PlotRange->{{-1,4},{-1,4}},AspectRatio->1]
复制代码
For example at $t=0$, here is the picture: |
| Finally, make a table of snapshots from $t=0$~$2$ and export as PNG.
- Export["D:\\pedmachine.png", Table[machine[state[t]], {t, 0, 2, .1}]]
复制代码 |
|
|
|