Numerical Solution of a Mechanics Braintwister Problem
Frank Wang, fwang@lagcc.cuny.edu
In 1995, Boris Korsunsky published a collection of what he called "braintwisters" physics problems. In 2011, Norman Paris and Michael L. Broide presented a comprehensive analysis of one of the mechanics problems involving the coupled motion of two blocks. This worksheet demonstrates how to use Maple to derive the equations of motion using the calculus of variations, and to solve the differential equations numerically.
The braintwister problem is the following. The system shown in Figure 1 is allowed to move freely from the state of rest (no friction). What would happen first: block 1 will hit the pulley or block 2 will hit the wall? The initial distance from the pulley and the mass is the same for both blocks.
Figure 1: Braintwister problem. Source: Physics Teacher.
The solution, as described by Mr. Korsunsky, is amazingly brief. Just consider the horizontal components. The force of tension of the string (which is the same from both blocks) is the only one that contributes to the horizontal acceleration of both blocks. Of course the horizontal component of the force at all times will be greater for block 1. Since both blocks have the same distance to to, block 1 will win the race.
Yet when Professors Paris and Broide asked their students to solve this problem, only about half of the students got the right answer, with right or wrong explanations. For this reason, they presented a thorough analysis which answers more detailed questions. For example, at that angle is block 2 when block 1 hits the pulley? How long does it take block 1 to reach the pulley? How can we modify the starting conditions so that the two blocks tie?
The variables used in their analysis is defined in the Figure 2 (courtesy of Professors Paris and Broide). The coordinate of block 1 is (), and that of block 2 is (). The constant string length places a constraint on and :
.
Using polar coordinates for block 2, and . The potential energy is zero when block 2 is at .
Figure 2: From the American Journal of Physics
restart:
x1 := r(t)-2*d;
x2 := r(t)*sin(theta(t));
y2 := -r(t)*cos(theta(t));
In Cartesian coordinates, the Lagrangian (kinetic energy minus potential energy) is
L := 1/2*m1*diff(x1,t)^2 + 1/2*m2*(diff(x2,t)^2 + diff(y2,t)^2) - m2*g*y2;
Maple simplifies the Lagrangian in polar coordinates:
L := combine(L);
The equations of motion are derived by applying the Euler-Lagrange equation
- = 0
in which is a coordinate and = . For this problem, and .
Because and and their derivatives are functions of time that cannot be differentiated directly using the diff command, we substitute them with symbols var1, var2, etc. This technique has been used to solve many problems in classical mechanics and general relativity; see references.
L1 := subs({r(t)=var1, theta(t)=var2, diff(r(t),t)=var3, diff(theta(t),t)=var4}, L);
Epr1 := diff(L1, var3);
Epr2 := diff(L1, var1);
Epr3 := subs({var1=r(t), var2=theta(t), var3=diff(r(t),t), var4=diff(theta(t),t)}, Epr1);
Epr4 := subs({var1=r(t), var2=theta(t), var3=diff(r(t),t), var4=diff(theta(t),t)}, Epr2);
Epr5 := diff(Epr3, t);
Eq6 := Epr5 - Epr4 = 0;
Epr11 := diff(L1, var4);
Epr12 := diff(L1, var2);
Epr13 := subs({var1=r(t), var2=theta(t), var3=diff(r(t),t), var4=diff(theta(t),t)}, Epr11);
Epr14 := subs({var1=r(t), var2=theta(t), var3=diff(r(t),t), var4=diff(theta(t),t)}, Epr12);
Epr15 := diff(Epr13, t);
Eq16 := Epr15 - Epr14 = 0;
We list the two equations of motion.
Eq6;
Eq16;
For a numerical example, let the string length be m, and mass of both blocks be 0.05 kg. Acceleration due to gravity, , is of course 9.8 m/.
g := 9.8;
m1 := 0.05; m2 := 0.05; d := 0.5;
The initial condition is
ini := r(0) = d, theta(0) = Pi/2, D(r)(0)=0, D(theta)(0)=0;
We use Maple's dsolve command to obtain numerical solution of the differential equations.
Soln := dsolve({Eq6, Eq16, ini}, {r(t), theta(t)}, numeric, output=listprocedure);
with(plots): with(plottools):
odeplot(Soln, [t, r(t)], 0..0.55, view=[0..0.52, d..2*d]);
odeplot(Soln, [t, theta(t)], 0..0.55, view=[0..0.52, 0..Pi/2]);
From the plot of versus , we estimate that reaches 1 m at about 0.51 s. The values of evaluated at this instance is
Soln(0.51);
It might be easier to think in terms of degrees:
rhs(Soln(0.51)[4])/evalf(Pi)*180;
Based on the numerical solution, we conclude that block 1 hits the pulley before block 2 swings into the side of the table. When block 1 hits the pulley, the angle of the string from the vertical is about 7.3 degrees.
We produce an animation to demonstrate the motion of the blocks.
b := 0.03;
pu := disk([0,0], b/2, color=gray):
noff := 51: divs := 100:
for i from 0 by 1 to noff do x1c := rhs(Soln[2](i/divs))-2*d; x1l := x1c-b/2; x1r := x1c+b/2; y1l := 0; y1r := b; x2c := rhs(Soln[2](i/divs))*sin(rhs(Soln[4](i/divs))); y2c := -rhs(Soln[2](i/divs))*cos(rhs(Soln[4](i/divs))) + b/2; x2l := x2c-b/2; x2r := x2c+b/2; y2l := y2c-b; y2r := y2c; r1[i] := rectangle([x1l,y1l], [x1r,y1r], color = red); l1[i] := line([x1c, b/2], [0, b/2], color=black, thickness=2); l2[i] := line([0, b/2], [x2c, y2c], color=black, thickness=2); r2[i] := rectangle([x2l,y2l], [x2r,y2r], color = blue); anima[i] := display({r1[i], l1[i], l2[i], r2[i], pu}, scaling=constrained): end do:
display([seq(anima[i], i=1..noff)], insequence=true);
It is convenient to modify the worksheet to discover the conditions for tie. By gradually increasing the mass of block 1, we find that when , it is a tie.
We can also change the initial condition to make it a tie. A systematic investigation reveals when (or ), it is a tie.
References
1. Boris Korsunsky, "Braintwisters for Physics Student," Physics Teacher 33, 550-553 (1995).
2. Norman Paris and Michael L. Broide, "Unraveling a classical mechanics brain twister," American Journal of Physics 79, 1250-1254 (2011).
3. Frank Wang and J. F. Ogilvie, "Motion of a heavy symmetric top," Maple Application Center, http://www.maplesoft.com/applications/view.aspx?SID=4161.
4. Frank Wang and Samuel Gelfman, "Complex numbers and the Lagrangian," Maple Reporter, Winter 2002, 7.
5, Frank Wang and J. F. Ogilvie, "Trajectory near a black hole," Maple Application Center, http://www.maplesoft.com/applications/view.aspx?SID=4240.
6. Frank Wang, Physics with Maple, the Computer Algebra Resource for Mathematical Methods in Physics, Wiley-VCH (2006).