7.2  Particle kinetics

“The discovery of the laws of dynamics, or the laws of motion, was a dramatic moment in the history of science.”

— Richard P. Feynman, The Feynman Lectures on Physics, Vol. I, 1963

Where statics asks what forces a body must carry to remain at rest, kinetics asks what motion follows when those forces are out of balance. The bridge between the two is Newton’s second law, which states that the resultant force on a body equals the rate of change of its linear momentum. For a body of constant mass \(m\) this reduces to the familiar form

\[ \sum \bm F_i = m\,\bm a \]

where \(\bm a\) is the acceleration of the center of mass. The expression looks deceptively simple, yet it carries the full content of classical particle dynamics once we recognise that \(\bm a = \ddot{\bm r}\) is a vector and that the sum on the left collects every force acting on the body.

For a rigid body, motion has two parts: the translation of the center of mass and the rotation about it. Euler extended Newton’s law to cover the rotational half, so that the complete equations of motion read

\[ \left\{\begin{array}{ll} \bm F = \sum \bm F_i = m\,\ddot{\bm r} & \text{Translation}\\ \bm M = \sum \bm r_i \times \bm F_i + \bm M_e = \bar I\,\ddot{\bm \theta} & \text{Rotation} \end{array}\right. \]

where \(\bar I\) is the moment of inertia about the center of mass. We take up the rotational part properly in Rigid body kinetics. In this chapter we focus on the translational equation alone, which is justified whenever the rotation of the body is either absent or irrelevant to the answer we seek. Such a body is called a particle, and its motion is fully described by the three scalar components of \(m\,\ddot{\bm r} = \bm F\).

The deeper statement of Newton’s second law is in terms of momentum,

\[ \bm F = \frac{d}{dt}\!\left(m(t)\,\dot{\bm r}(t)\right) = \dot m\,\dot{\bm r} + m\,\ddot{\bm r} \]

which reduces to \(\bm F = m\,\ddot{\bm r}\) only when the mass is constant. The general form is needed for systems where mass changes with time, such as a rocket ejecting fuel, but we shall not pursue that case here.

Solving the equations of motion

The translational equation \(m\,\ddot{\bm r} = \sum \bm F_i\) is a second-order vector ODE in time. To extract a trajectory from it we need three things: the forces written as functions of position, velocity and time; the algebraic relations that fix any contact forces or constraint reactions; and initial conditions on position and velocity. The order in which we set these up is the same one we used in statics, with a time integration appended at the end.

We start by choosing axes aligned with the directions of motion and the surfaces the body contacts, so that each scalar component of \(\bm F = m\bm a\) contains as few terms as possible. We then draw a free body diagram listing every force on the particle. Newton’s second law applied component by component gives a vector equation whose unknowns are the acceleration components together with one or two contact forces, typically a normal force, a tension or a constraint reaction. We solve this algebraic system symbolically first. The resulting expression for \(\ddot{\bm r}\) shows directly how each parameter affects the acceleration, whereas a numerical trajectory only ever shows one specific case. Once the symbolic acceleration is in hand, we substitute numbers and integrate.

Two flavours of solution are common. A transient analysis asks for the full time history \(\bm r(t)\), \(\dot{\bm r}(t)\), \(\ddot{\bm r}(t)\), and is the natural output of an ODE solver. A state-based analysis, by contrast, asks only what happens at a particular configuration, and can often be answered with a work-energy or impulse-momentum statement that bypasses the differential equation entirely. The transient route is more general and is the one we use throughout this chapter; the energy methods will reappear when we treat oscillations and conservative systems.

Example 1: Box pushed at an angle

A worker pushes a box of mass \(m\) across a horizontal floor by leaning on it from above with a force \(P\) inclined at an angle \(\theta\) below horizontal, as shown in Figure 7.2.1. The contact between box and floor is governed by kinetic friction with coefficient \(\mu_k\). The push is applied for a short time \(t_p\) and then released, after which the box glides until friction brings it to rest.

We want to answer three questions:

  1. What acceleration does a given push produce?
  2. How fast is the box moving the instant the push ends?
  3. How far does it travel before it stops, and at what time?
Figure 7.2.1

Step 1 - Free body diagram

We isolate the box and mark every force acting on it (Figure 7.2.2). Four forces are present: the inclined push \(\bm F_{\text{ext}}\), the weight \(\bm F_W\) acting downward at the center of mass, the normal force \(\bm F_N\) from the floor acting upward, and the kinetic friction force \(\bm F_f\) acting backward along the direction of motion. With the \(x\)-axis pointing in the direction of motion and \(y\) pointing up, the four force vectors read

\[ \bm F_{\text{ext}} = P\begin{bmatrix}\cos\theta\\-\sin\theta\end{bmatrix},\quad \bm F_N = \begin{bmatrix}0\\N\end{bmatrix},\quad \bm F_W = \begin{bmatrix}0\\-mg\end{bmatrix},\quad \bm F_f = \begin{bmatrix}-\mu_k N\\0\end{bmatrix}. \]

The minus signs in \(\bm F_{\text{ext}}\) and \(\bm F_f\) are not arbitrary: the push has a downward component because \(\theta\) measures the inclination below horizontal, and friction opposes the motion which we have taken to be in the \(+x\) direction. The acceleration of the box is purely horizontal,

\[ \bm a = \begin{bmatrix}a_x\\0\end{bmatrix}, \]

since the box stays on the floor.

Figure 7.2.2
Code
mu_k, m, g, P, theta, N, a_x, t = sp.symbols('mu_k m g P theta N a_x t', real=True)

FF_ext = P * sp.Matrix([sp.cos(theta), -sp.sin(theta)])
FF_N   = sp.Matrix([0, N])
FF_W   = sp.Matrix([0, -m*g])
FF_f   = sp.Matrix([-mu_k*N, 0])
aa     = sp.Matrix([a_x, 0])

ltx(r"\bm F_{\text{ext}} =", FF_ext,
    r",\quad \bm F_N =", FF_N,
    r",\quad \bm F_W =", FF_W,
    r",\quad \bm F_f =", FF_f)

\[ \bm F_{\text{ext}} =\left[\begin{matrix}P \cos{\left(\theta \right)}\\- P \sin{\left(\theta \right)}\end{matrix}\right],\quad \bm F_N =\left[\begin{matrix}0\\N\end{matrix}\right],\quad \bm F_W =\left[\begin{matrix}0\\- g m\end{matrix}\right],\quad \bm F_f =\left[\begin{matrix}- N \mu_{k}\\0\end{matrix}\right] \]

Step 2 - Equations of motion

Newton’s second law collects the four force vectors on the left and the inertial term on the right,

\[ \bm F_{\text{ext}} + \bm F_N + \bm F_W + \bm F_f = m\,\bm a. \]

Written out component by component this is a \(2\times 2\) algebraic system in the two unknowns \(a_x\) and \(N\) (the push \(P\) and the geometric and material parameters are inputs, not unknowns).

Code
eom = sp.Eq(FF_ext + FF_N + FF_W + FF_f, m*aa)
ltx(r"\sum \bm F = m\bm a \;\Rightarrow\;", eom.lhs, "=", eom.rhs)

\[ \sum \bm F = m\bm a \;\Rightarrow\;\left[\begin{matrix}- N \mu_{k} + P \cos{\left(\theta \right)}\\N - P \sin{\left(\theta \right)} - g m\end{matrix}\right]=\left[\begin{matrix}a_{x} m\\0\end{matrix}\right] \]

Step 3 - Solve for the acceleration and the normal force

Two scalar equations in two unknowns are solved at once.

Code
sol = sp.solve(eom, (a_x, N), dict=True)[0]
a_x_sym = sp.simplify(sol[a_x])
N_sym   = sp.simplify(sol[N])

ltx(r"N &=", N_sym, r"\\ a_x &=", a_x_sym, aligned=True)

\[ \begin{aligned}N &=P \sin{\left(\theta \right)} + g m\\ a_x &=\dfrac{- P \mu_{k} \sin{\left(\theta \right)} + P \cos{\left(\theta \right)} - g m \mu_{k}}{m}\end{aligned} \]

The structure of the result is worth pausing on. The normal force \(N = mg + P\sin\theta\) is larger than the weight alone, because the downward component of the push presses the box harder into the floor. That extra normal force in turn increases the friction force \(\mu_k N\), so the inclined push is less efficient at accelerating the box than a purely horizontal push of the same magnitude. The horizontal component \(P\cos\theta\) does the useful work of accelerating the box; the vertical component \(P\sin\theta\) is wasted twice over, contributing nothing to acceleration and adding to the friction it must overcome. We see this trade-off clearly in the symbolic expression for \(a_x\) before any numbers are inserted, which is exactly why we solve symbolically first.

Step 4 - The push profile and the equation of motion in time

To get a trajectory we have to say how \(P\) depends on time. The simplest model treats the push as a constant force \(P_0\) applied for a short interval \(0 \le t \le t_p\) and zero thereafter,

\[ P(t) = \begin{cases} P_0 & t \le t_p\\ 0 & t > t_p \end{cases} \]

This piecewise definition splits the motion into two phases: a push phase during which the box accelerates, and a glide phase during which only friction acts and the box decelerates until it stops. We write the equation of motion in the form

\[ \ddot x(t) = a_x\bigl(P(t)\bigr), \]

substitute the symbolic expression for \(a_x\) obtained above, and solve the resulting ODE phase by phase, matching position and velocity at the boundary \(t = t_p\).

Warning

The friction model we use, \(\bm F_f = -\mu_k N\,\hat{\bm v}\), where \(\hat{\bm v} = \bm v / \|\bm v\|\) is the unit vector along the velocity, is only valid while the box is moving. Once the box comes to rest the kinetic friction model breaks down and we should switch to static friction. We therefore solve until the velocity reaches zero and stop there: any prediction of the box reversing direction would be an artefact of the model, not physics.

We pick concrete values to make the trajectory visible. A box of \(m = 50\) kg is pushed horizontally (\(\theta = 0\)) with \(P_0 = 4000\) N for \(t_p = 0.3\) s on a floor with \(\mu_k = 0.3\), taking \(g = 9.82\) m/s².

Code
vals = {m: 50, g: sp.Rational(982, 100), mu_k: sp.Rational(3, 10), theta: 0}
P0  = 4000
t_p = sp.Rational(3, 10)

P_t = sp.Piecewise((P0, t <= t_p), (0, True))
ltx(r"P(t) =", P_t)

\[ P(t) =\begin{cases} 4000 & \text{for}\: t \leq \dfrac{3}{10} \\0 & \text{otherwise} \end{cases} \]

Code
f_P = sp.lambdify(t, P_t, 'numpy')
t_vals = np.linspace(0, 1.0, 1000)
plt.plot(t_vals, f_P(t_vals), linewidth=2.5)
plt.xlabel(r"$t$ [s]"); plt.ylabel(r"$P(t)$ [N]")
plt.title("Push profile"); plt.grid(alpha=0.3)
plt.show()

Step 5 - Push phase: \(0 \le t \le t_p\)

During the push the acceleration is constant and given by \(a_x\) evaluated at \(P = P_0\). The box starts from rest, \(x(0) = 0\) and \(\dot x(0) = 0\), so a single integration gives the velocity and a second gives the position.

Code
a1 = a_x_sym.subs(vals).subs(P, P0)
x = sp.Function('x')
ode1 = sp.Eq(x(t).diff(t, 2), a1)
sol1 = sp.dsolve(ode1, x(t), ics={x(0): 0, x(t).diff(t).subs(t, 0): 0})
x1 = sp.simplify(sol1.rhs)
v1 = sp.simplify(x1.diff(t))

ltx(r"a_{x,1} &=", a1.evalf(4),
    r"\\ x_1(t) &=", x1.evalf(4),
    r"\\ v_1(t) &=", v1.evalf(4), aligned=True)

\[ \begin{aligned}a_{x,1} &=77.05\\ x_1(t) &=38.53 t^{2}\\ v_1(t) &=77.05 t\end{aligned} \]

The position grows quadratically and the velocity linearly, exactly as we expect for constant acceleration. At the moment the push ends, \(t = t_p\), the box has reached

Code
x_p = sp.simplify(x1.subs(t, t_p))
v_p = sp.simplify(v1.subs(t, t_p))
ltx(r"x_1(t_p) &=", x_p.evalf(4), r"\\ v_1(t_p) &=", v_p.evalf(4), aligned=True)

\[ \begin{aligned}x_1(t_p) &=3.467\\ v_1(t_p) &=23.12\end{aligned} \]

Step 6 - Glide phase: \(t > t_p\)

After the push is released only friction acts on the box, and the acceleration is the negative constant \(-\mu_k g\) (the only horizontal force is friction, since \(N = mg\) once \(P = 0\)). The initial conditions for this phase come from where the push phase ended: position \(x_1(t_p)\) and velocity \(v_1(t_p)\).

Code
a2 = a_x_sym.subs(vals).subs(P, 0)
ode2 = sp.Eq(x(t).diff(t, 2), a2)
sol2 = sp.dsolve(ode2, x(t), ics={x(t_p): x_p, x(t).diff(t).subs(t, t_p): v_p})
x2 = sp.simplify(sol2.rhs)
v2 = sp.simplify(x2.diff(t))

ltx(r"a_{x,2} &=", a2.evalf(4),
    r"\\ x_2(t) &=", x2.evalf(4),
    r"\\ v_2(t) &=", v2.evalf(4), aligned=True)

\[ \begin{aligned}a_{x,2} &=-2.946\\ x_2(t) &=- 1.473 t^{2} + 24.0 t - 3.6\\ v_2(t) &=24.0 - 2.946 t\end{aligned} \]

The box stops when \(v_2(t) = 0\). Solving this single linear equation for \(t\) gives the stop time, and substituting into \(x_2\) gives the total distance travelled.

Code
t_end = sp.solve(v2, t)[0]
x_end = sp.simplify(x2.subs(t, t_end))
ltx(r"t_{\text{stop}} =", t_end.evalf(4), r"\;\text{s},\quad x_{\text{stop}} =", x_end.evalf(4), r"\;\text{m}")

\[ t_{\text{stop}} =8.147\;\text{s},\quad x_{\text{stop}} =94.16\;\text{m} \]

The box travels for several seconds and covers tens of meters, almost all of it during the glide phase. The push phase contributes only a small fraction of the total distance, but it sets the velocity that the glide must dissipate.

Step 7 - Visualizing the motion

Plotting position and velocity over the full motion makes the two-phase structure visible at a glance. The kink in the velocity at \(t = t_p\) marks the transition from acceleration to deceleration, and the velocity curve hits zero exactly where the position curve flattens out.

Code
fig, axes = plt.subplots(2, 1, figsize=(5, 4.5), sharex=True)

fplot(x1, (t, 0, t_p),     ax=axes[0], color='C0', lw=2.5, label='push phase')
fplot(x2, (t, t_p, t_end), ax=axes[0], color='C3', lw=2.5, label='glide phase')
axes[0].set_ylabel(r"$x(t)$ [m]"); axes[0].grid(alpha=0.3); axes[0].legend()

fplot(v1, (t, 0, t_p),     ax=axes[1], color='C0', lw=2.5)
fplot(v2, (t, t_p, t_end), ax=axes[1], color='C3', lw=2.5)
axes[1].set_xlabel(r"$t$ [s]"); axes[1].set_ylabel(r"$v(t)$ [m/s]"); axes[1].grid(alpha=0.3)

plt.tight_layout(); plt.show()

A variant: how does the answer change if we model the push more carefully?

Treating the push as a perfect rectangle in time is a coarse model. A more realistic profile has the force ramp up, peak, and ramp back down over the same total duration \(t_p\). We can capture this with a triangular pulse,

\[ P(t) = \begin{cases} 2P_0\,t/t_p & 0 \le t < t_p/2\\ 2P_0\,(t_p - t)/t_p & t_p/2 \le t \le t_p\\ 0 & t > t_p \end{cases} \]

The peak value is the same \(P_0\) as before but the impulse delivered to the box, \(\int P\,dt\), is exactly half. We expect the box to leave the push phase at a lower velocity and to stop sooner.

Code
P_tri = sp.Piecewise(
    (2*P0*t/t_p, t < t_p/2),
    (2*P0*(t_p - t)/t_p, t <= t_p),
    (0, True),
)
ltx(r"P_{\triangle}(t) =", P_tri)

\[ P_{\triangle}(t) =\begin{cases} \dfrac{80000 t}{3} & \text{for}\: t < \dfrac{3}{20} \\8000 - \dfrac{80000 t}{3} & \text{for}\: t \leq \dfrac{3}{10} \\0 & \text{otherwise} \end{cases} \]

Code
f_P_tri = sp.lambdify(t, P_tri, 'numpy')
t_vals = np.linspace(0, 1.0, 1000)
plt.plot(t_vals, f_P(t_vals),     linewidth=2.5, label='rectangular')
plt.plot(t_vals, f_P_tri(t_vals), linewidth=2.5, label='triangular')
plt.xlabel(r"$t$ [s]"); plt.ylabel(r"$P(t)$ [N]")
plt.title("Push profiles compared"); plt.grid(alpha=0.3); plt.legend()
plt.show()

Code
# Phase A: ramp up, 0 ≤ t ≤ t_p/2
ode_A = sp.Eq(x(t).diff(t, 2), a_x_sym.subs(vals).subs(P, 2*P0*t/t_p))
sol_A = sp.dsolve(ode_A, x(t), ics={x(0): 0, x(t).diff(t).subs(t, 0): 0})
x_A = sp.simplify(sol_A.rhs)
v_A = sp.simplify(x_A.diff(t))
x_A_end, v_A_end = sp.simplify(x_A.subs(t, t_p/2)), sp.simplify(v_A.subs(t, t_p/2))

# Phase B: ramp down, t_p/2 ≤ t ≤ t_p
ode_B = sp.Eq(x(t).diff(t, 2), a_x_sym.subs(vals).subs(P, 2*P0*(t_p - t)/t_p))
sol_B = sp.dsolve(ode_B, x(t),
                  ics={x(t_p/2): x_A_end, x(t).diff(t).subs(t, t_p/2): v_A_end})
x_B = sp.simplify(sol_B.rhs)
v_B = sp.simplify(x_B.diff(t))
x_p_tri, v_p_tri = sp.simplify(x_B.subs(t, t_p)), sp.simplify(v_B.subs(t, t_p))

ltx(r"v_{\triangle}(t_p/2) &=", v_A_end.evalf(4),
    r"\\ x_{\triangle}(t_p) &=", x_p_tri.evalf(4),
    r"\\ v_{\triangle}(t_p) &=", v_p_tri.evalf(4), aligned=True)

\[ \begin{aligned}v_{\triangle}(t_p/2) &=5.558\\ x_{\triangle}(t_p) &=1.667\\ v_{\triangle}(t_p) &=11.12\end{aligned} \]

Code
# Phase C: glide, t > t_p
sol_C = sp.dsolve(sp.Eq(x(t).diff(t, 2), a2), x(t),
                  ics={x(t_p): x_p_tri, x(t).diff(t).subs(t, t_p): v_p_tri})
x_C_tri = sp.simplify(sol_C.rhs)
v_C_tri = sp.simplify(x_C_tri.diff(t))
t_end_tri = sp.solve(v_C_tri, t)[0]
x_end_tri = sp.simplify(x_C_tri.subs(t, t_end_tri))

ltx(r"t_{\text{stop},\triangle} \approx", round(float(t_end_tri), 3),
    r"\;\text{s},\quad x_{\text{stop},\triangle} \approx", round(float(x_end_tri), 3), r"\;\text{m}")

\[ t_{\text{stop},\triangle} \approx4.07\;\text{s},\quad x_{\text{stop},\triangle} \approx22.64\;\text{m} \]

Collecting the work from each phase, the full motion under the triangular push is described by three pieces. The acceleration follows the shape of the load: it rises linearly during phase A, falls linearly through zero during phase B, then jumps to the constant friction-only deceleration during the glide. Velocity and position are the running integrals, joined continuously across the phase boundaries by the matching conditions we used to set up the ODEs.

Code
from IPython.display import display

a_A_expr = a_x_sym.subs(vals).subs(P, 2*P0*t/t_p)
a_B_expr = a_x_sym.subs(vals).subs(P, 2*P0*(t_p - t)/t_p)

x_tri_pw = sp.Piecewise(
    (x_A,       t <= (t_p/2).evalf(4)),
    (x_B,       t <= t_p.evalf(4)),
    (x_C_tri,   t <= t_end_tri.evalf(4)),
    (x_end_tri, True),
)
v_tri_pw = sp.Piecewise(
    (v_A,       t <= (t_p/2).evalf(4)),
    (v_B,       t <= t_p.evalf(4)),
    (v_C_tri,   t <= t_end_tri.evalf(4)),
    (0,         True),
)
a_tri_pw = sp.Piecewise(
    (a_A_expr,  t <= (t_p/2).evalf(4)),
    (a_B_expr,  t <= t_p.evalf(4)),
    (a2,        t <= t_end_tri.evalf(4)),
    (0,         True),
)

display(ltx(r"\ddot x_\triangle(t) =", a_tri_pw.evalf(4)))
display(ltx(r"\dot x_\triangle(t)  =", v_tri_pw.evalf(4)))
display(ltx(r"x_\triangle(t)       =", x_tri_pw.evalf(4)))

\[ \ddot x_\triangle(t) =\begin{cases} 533.3 t - 2.946 & \text{for}\: t \leq 0.15 \\157.1 - 533.3 t & \text{for}\: t \leq 0.3 \\-2.946 & \text{for}\: t \leq 4.073 \\0 & \text{otherwise} \end{cases} \]

\[ \dot x_\triangle(t) =\begin{cases} 0.0006667 t \left(4.0 \cdot 10^{5} t - 4419.0\right) & \text{for}\: t \leq 0.15 \\- 266.7 t^{2} + 157.1 t - 12.0 & \text{for}\: t \leq 0.3 \\12.0 - 2.946 t & \text{for}\: t \leq 4.073 \\0 & \text{otherwise} \end{cases} \]

\[ x_\triangle(t) =\begin{cases} 0.0001111 t^{2} \left(8.0 \cdot 10^{5} t - 1.326 \cdot 10^{4}\right) & \text{for}\: t \leq 0.15 \\- 88.89 t^{3} + 78.53 t^{2} - 12.0 t + 0.6 & \text{for}\: t \leq 0.3 \\- 1.473 t^{2} + 12.0 t - 1.8 & \text{for}\: t \leq 4.073 \\22.64 & \text{otherwise} \end{cases} \]

Code
rect_push, rect_glide = 'red', 'blue'
tri_push,  tri_glide  = '#ff625f', '#6363ff'

fig, axes = plt.subplots(2, 1, figsize=(5, 5), sharex=True)

# Position
fplot(x1, (t, 0,     t_p),       ax=axes[0], color=rect_push,  lw=2.5, label='push (rect.)')
fplot(x2, (t, t_p,   t_end),     ax=axes[0], color=rect_glide, lw=2.5, label='glide (rect.)')
fplot(x_A, (t, 0,    t_p/2),     ax=axes[0], color=tri_push,   lw=2.5, label='push (tri.)')
fplot(x_B, (t, t_p/2, t_p),      ax=axes[0], color=tri_push,   lw=2.5)
fplot(x_C_tri, (t, t_p, t_end_tri), ax=axes[0], color=tri_glide, lw=2.5, label='glide (tri.)')
axes[0].set_ylabel(r"$x(t)$ [m]"); axes[0].grid(alpha=0.3); axes[0].legend(ncol=2, fontsize=9)

# Velocity
fplot(v1, (t, 0,     t_p),       ax=axes[1], color=rect_push,  lw=2.5)
fplot(v2, (t, t_p,   t_end),     ax=axes[1], color=rect_glide, lw=2.5)
fplot(v_A, (t, 0,    t_p/2),     ax=axes[1], color=tri_push,   lw=2.5)
fplot(v_B, (t, t_p/2, t_p),      ax=axes[1], color=tri_push,   lw=2.5)
fplot(v_C_tri, (t, t_p, t_end_tri), ax=axes[1], color=tri_glide, lw=2.5)
axes[1].set_xlabel(r"$t$ [s]"); axes[1].set_ylabel(r"$v(t)$ [m/s]"); axes[1].grid(alpha=0.3)

plt.tight_layout(); plt.show()

The triangular pulse delivers half the impulse of the rectangle, and the box ends up traveling roughly a quarter of the distance: the kinetic energy at the end of the push scales as the square of the exit velocity, which itself scales linearly with impulse. This sensitivity to the shape of the load profile is a recurring theme. When the loading is short and intense, the integrated quantity that matters is the impulse, and modelling decisions about exactly how the load rises and falls have a direct impact on the predicted motion.

Flick the box

The simulation below applies the model of this example in any direction. Drag an arrow at the box to push it, or start on the box and drag away from it to pull. The arrow sets the peak force \(P\) and its direction, and the checkboxes choose between the rectangular and the triangular profile above. With the force written as \((P_x, P_y)\) and \(y\) up, the vertical equation gives the normal force and the horizontal one the acceleration,

\[ \begin{aligned} N &= \max(0,\ mg - P_y) , \\ m\ddot x &= P_x - \mu_k N\operatorname{sign}(\dot x) , \end{aligned} \]

which for a push inclined \(\theta\) below the horizontal, \(P_y = -P\sin\theta\), is Step 3 again. A pull upward lightens the box and so lowers the friction; the \(\max\) keeps the floor from pulling the box down when the pull exceeds the weight. A box at rest stays put while \(|P_x| \leq \mu_k N\), where we use \(\mu_k\) for the static limit too, and once the force is gone friction brings the box to rest without reversing it, as the note in Step 4 requires.

At a wall the velocity is reversed and scaled by the coefficient of restitution \(e\), the ratio of the speed after the impact to the speed before it: \(e = 1\) is a perfectly elastic bounce and \(e = 0\) a dead stop. With \(e = 1\) and a horizontal push of \(P = 4000\) N for \(t_p = 0.3\) s, the box covers the 94 m of Step 6 back and forth between the walls, and 23 m with the triangular pulse.

Example 2: Contact forces in a train of boxes

Three boxes of masses \(m_1\), \(m_2\), \(m_3\) rest in a row on a smooth floor, touching one another, and are pushed from behind by a horizontal force \(P\) applied to box 1 (Figure 7.2.3). The floor is frictionless. We want the acceleration of the train and the two internal contact forces between neighbouring boxes.

Figure 7.2.3

Newton II applied to the three boxes as a single body gives the acceleration immediately, \(P = (m_1 + m_2 + m_3)\,a\), but it tells us nothing about the internal contact forces \(N_1\) between boxes 1 and 2 and \(N_2\) between boxes 2 and 3. Internal forces cancel in pairs at the level of the whole system, so to recover them we have to isolate each box on its own and apply Newton’s third law at each contact.

Step 1 - Free body diagrams

We split the system into three free bodies, one per box. At each contact the force exerted on the box ahead is equal in magnitude and opposite in sign to the force exerted on the box behind (Newton’s third law), so the same scalars \(N_1\) and \(N_2\) appear with opposite signs in adjacent equations.

Box 1

Box 2

Box 3

Box 1 is pushed forward by \(P\) and pushed backward by box 2 with magnitude \(N_1\). Box 2 is pushed forward by \(N_1\) and pushed backward by \(N_2\). Box 3 is pushed forward by \(N_2\) alone, since nothing else touches it from behind. Gravity and the normal reaction from the floor balance vertically on each box and have no horizontal component, so they drop out of the equations of motion.

Step 2 - Equations of motion

The horizontal component of \(\bm F = m\bm a\) for each box gives a system of three scalar equations,

\[ \begin{aligned} P - N_1 &= m_1\,a_1\\ N_1 - N_2 &= m_2\,a_2\\ N_2 &= m_3\,a_3. \end{aligned} \]

These three equations alone contain five unknowns (\(a_1\), \(a_2\), \(a_3\), \(N_1\), \(N_2\)), so the system is not yet solvable. The two missing relations come from kinematics, not kinetics.

Code
m1, m2, m3, P_sym, N1, N2, a1, a2, a3, a = sp.symbols(
    'm1 m2 m3 P N_1 N_2 a_1 a_2 a_3 a', real=True, positive=True)

eom1 = sp.Eq(P_sym - N1, m1*a1)
eom2 = sp.Eq(N1 - N2, m2*a2)
eom3 = sp.Eq(N2,        m3*a3)

ltx(r"P - N_1   &=", eom1.rhs,
    r"\\ N_1 - N_2 &=", eom2.rhs,
    r"\\ N_2       &=", eom3.rhs, aligned=True)

\[ \begin{aligned}P - N_1 &=a_{1} m_{1}\\ N_1 - N_2 &=a_{2} m_{2}\\ N_2 &=a_{3} m_{3}\end{aligned} \]

Step 3 - Kinematic coupling

Because the boxes remain in contact and the contact is rigid, the three boxes share a single acceleration: \(a_1 = a_2 = a_3 \equiv a\). Substituting this constraint reduces the three equations to a \(3\times 3\) linear system in the unknowns \((a, N_1, N_2)\), which we can solve symbolically.

Code
sol = sp.solve(
    [eom1.subs(a1, a), eom2.subs(a2, a), eom3.subs(a3, a)],
    (a, N1, N2), dict=True,
)[0]

a_sol  = sp.simplify(sol[a])
N1_sol = sp.simplify(sol[N1])
N2_sol = sp.simplify(sol[N2])

ltx(r"a   &=", a_sol,
    r"\\ N_1 &=", N1_sol,
    r"\\ N_2 &=", N2_sol, aligned=True)

\[ \begin{aligned}a &=\dfrac{P}{m_{1} + m_{2} + m_{3}}\\ N_1 &=\dfrac{P \left(m_{2} + m_{3}\right)}{m_{1} + m_{2} + m_{3}}\\ N_2 &=\dfrac{P m_{3}}{m_{1} + m_{2} + m_{3}}\end{aligned} \]

Reading the result line by line:

  • The acceleration is the one we’d get from treating the train as a single body of total mass \(m_\text{tot} = m_1 + m_2 + m_3\), namely \(a = P/m_\text{tot}\). The internal contact forces have no effect on the centre-of-mass motion, as expected.
  • \(N_1 = P\,(m_2 + m_3)/m_\text{tot}\) is the force needed to accelerate everything downstream of the first contact, i.e., boxes 2 and 3.
  • \(N_2 = P\,m_3/m_\text{tot}\) is the force needed to accelerate everything downstream of the second contact, i.e., box 3 alone.

In words: each internal contact carries an amount of force proportional to the mass it has to drag along. The contact closest to the push always carries the largest internal load. This is the same reason the rear coupling on a train of carriages pulls harder than the couplings further forward.

A numerical check

Take \(m_1 = 3\) kg, \(m_2 = 1\) kg, \(m_3 = 2\) kg and \(P = 120\) N. The total mass is \(m_\text{tot} = 6\) kg and the system accelerates at \(a = 20\) m/s². The first contact must accelerate \(m_2 + m_3 = 3\) kg at this rate, giving \(N_1 = 60\) N; the second contact must accelerate \(m_3 = 2\) kg, giving \(N_2 = 40\) N.

Code
vals2 = {m1: 3, m2: 1, m3: 2, P_sym: 120}
ltx(r"a   &=", a_sol.subs(vals2),  r"\;\text{m/s}^2",
    r"\\ N_1 &=", N1_sol.subs(vals2), r"\;\text{N}",
    r"\\ N_2 &=", N2_sol.subs(vals2), r"\;\text{N}", aligned=True)

\[ \begin{aligned}a &=20\;\text{m/s}^2\\ N_1 &=60\;\text{N}\\ N_2 &=40\;\text{N}\end{aligned} \]

Example 3: A log on a ramp, pulled by a pulley system

A log of mass \(m_1\) rests on a ramp inclined at angle \(\theta\) with kinetic friction coefficient \(\mu_k\). A rope wraps around a pulley attached to the log and runs over a fixed pulley to a counterweight of mass \(m_2\) (Figure 7.2.4). The counterweight is released from rest and falls a distance \(h\) to the ground. We want its velocity at impact.

Figure 7.2.4

The pulley arrangement is what makes this problem more than a free fall with a brake. Two rope segments connect to the log while only one connects to the counterweight, giving a 2:1 mechanical advantage: the log feels twice the rope tension but moves only half as far as the counterweight.

Step 1 - The kinematic constraint

Let \(s_C\) measure the log’s position up the ramp and \(s_A\) the counterweight’s position downward from its starting point, both positive in the direction the system actually moves. The rope is inextensible, so its total length is constant. From Figure 7.2.5 this length is

\[ L = 2\,s_C + s_A. \]

Differentiating twice in time gives the acceleration constraint

\[ a_A = 2\,a_C, \]

which says that for every metre the log climbs, the counterweight falls two metres.

Figure 7.2.5

Step 2 - Free body diagrams

We isolate the log and the counterweight (Figure 7.2.6). On the log the rope tension contributes \(2T\) up the ramp, since the log’s pulley is held by two rope segments each carrying tension \(T\). On the counterweight only one rope segment acts, contributing \(T\) upward. This is the kinetic mirror of the kinematic 2:1: the rope trades tension for displacement.

Figure 7.2.6

Step 3 - Equations of motion

Newton’s second law for the log along the ramp (positive up) and perpendicular to it gives

\[ \begin{aligned} 2T - m_1 g \sin\theta - \mu_k N &= m_1\,a_C\\ N - m_1 g \cos\theta &= 0. \end{aligned} \]

For the counterweight, with positive \(s_A\) pointing down, only weight and tension act:

\[ m_2 g - T = m_2\,a_A. \]

Together with the kinematic constraint \(a_A = 2 a_C\), this is four equations in the four unknowns \((T, N, a_C, a_A)\).

Code
m1, m2, theta_s, mu_k_s, g_s, T, N_s, aC, aA = sp.symbols(
    'm_1 m_2 theta mu_k g T N a_C a_A', real=True, positive=True)

eom_log_x   = sp.Eq(2*T - m1*g_s*sp.sin(theta_s) - mu_k_s*N_s, m1*aC)
eom_log_y   = sp.Eq(N_s - m1*g_s*sp.cos(theta_s), 0)
eom_counter = sp.Eq(m2*g_s - T, m2*aA)
constraint  = sp.Eq(aA, 2*aC)

eqs = [eom_log_x, eom_log_y, eom_counter, constraint]
eqs | la

\[ {\def\arraystretch{1.0}\begin{bmatrix} - N \mu_{k} + 2 T - g m_{1} \sin{\left(\theta \right)} = a_{C} m_{1} \\ N - g m_{1} \cos{\left(\theta \right)} = 0 \\ - T + g m_{2} = a_{A} m_{2} \\ a_{A} = 2 a_{C} \end{bmatrix}} \]

Code

sol3 = sp.solve(eqs,
                (T, N_s, aC, aA), dict=True)[0]

T_sol  = sp.simplify(sol3[T])
N_sol3 = sp.simplify(sol3[N_s])
aC_sol = sp.simplify(sol3[aC])
aA_sol = sp.simplify(sol3[aA])

ltx(r"N   &=", N_sol3,
    r"\\ T   &=", T_sol,
    r"\\ a_C &=", aC_sol,
    r"\\ a_A &=", aA_sol, aligned=True)

\[ \begin{aligned}N &=g m_{1} \cos{\left(\theta \right)}\\ T &=\dfrac{g m_{1} m_{2} \left(2 \mu_{k} \cos{\left(\theta \right)} + 2 \sin{\left(\theta \right)} + 1\right)}{m_{1} + 4 m_{2}}\\ a_C &=\dfrac{g \left(- m_{1} \mu_{k} \cos{\left(\theta \right)} - m_{1} \sin{\left(\theta \right)} + 2 m_{2}\right)}{m_{1} + 4 m_{2}}\\ a_A &=\dfrac{2 g \left(- m_{1} \mu_{k} \cos{\left(\theta \right)} - m_{1} \sin{\left(\theta \right)} + 2 m_{2}\right)}{m_{1} + 4 m_{2}}\end{aligned} \]

The numerator of \(a_C\) is the net pull on the system: the counterweight contributes \(2 m_2 g\) (twice its weight, because the pulley doubles its displacement) while the log’s weight and friction resist with \(m_1 g \sin\theta + \mu_k m_1 g \cos\theta\). If the numerator goes negative, kinetic friction does not apply at all: static friction holds the log in place and the counterweight cannot move. We assume the geometry guarantees motion.

The denominator \(m_1 + 4 m_2\) is the system’s effective inertia viewed from the log. Any kinetic energy stored in the moving system can be written as \(\tfrac{1}{2}(m_1 + 4 m_2) v_C^2\) once the constraint \(v_A = 2 v_C\) is used: the counterweight enters as \(4 m_2\) because it moves twice as fast, and kinetic energy goes as the square of velocity.

Step 4 - Numerical values

Take \(m_1 = 200\) kg, \(m_2 = 125\) kg, \(\theta = 30^\circ\), \(\mu_k = 0.5\), \(g = 9.81\) m/s².

Code
vals3 = {m1: 200, m2: 125, theta_s: sp.pi/6,
         mu_k_s: sp.Rational(1, 2), g_s: sp.Rational(981, 100)}

ltx(r"N   &=", N_sol3.subs(vals3).evalf(4), r"\;\text{N}",
    r"\\ T   &=", T_sol.subs(vals3).evalf(4),  r"\;\text{N}",
    r"\\ a_C &=", aC_sol.subs(vals3).evalf(4), r"\;\text{m/s}^2",
    r"\\ a_A &=", aA_sol.subs(vals3).evalf(4), r"\;\text{m/s}^2",
    aligned=True)

\[ \begin{aligned}N &=1699.0\;\text{N}\\ T &=1004.0\;\text{N}\\ a_C &=0.8885\;\text{m/s}^2\\ a_A &=1.777\;\text{m/s}^2\end{aligned} \]

Step 5 - Velocity at impact

The acceleration of the counterweight is constant, so its equation of motion is the ODE

\[ \ddot s_A = a_A , \qquad s_A(0) = 0 , \quad \dot s_A(0) = 0 , \]

with the initial conditions of a release from rest. Two integrations against the initial conditions give the position and the velocity as functions of time; we hand the ODE to sympy’s dsolve. Once \(s_A(t)\) is in hand we set \(s_A(t_{\text{impact}}) = h\), solve for the impact time, and read off \(v_A\) at that instant.

Code
h = 6                                          # the drop to the ground [m]
s_A_func = sp.Function('s_A')
ode_sA   = sp.Eq(s_A_func(t).diff(t, 2), aA_sol)
sol_sA   = sp.dsolve(ode_sA, s_A_func(t),
                     ics={s_A_func(0): 0, s_A_func(t).diff(t).subs(t, 0): 0})
sA_t = sp.simplify(sol_sA.rhs)
vA_t = sp.simplify(sA_t.diff(t))

ltx(r"s_A(t) &=", sA_t, r"\\ v_A(t) &=", vA_t, aligned=True)

\[ \begin{aligned}s_A(t) &=\dfrac{g t^{2} \left(- m_{1} \mu_{k} \cos{\left(\theta \right)} - m_{1} \sin{\left(\theta \right)} + 2 m_{2}\right)}{m_{1} + 4 m_{2}}\\ v_A(t) &=\dfrac{2 g t \left(- m_{1} \mu_{k} \cos{\left(\theta \right)} - m_{1} \sin{\left(\theta \right)} + 2 m_{2}\right)}{m_{1} + 4 m_{2}}\end{aligned} \]

Setting \(s_A(t) = h\) gives a quadratic in \(t\),

\[ \tfrac{1}{2} a_A\,t^2 = h \quad\Longrightarrow\quad t = \pm\sqrt{\frac{2 h}{a_A}}. \]

Both roots are real but only the positive one is physical: the negative root corresponds to the time before release at which a body decelerating to rest would have been at the ground, which is meaningless here. We pick the positive root and substitute it into \(v_A(t)\) to get the impact velocity.

Code
sA_num   = sA_t.subs(vals3)
roots    = sp.solve(sp.Eq(sA_num, h), t)
display(ltx(r"\text{roots of } s_A(t) - h = 0:\quad t \in", sp.FiniteSet(*roots)))

t_impact = next(r for r in roots if r.is_real and r > 0)
v_impact = vA_t.subs(vals3).subs(t, t_impact)

display(ltx(r"t_{\text{impact}} &=", t_impact, r"\approx", t_impact.evalf(4), r"\;\text{s}",
            r"\\ v_A(t_{\text{impact}}) &=", v_impact, r"\approx", v_impact.evalf(4), r"\;\text{m/s}",
            aligned=True))

\[ \text{roots of } s_A(t) - h = 0:\quad t \in\left\{- \dfrac{20 \sqrt{2289}}{327 \sqrt{3 - \sqrt{3}}}, \dfrac{20 \sqrt{2289}}{327 \sqrt{3 - \sqrt{3}}}\right\} \]

\[ \begin{aligned}t_{\text{impact}} &=\dfrac{20 \sqrt{2289}}{327 \sqrt{3 - \sqrt{3}}}\approx2.599\;\text{s}\\ v_A(t_{\text{impact}}) &=\dfrac{3 \sqrt{2289} \left(150 - 50 \sqrt{3}\right)}{1750 \sqrt{3 - \sqrt{3}}}\approx4.618\;\text{m/s}\end{aligned} \]

Plotting position and velocity over the fall makes the impact instant easy to read off: the position curve hits the ground line \(s_A = h\) at \(t_{\text{impact}}\), and the velocity curve crosses that vertical at the impact velocity.

Code
T_plot = float(t_impact) * 1.05

fig, axes = plt.subplots(2, 1, figsize=(5, 4.5), sharex=True)

# Position
fplot(sA_t.subs(vals3), (t, 0, T_plot), ax=axes[0], color='C0', lw=2.5)
axes[0].axhline(h, color='gray', linestyle='--', alpha=0.6, label=fr'ground at $h={h}$ m')
axes[0].plot([float(t_impact)], [h], 'o', color='C3', markersize=9, label='impact')
axes[0].set_ylabel(r"$s_A$ [m]"); axes[0].grid(alpha=0.3); axes[0].legend(loc='lower right')

# Velocity
fplot(vA_t.subs(vals3), (t, 0, T_plot), ax=axes[1], color='C0', lw=2.5)
axes[1].plot([float(t_impact)], [float(v_impact)], 'o', color='C3', markersize=9,
             label=fr'$v_A={float(v_impact):.3f}$ m/s')
axes[1].set_xlabel(r"$t$ [s]"); axes[1].set_ylabel(r"$v_A$ [m/s]")
axes[1].grid(alpha=0.3); axes[1].legend(loc='lower right')

plt.tight_layout(); plt.show()

Alternative: integrating over distance

The question we are asking, how fast is the counterweight moving when it has fallen \(h\)?, depends on position rather than time, so we can also skip the time history and integrate over distance. We start with the differential relation

\[ a_A\,ds_A \;=\; v_A\,dv_A, \]

which is established in 6.3.3. Integrating both sides, from rest at \(s_A = 0\) to the impact velocity at \(s_A = h\),

\[ \int_0^{h} a_A\,ds_A \;=\; \int_0^{v_A} v\,dv, \]

reduces the problem to two simple antiderivatives. Since \(a_A\) is constant, the left side is \(a_A h\); the right side is \(v_A^2/2\). Solving for \(v_A\) gives the impact velocity directly, without ever computing \(s_A(t)\) or \(v_A(t)\) as functions of time.

Code
h = 6
v_A_var = sp.symbols('v_A', positive=True)
s_A_var = sp.symbols('s_A', positive=True)
xi      = sp.symbols('xi',  positive=True)   # dummy integration variable

LHS = sp.integrate(aA_sol, (s_A_var, 0, h))            # a_A constant, so = a_A * h
RHS = sp.integrate(xi,     (xi,      0, v_A_var))      # = v_A^2 / 2

display(ltx(r"\int_0^{h} a_A\,ds_A &=", LHS,
            r"\\ \int_0^{v_A} v\,dv &=", RHS, aligned=True))

v_A_impact = sp.solve(sp.Eq(LHS, RHS), v_A_var)[0]
display(ltx(r"v_A &=", v_A_impact,
            r"\\ &\approx", v_A_impact.subs(vals3).evalf(4), r"\;\text{m/s}",
            aligned=True))

\[ \begin{aligned}\int_0^{h} a_A\,ds_A &=\dfrac{12 g \left(- m_{1} \mu_{k} \cos{\left(\theta \right)} - m_{1} \sin{\left(\theta \right)} + 2 m_{2}\right)}{m_{1} + 4 m_{2}}\\ \int_0^{v_A} v\,dv &=\dfrac{v_{A}^{2}}{2}\end{aligned} \]

\[ \begin{aligned}v_A &=\dfrac{2 \sqrt{6} \sqrt{g} \sqrt{- m_{1} \mu_{k} \cos{\left(\theta \right)} - m_{1} \sin{\left(\theta \right)} + 2 m_{2}}}{\sqrt{m_{1} + 4 m_{2}}}\\ &\approx4.618\;\text{m/s}\end{aligned} \]

Changing the ramp and the masses

The simulation below solves the same four equations for any ramp angle and masses. When the counterweight is too light for a steep ramp, the log slides down instead and the counterweight rises, so friction changes sign. With \(d = +1\) for a log moving up the ramp and \(d = -1\) for one sliding down, the acceleration becomes

\[ a_C = \frac{g\left(2m_2 - m_1\sin\theta - d\,\mu_k m_1\cos\theta\right)}{m_1 + 4m_2} , \qquad a_A = 2a_C , \qquad T = m_2\left(g - a_A\right) . \]

Between the two cases lies a band of parameters where neither direction overcomes friction,

\[ \left|2m_2 - m_1\sin\theta\right| \leq \mu_k m_1\cos\theta , \]

and the system stays at rest, the case Step 3 set aside. The simulation uses \(\mu_k\) for the static limit as well. With the values of the example it reproduces the impact after 2.599 s at 4.618 m/s.

Example 4: A projectile over a fence

A catapult throws a stone of mass \(m = 4\) kg from a point 2 m above level ground, at the speed \(v_0 = 24\) m/s and the angle \(\theta = 35^\circ\) above the horizontal (Figure 7.2.7). Thirty metres away the ground rises along a ramp to a plateau 6 m high, and a fence 2.4 m tall stands at the edge of the plateau. We want the path of the stone, the time it spends in the air and the point where it lands. We then ask which launch angle throws the stone furthest, and finally what air drag and wind do to the answer.

Figure 7.2.7: The stone leaves the launcher at the height 2 m with the speed \(v_0\) at the angle \(\theta\). The fence stands at the edge of the plateau, 40 m from the launch point.

Step 1 - Free body diagram and equations of motion

In flight the only force on the stone is its weight, so long as we neglect the air. With \(x\) horizontal and \(y\) up, Newton’s second law reads

\[ m\begin{bmatrix}\ddot x\\ \ddot y\end{bmatrix} = \begin{bmatrix}0\\ -mg\end{bmatrix} , \]

two uncoupled equations: the horizontal velocity never changes and the vertical acceleration is \(-g\). The stone starts at the launch point with the velocity \(v_0\) along the launch direction,

\[ \begin{aligned} x(0) &= 0, & y(0) &= 2~\text{m}, \\ \dot x(0) &= v_0\cos\theta, & \dot y(0) &= v_0\sin\theta . \end{aligned} \]

Two integrations in time give the path

\[ \begin{aligned} x(t) &= v_0 t\cos\theta , \\ y(t) &= 2 + v_0 t\sin\theta - \tfrac{1}{2}g t^2 . \end{aligned} \tag{7.2.1}\]

We let dsolve repeat the integration with the initial conditions attached.

Code
m, g, v0, th = sp.symbols('m g v_0 theta', positive=True)
xf, yf = sp.Function('x'), sp.Function('y')

eqs = [sp.Eq(m*xf(t).diff(t, 2), 0),
       sp.Eq(m*yf(t).diff(t, 2), -m*g)]
ics = {xf(0): 0, yf(0): 2,
       xf(t).diff(t).subs(t, 0): v0*sp.cos(th),
       yf(t).diff(t).subs(t, 0): v0*sp.sin(th)}
sol = sp.dsolve(eqs, [xf(t), yf(t)], ics=ics)
x_t, y_t = sol[0].rhs, sol[1].rhs

ltx(r"x(t) &=", x_t, r"\\ y(t) &=", y_t, aligned=True)

\[ \begin{aligned}x(t) &=t v_{0} \cos{\left(\theta \right)}\\ y(t) &=- \dfrac{g t^{2}}{2} + t v_{0} \sin{\left(\theta \right)} + 2\end{aligned} \]

Step 2 - Time of flight and landing point

The stone lands on the plateau where \(y(t) = 6\) m. With 7.2.1 this is the quadratic

\[ \tfrac{1}{2}g t^2 - v_0 t\sin\theta + 4 = 0 , \]

whose two roots are the times at which the stone passes the height 6 m on the way up and on the way down,

\[ t = \frac{v_0\sin\theta \pm \sqrt{v_0^2\sin^2\theta - 8g}}{g} . \]

The landing is the larger root, \(t_L\), and the landing point is \(x_L = x(t_L)\). The answer only counts if the stone has cleared the fence, so we also need the height at \(x = 40\) m, reached at \(t_f = 40/(v_0\cos\theta)\), which must exceed \(6 + 2.4 = 8.4\) m. With \(g = 9.81\) m/s² we get

Code
vals = {g: sp.Rational(981, 100), v0: 24, th: 35*sp.pi/180}

t_up, t_L = sp.solve(sp.Eq(y_t, 6), t)          # passing 6 m on the way up, then down
x_L = x_t.subs(t, t_L)
t_f = 40/(v0*sp.cos(th))
y_fence = y_t.subs(t, t_f)

ltx(r"t_L &=", t_L.subs(vals).evalf(4), r"~\text{s}",
    r"\\ x_L &=", x_L.subs(vals).evalf(4), r"~\text{m}",
    r"\\ y(t_f) &=", y_fence.subs(vals).evalf(4), r"~\text{m}", aligned=True)

\[ \begin{aligned}t_L &=2.477~\text{s}\\ x_L &=48.7~\text{m}\\ y(t_f) &=9.703~\text{m}\end{aligned} \]

The stone passes the fence line at 9.7 m, well above the top of the fence at 8.4 m, and lands on the plateau 48.7 m from the launcher after 2.48 s in the air. The plot of the path against the terrain shows the same.

Code
def terrain(ax):
    ax.fill_between([-2, 30, 40, 70], [0, 0, 6, 6], -2, color='#9c8876', alpha=0.5, lw=0)
    ax.plot([-2, 30, 40, 70], [0, 0, 6, 6], 'k', lw=1.2)
    ax.plot([40, 40], [6, 8.4], 'k', lw=2.5)

fig, ax = plt.subplots(figsize=(7, 2.8))
terrain(ax)
fplot(x_t.subs(vals), y_t.subs(vals), (t, 0, t_L.subs(vals)), ax=ax, color='C0', lw=2,
      label=r'$\theta = 35^\circ$')
ax.plot(float(x_L.subs(vals)), 6, 'o', color='C3', label='landing')
ax.set_aspect('equal'); ax.set_xlim(-2, 60); ax.set_ylim(-2, 16)
ax.set_xlabel('$x$ [m]'); ax.set_ylabel('$y$ [m]'); ax.legend(loc='upper right')
end_ticks(fig)
plt.show()

Step 3 - The launch angle for the longest throw

The landing distance depends on the launch angle through both \(\cos\theta\) and \(t_L\),

\[ x_L(\theta) = v_0\cos\theta\,\frac{v_0\sin\theta + \sqrt{v_0^2\sin^2\theta - 8g}}{g} , \]

and it is longest where its derivative vanishes,

\[ \frac{dx_L}{d\theta} = 0 . \]

The angle at which a throw from and onto level ground goes furthest is \(45^\circ\). Here the stone must climb 4 m, so we expect a slightly steeper throw. The derivative is too long to solve by hand, but nsolve finds the root from a starting guess of \(45^\circ\).

The expression for \(x_L\) only describes a throw that clears the fence. Below about \(22^\circ\) the square root turns imaginary and the stone never reaches the height 6 m at all, and over a wider range of angles it reaches 6 m but hits the fence on the way. The valid throws are those with \(y(t_f) \geq 8.4\) m, bounded by the two roots of \(y(t_f) = 8.4\) m, which we also find with nsolve.

Code
x_L_th = x_L.subs({g: vals[g], v0: vals[v0]})
th_opt = sp.nsolve(x_L_th.diff(th), th, sp.N(sp.pi/4))
vals_opt = {**vals, th: th_opt}

y_fence_th = y_fence.subs({g: vals[g], v0: vals[v0]})
th_lo = sp.nsolve(y_fence_th - sp.Rational(84, 10), th, sp.N(sp.pi/6))
th_hi = sp.nsolve(y_fence_th - sp.Rational(84, 10), th, sp.N(sp.pi/3))

ltx(r"\theta_{\text{opt}} &=", sp.deg(th_opt).evalf(4), r"^\circ",
    r"\\ x_L(\theta_{\text{opt}}) &=", x_L.subs(vals_opt).evalf(4), r"~\text{m}",
    r"\\ y(t_f) &=", y_fence.subs(vals_opt).evalf(4), r"~\text{m}",
    r"\\ \theta &\in [", sp.deg(th_lo).evalf(3), r"^\circ,\ ", sp.deg(th_hi).evalf(3),
    r"^\circ] \text{ clears the fence}", aligned=True)

\[ \begin{aligned}\theta_{\text{opt}} &=47.1^\circ\\ x_L(\theta_{\text{opt}}) &=54.57~\text{m}\\ y(t_f) &=15.64~\text{m}\\ \theta &\in [32.6^\circ,\ 66.5^\circ] \text{ clears the fence}\end{aligned} \]

Launched at \(47.1^\circ\), the stone lands 54.6 m out and passes the fence line at 15.6 m. A plot of \(x_L(\theta)\) over the angles that clear the fence confirms that this is the maximum and shows how flat the curve is near the top: three degrees either side of the optimum shorten the throw by less than half a metre.

Code
fig, ax = plt.subplots(figsize=(5, 3))
deg = sp.symbols('deg', positive=True)
d_lo, d_hi = float(sp.deg(th_lo)), float(sp.deg(th_hi))
fplot(x_L_th.subs(th, deg*sp.pi/180), (deg, d_lo, d_hi), ax=ax, color='C0', lw=2)
ax.plot(float(sp.deg(th_opt)), float(x_L.subs(vals_opt)), 'o', color='C3')
ax.set_xlabel(r'$\theta$ [deg]'); ax.set_ylabel('$x_L$ [m]'); ax.grid(alpha=0.3)
ax.set_xlim(d_lo, d_hi)
end_ticks(fig)
plt.show()

Step 4 - Air drag and wind

A stone moving through still air feels a drag force against its velocity. At the speeds of a thrown stone the drag grows with the square of the speed, and when the air itself moves with the wind velocity \(\bm w\), what counts is the velocity of the stone relative to the air, \(\bm u = \bm v - \bm w\). The drag force is

\[ \bm F_D = -c\,\|\bm u\|\,\bm u , \]

with magnitude \(c\|\bm u\|^2\) and direction opposite to \(\bm u\). The constant \(c = \tfrac{1}{2}\rho C_D A\) lumps together the density of air, the drag coefficient and the frontal area of the stone. Newton’s second law becomes

\[ m\begin{bmatrix}\ddot x\\ \ddot y\end{bmatrix} = \begin{bmatrix}0\\ -mg\end{bmatrix} - c\,\|\bm u\|\begin{bmatrix}\dot x - w_x\\ \dot y - w_y\end{bmatrix}, \qquad \|\bm u\| = \sqrt{(\dot x - w_x)^2 + (\dot y - w_y)^2} . \tag{7.2.2}\]

The norm couples the two components, so the horizontal motion now depends on the vertical, and the equations are nonlinear. There is no closed-form solution, and we integrate numerically. Writing the state as position and velocity, \(\bm z = [x,\ y,\ v_x,\ v_y]^\mathsf{T}\), turns 7.2.2 into four first-order equations, and the forward Euler method of Particle kinematics advances them over a time step \(\Delta t\):

\[ \begin{aligned} \bm u_i &= \bm v_i - \bm w , \\ \bm v_{i+1} &= \bm v_i + \Delta t\left(-g\,\bm e_y - \frac{c}{m}\|\bm u_i\|\,\bm u_i\right) , \\ \bm r_{i+1} &= \bm r_i + \Delta t\,\bm v_i . \end{aligned} \]

We stop when the stone hits the ground or the fence.

def fly(theta_deg, c, w=(0.0, 0.0), v_0=24.0, m=4.0, g=9.81, dt=1e-3):
    """Forward Euler for the drag equation; returns the path and how the flight ended."""
    a = np.radians(theta_deg)
    r = np.array([0.0, 2.0])
    v = v_0*np.array([np.cos(a), np.sin(a)])
    w = np.asarray(w, float)
    path = [r.copy()]
    while True:
        u = v - w                                   # drag acts on the velocity through the air
        acc = np.array([0.0, -g]) - c/m*np.linalg.norm(u)*u
        r_new = r + dt*v
        v = v + dt*acc
        if r[0] < 40 <= r_new[0]:                   # crossing the fence line this step
            y40 = r[1] + (40 - r[0])/(r_new[0] - r[0])*(r_new[1] - r[1])
            if y40 <= 8.4:
                path.append(np.array([40.0, y40]))
                return np.array(path), 'fence'
        r = r_new
        path.append(r.copy())
        ground = np.interp(r[0], [-10, 30, 40, 100], [0, 0, 6, 6])
        if r[1] <= ground and len(path) > 10:
            return np.array(path), 'landed'

As a check, with \(c = 0\) the numerical solution must reproduce the landing point of the vacuum solution, 48.7 m at \(35^\circ\). We then turn the drag on with \(c = 0.03\) kg/m, a value of the right size for a stone a little smaller than a fist, and sweep the launch angle to find the best throw.

Code
x_vac = fly(35, 0.0)[0][-1, 0]
sweep = [(a, *fly(a, 0.03)) for a in np.arange(20, 70.5, 0.5)]
best = max(sweep, key=lambda s: s[1][-1, 0])

cleared = [a for a, path, how in sweep if how == 'landed' and path[-1, 0] > 40]
ltx(r"c = 0:\quad x_L &\approx", round(x_vac, 2), r"~\text{m}",
    r"\\ c = 0.03:\quad \text{angles that clear the fence} &=", len(cleared), aligned=True)

\[ \begin{aligned}c = 0:\quad x_L &\approx48.74~\text{m}\\ c = 0.03:\quad \text{angles that clear the fence} &=0\end{aligned} \]

The vacuum check agrees with the closed form to the step size. With drag, though, none of the launch angles from \(20^\circ\) to \(70^\circ\) gets the stone over the fence. Drag takes speed out of the stone all the way along its path, and it removes more of it at the start of the flight, when the stone is fastest, than near the end. The path is therefore no longer a parabola. It falls more steeply than it rises, as the paths below show for a tailwind of \(w_x = 5\) m/s, a headwind of \(w_x = -5\) m/s and still air, each at the best angle we found without wind.

Code
fig, ax = plt.subplots(figsize=(7, 2.8))
terrain(ax)
th_v = float(sp.deg(th_opt))
ax.plot(*fly(th_v, 0.0)[0].T, color='0.5', ls='--', lw=1.2, label='no drag')
for w_x, col in ((5, 'C2'), (0, 'C0'), (-5, 'C3')):
    path, how = fly(th_v, 0.03, (w_x, 0))
    ax.plot(*path.T, color=col, lw=2, label=f'$w_x = {w_x}$ m/s, {how}')
ax.set_aspect('equal'); ax.set_xlim(-2, 60); ax.set_ylim(-2, 20)
ax.set_xlabel('$x$ [m]'); ax.set_ylabel('$y$ [m]'); ax.legend(loc='upper left', fontsize=8)
end_ticks(fig)
plt.show()

A tailwind of 5 m/s carries the stone over the fence; still air and a headwind do not. The drag model is a coarse one, and the constant \(c\) changes the result a great deal, so the conclusion we can trust is qualitative: a design that relies on the vacuum solution with only 1.3 m to spare over the fence will fail in real air. Either the launch speed goes up, or the catapult waits for a favourable wind.

The simulation below integrates 7.2.2 in the browser with the same forward Euler step. The dashed line is the vacuum path for the current angle and speed, so the effect of the drag and the wind is the distance between the dashed line and the trace.

Example 5: A box stopped by a damper

A box of mass \(m\) slides without friction at the speed \(v_0\) when it meets a viscous damper fixed to a wall (Figure 7.2.8). The damper resists with a force proportional to the speed at which it is pushed in, \(c\dot x\), where \(c\) is the damping coefficient. We want the position and the speed of the box as functions of time, and the distance it needs to stop.

Figure 7.2.8: The box meets the damper at the speed \(v_0\). We measure \(x\) from the point of contact.

Step 1 - Equation of motion

We put the origin at the point of contact and start the clock there. Weight and the normal force from the floor balance, and the only horizontal force is the damper force, which opposes the motion. Newton’s second law along \(x\) and the initial conditions form the initial value problem

\[ \left\{ \begin{aligned} m\ddot x &= -c\dot x , \\ x(0) &= 0 , \\ \dot x(0) &= v_0 . \end{aligned} \right. \]

The force now depends on the velocity, and this is the first example in which the acceleration is not known before the motion is. The equation is linear with constant coefficients, so dsolve returns a closed form.

Code
m, c, v0 = sp.symbols('m c v_0', positive=True)
x = sp.Function('x')
ode = sp.Eq(m*x(t).diff(t, 2), -c*x(t).diff(t))
x_t = sp.dsolve(ode, x(t), ics={x(0): 0, x(t).diff(t).subs(t, 0): v0}).rhs
v_t = x_t.diff(t)

ltx(r"x(t) &=", sp.simplify(x_t), r"\\ \dot x(t) &=", v_t, aligned=True)

\[ \begin{aligned}x(t) &=\dfrac{m v_{0}}{c} - \dfrac{m v_{0} e^{- \dfrac{c t}{m}}}{c}\\ \dot x(t) &=v_{0} e^{- \dfrac{c t}{m}}\end{aligned} \]

The speed decays exponentially with the time constant \(\tau = m/c\),

\[ \dot x(t) = v_0\,e^{-t/\tau} , \qquad x(t) = v_0\tau\left(1 - e^{-t/\tau}\right) . \]

The exponential never reaches zero, so in this model the box never quite stops. It does, however, approach a finite position: as \(t\to\infty\) the box comes to rest at

\[ x_\infty = v_0\tau = \frac{m v_0}{c} . \]

After three time constants the speed is down to \(e^{-3} \approx 5\%\) of \(v_0\), and in practice the motion is over.

Step 2 - Numbers and time history

Take a box of \(m = 50\) kg arriving at \(v_0 = 2\) m/s against a damper with \(c = 200\) N·s/m. The time constant is \(\tau = 0.25\) s and the box comes to rest \(x_\infty = 0.5\) m into the damper. The largest damper force acts at the instant of contact, \(c v_0 = 400\) N.

Code
vals = {m: 50, c: 200, v0: 2}
fig, axes = plt.subplots(2, 1, figsize=(5, 4), sharex=True)
fplot(x_t.subs(vals), (t, 0, 1.25), ax=axes[0], color='C0', lw=2)
axes[0].axhline(0.5, color='0.5', ls='--', lw=1)
axes[0].set_ylabel('$x$ [m]'); axes[0].grid(alpha=0.3)
fplot(v_t.subs(vals), (t, 0, 1.25), ax=axes[1], color='C3', lw=2)
axes[1].set_xlabel('$t$ [s]'); axes[1].set_ylabel(r'$\dot x$ [m/s]'); axes[1].grid(alpha=0.3)
for a in axes: a.set_xlim(0, 1.25)
axes[0].set_ylim(0, 0.55); axes[1].set_ylim(0, 2)
end_ticks(fig)
plt.tight_layout(); plt.show()

Step 3 - Speed as a function of position

For the design of the damper the more useful question is how fast the box still moves at a given depth \(x\). The solution of the ODE gives position and speed as functions of the same time, so we eliminate \(t\) between them. Solving \(x(t)\) for the time,

\[ e^{-t/\tau} = 1 - \frac{x}{v_0\tau} \quad\Longrightarrow\quad t(x) = -\tau\ln\left(1 - \frac{c\,x}{m v_0}\right) , \]

and substituting into \(\dot x(t) = v_0 e^{-t/\tau}\) gives the speed as a function of the depth,

\[ v(x) = \dot x\bigl(t(x)\bigr) = v_0 - \frac{c}{m}x . \]

Code
xs = sp.symbols('x', positive=True)
t_of_x = sp.solve(sp.Eq(x_t, xs), t)[0]
v_of_x = sp.simplify(v_t.subs(t, t_of_x))
ltx(r"t(x) &=", t_of_x, r"\\ v(x) &=", sp.expand(v_of_x), aligned=True)

\[ \begin{aligned}t(x) &=\dfrac{m \log{\left(- \dfrac{m v_{0}}{c x - m v_{0}} \right)}}{c}\\ v(x) &=- \dfrac{c x}{m} + v_{0}\end{aligned} \]

The speed falls linearly with the depth and reaches zero at \(x = m v_0/c\), the rest position found above. Each metre of stroke removes the same amount of speed, \(c/m\), whatever the speed. The same line follows directly from the equation of motion with the chain rule of 6.3.3, \(m\dot x\,d\dot x/dx = -c\dot x\), which gives \(d\dot x/dx = -c/m\) at once. The parametric plot of \(\dot x(t)\) against \(x(t)\), the phase plane, shows the straight line.

Code
fig, ax = plt.subplots(figsize=(4.5, 3))
fplot(x_t.subs(vals), v_t.subs(vals), (t, 0, 3), ax=ax, color='C0', lw=2, label=r'$(x(t),\ \dot x(t))$')
xs = np.linspace(0, 0.5, 6)
ax.plot(xs, 2 - 200/50*xs, 'o', color='C3', ms=5, label=r'$v_0 - cx/m$')
ax.set_xlabel('$x$ [m]'); ax.set_ylabel(r'$\dot x$ [m/s]'); ax.grid(alpha=0.3); ax.legend()
ax.set_xlim(0, 0.5); ax.set_ylim(0, 2)
end_ticks(fig)
plt.show()

The kinetic energy \(\tfrac{1}{2}m v_0^2 = 100\) J is all dissipated as heat in the damper, and that is what a damper is for. A real damper adds an end stop and a return spring, and the spring is the subject of the next example.

Example 6: The spring-damper system

A mass on a spring with a damper in parallel (Figure 7.2.9) is the most common model in dynamics. A car’s wheel on its suspension, a machine on its mounts and a building swaying in the wind are all, to a first approximation, this system. The question here is how the mass moves after it is released from a displaced position, and how the damper changes that motion.

Figure 7.2.9: The mass \(m\) is held by a spring of stiffness \(k\) and a damper with coefficient \(c\), and may be loaded by an external force \(F_{\mathrm{ext}}\). On the right, the free body diagram in the horizontal direction.

Step 1 - Equation of motion

We measure \(x\) from the position where the spring is unstretched. The spring pulls the mass back with \(kx\) and the damper resists with \(c\dot x\), both against the displacement and the velocity as drawn in the free body diagram. Newton’s second law gives

\[ F_{\mathrm{ext}} - kx - c\dot x = m\ddot x , \]

which is usually written with the unknown on the left,

\[ m\ddot x + c\dot x + kx = F_{\mathrm{ext}} . \tag{7.2.3}\]

We take \(F_{\mathrm{ext}} = 0\) and nudge the system by releasing it from rest at the displacement \(\delta\),

\[ x(0) = \delta , \qquad \dot x(0) = 0 . \]

Step 2 - Natural frequency and damping ratio

Dividing 7.2.3 by \(m\) leaves two parameters, and their standard form is

\[ \ddot x + 2\zeta\omega_n\dot x + \omega_n^2 x = 0 , \qquad \omega_n = \sqrt{\frac{k}{m}} , \qquad \zeta = \frac{c}{2m\omega_n} = \frac{c}{2\sqrt{km}} . \tag{7.2.4}\]

The natural frequency \(\omega_n\) is the angular frequency at which the mass would oscillate without the damper, and the damping ratio \(\zeta\) compares the damping coefficient with the value \(2\sqrt{km}\) at which the oscillation just disappears. To see why, we try a solution of the form \(x = e^{\lambda t}\). Substituting it into 7.2.4 gives the characteristic equation

\[ \lambda^2 + 2\zeta\omega_n\lambda + \omega_n^2 = 0 \quad\Longrightarrow\quad \lambda = \omega_n\left(-\zeta \pm \sqrt{\zeta^2 - 1}\right) . \]

The sign under the square root decides the character of the motion, and the four cases have names:

  • Undamped, \(\zeta = 0\): \(\lambda = \pm i\omega_n\), a cosine of constant amplitude, \(x = \delta\cos\omega_n t\).
  • Underdamped, \(0 < \zeta < 1\): complex roots, an oscillation at the damped frequency \(\omega_d = \omega_n\sqrt{1 - \zeta^2}\) inside the decaying envelope \(\delta e^{-\zeta\omega_n t}\).
  • Critically damped, \(\zeta = 1\): a double root \(\lambda = -\omega_n\), the fastest return to rest without overshoot.
  • Overdamped, \(\zeta > 1\): two negative real roots, a slow creep back without oscillation.

Step 3 - The four cases

We take \(m = 1\) kg, \(k = 100\) N/m and \(\delta = 0.1\) m, so that \(\omega_n = 10\) rad/s and the undamped period is \(2\pi/\omega_n \approx 0.63\) s. The damping coefficient follows from the damping ratio, \(c = 2\zeta\sqrt{km}\), and we solve 7.2.4 for \(\zeta = 0\), \(0.1\), \(1\) and \(2\).

Code
x = sp.Function('x')
zeta, w_n = sp.symbols('zeta omega_n', nonnegative=True)
w_val, delta = 10, sp.Rational(1, 10)

def free_response(z):
    ode = sp.Eq(x(t).diff(t, 2) + 2*z*w_val*x(t).diff(t) + w_val**2*x(t), 0)
    return sp.simplify(sp.dsolve(ode, x(t), ics={x(0): delta, x(t).diff(t).subs(t, 0): 0}).rhs)

cases = {z: free_response(z) for z in (0, sp.Rational(1, 10), 1, 2)}
ltx(*[s for z, xz in cases.items()
      for s in (r"\zeta = " + sp.latex(z) + r":\quad x(t) &=", sp.powsimp(sp.expand(xz)).evalf(3), r"\\")][:-1],
    aligned=True)

\[ \begin{aligned}\zeta = 0:\quad x(t) &=0.1 \cos{\left(10 t \right)}\\\zeta = \frac{1}{10}:\quad x(t) &=0.01 e^{- t} \sin{\left(3 \sqrt{11} t \right)} + 0.1 e^{- t} \cos{\left(3 \sqrt{11} t \right)}\\\zeta = 1:\quad x(t) &=t e^{- 10 t} + 0.1 e^{- 10 t}\\\zeta = 2:\quad x(t) &=0.108 e^{10 t \left(-2 + \sqrt{3}\right)} - 0.00773 e^{- 10 t \left(\sqrt{3} + 2\right)}\end{aligned} \]

The four solutions show the structure of the roots. The undamped case is the pure cosine, the underdamped case a cosine and a sine at \(\omega_d = 10\sqrt{1 - 0.01} \approx 9.95\) rad/s multiplied by \(e^{-t}\), the critically damped case the polynomial factor \((1 + 10t)\) that a double root brings, and the overdamped case two exponentials with very different rates. Plotting them together shows how each returns to rest.

Code
fig, ax = plt.subplots(figsize=(6, 3.2))
names = {0: 'undamped', sp.Rational(1, 10): 'underdamped', 1: 'critically damped', 2: 'overdamped'}
for (z, xz), col in zip(cases.items(), ('C0', 'C1', 'C2', 'C3')):
    fplot(xz, (t, 0, 3), ax=ax, color=col, lw=2, npoints=600,
          label=fr'$\zeta = {sp.latex(z)}$, {names[z]}')
fplot(delta*sp.exp(-t), (t, 0, 3), ax=ax, color='C1', ls=':', lw=1)
fplot(-delta*sp.exp(-t), (t, 0, 3), ax=ax, color='C1', ls=':', lw=1)
ax.set_xlabel('$t$ [s]'); ax.set_ylabel('$x$ [m]'); ax.grid(alpha=0.3)
ax.set_xlim(0, 3); ax.set_ylim(-0.1, 0.1)
ax.legend(loc='lower right', fontsize=8)
end_ticks(fig)
plt.show()

The dotted lines are the envelope \(\pm\delta e^{-\zeta\omega_n t}\) of the underdamped case, which its peaks touch. The critically damped mass is back at rest well before the overdamped one, although the overdamped damper is twice as strong: a stronger damper resists the spring as well as the motion, and the mass creeps back. This is why vehicle suspensions and measuring instruments are tuned to a damping ratio somewhat below one. They return quickly and overshoot only a little.

The simulation integrates 7.2.3 with the values set by the sliders. Drag the mass to a new starting position and release it, or change the damping while it moves and watch the regime change.

Example 7: The bungee jump

A jumper of mass \(m = 70\) kg steps off a bridge tied to an elastic cord of unstretched length \(L_0 = 20\) m and stiffness \(k = 100\) N/m (Figure 7.2.10). We want the lowest point of the jump, the largest acceleration the jumper feels, and the motion that follows.

Figure 7.2.10: For \(y < L_0\) the cord hangs slack and the jumper falls freely; for \(y > L_0\) the cord is stretched and pulls back with \(k(y - L_0)\). The coordinate \(y\) points down from the deck.

Step 1 - A force that switches on

A cord carries tension but not compression. While the jumper is less than \(L_0\) below the deck the cord is slack and the only force is the weight; once \(y > L_0\) the cord stretches and pulls up with a force proportional to the stretch. With \(y\) positive downward, Newton’s second law reads

\[ m\ddot y = mg - k\max(0,\ y - L_0) , \tag{7.2.5}\]

where \(\max(0,\ y - L_0)\) is the stretch of the cord, which is zero while it is slack. The force is linear on each side of \(y = L_0\) but not across it, so we solve the jump in two phases and match position and velocity where they meet, as we did for the push and glide of Example 1.

Step 2 - Free fall

While the cord is slack, 7.2.5 reduces to the free fall

\[ m\ddot y = mg , \qquad y(0) = 0 , \quad \dot y(0) = 0 , \]

which holds until the cord becomes taut at \(y(t_1) = L_0\). We solve the ODE and then the condition for \(t_1\); the speed at that instant, \(v_1 = \dot y(t_1)\), is the initial condition of the next phase.

Code
m, k, L0, g = sp.symbols('m k L_0 g', positive=True)
vals = {m: 70, k: 100, L0: 20, g: sp.Rational(981, 100)}
y = sp.Function('y')

y1 = sp.dsolve(sp.Eq(m*y(t).diff(t, 2), m*g), y(t),
               ics={y(0): 0, y(t).diff(t).subs(t, 0): 0}).rhs
t1 = [r for r in sp.solve(sp.Eq(y1, L0), t) if r.is_positive][0]
v1 = y1.diff(t).subs(t, t1)

ltx(r"y(t) &=", y1, r"\\ t_1 &=", t1, r"=", t1.subs(vals).evalf(4), r"~\text{s}",
    r"\\ v_1 &=", v1, r"=", v1.subs(vals).evalf(4), r"~\text{m/s}", aligned=True)

\[ \begin{aligned}y(t) &=\dfrac{g t^{2}}{2}\\ t_1 &=\dfrac{\sqrt{2} \sqrt{L_{0}}}{\sqrt{g}}=2.019~\text{s}\\ v_1 &=\sqrt{2} \sqrt{L_{0}} \sqrt{g}=19.81~\text{m/s}\end{aligned} \]

Step 3 - The cord takes over

For \(y > L_0\), 7.2.5 is the spring equation of Example 6 with a constant force added,

\[ m\ddot y + k y = mg + kL_0 , \qquad y(t_1) = L_0 ,\quad \dot y(t_1) = v_1 . \]

The constant right-hand side moves the centre of the oscillation from \(y = 0\) to the static equilibrium \(y_s = L_0 + mg/k\), where the cord would hold the jumper at rest. The jumper therefore oscillates about \(y_s\) at the natural frequency \(\omega_n = \sqrt{k/m}\), and the lowest point is reached when the velocity has dropped to zero.

Code
ode = sp.Eq(m*y(t).diff(t, 2) + k*y(t), m*g + k*L0)
y2 = sp.dsolve(ode.subs(vals), y(t),
               ics={y(t1.subs(vals)): 20, y(t).diff(t).subs(t, t1.subs(vals)): v1.subs(vals)}).rhs
v2 = y2.diff(t)

t_low = sp.nsolve(v2, t, 3.5)                 # the first zero of the velocity after t_1
y_max = y2.subs(t, t_low)
a_max = (g - k*(y_max - L0)/m).subs(vals)

ltx(r"y_s &=", (L0 + m*g/k).subs(vals).evalf(4), r"~\text{m}",
    r"\\ t_{\max} &=", t_low.evalf(4), r"~\text{s}",
    r"\\ y_{\max} &=", y_max.evalf(4), r"~\text{m}",
    r"\\ \ddot y(t_{\max}) &=", a_max.evalf(4), r"~\text{m/s}^2 \approx",
    (a_max/vals[g]).evalf(3), r"\,g", aligned=True)

\[ \begin{aligned}y_s &=26.87~\text{m}\\ t_{\max} &=3.662~\text{s}\\ y_{\max} &=44.81~\text{m}\\ \ddot y(t_{\max}) &=-25.63~\text{m/s}^2 \approx-2.61\,g\end{aligned} \]

The jumper reaches 44.8 m below the deck, the cord stretched by 24.8 m, and at that instant the cord pulls up with 2480 N, three and a half times the weight. The net acceleration is \(2.6g\) upward, in the range that commercial jumps are designed for.

The lowest point also follows without the time history. Between the deck and the lowest point the jumper starts and ends at rest, so the work done by gravity equals the energy stored in the cord,

\[ mg\,y_{\max} = \tfrac{1}{2}k\left(y_{\max} - L_0\right)^2 , \]

a quadratic for \(y_{\max}\) whose larger root is the lowest point. This is a state-based check of the transient solution.

Code
ym = sp.symbols('y_max', positive=True)
roots = sp.solve(sp.Eq(m*g*ym, k*(ym - L0)**2/2).subs(vals), ym)
ltx(r"y_{\max} &=", max(roots).evalf(4), r"~\text{m}", aligned=True)

\[ \begin{aligned}y_{\max} &=44.81~\text{m}\end{aligned} \]

Step 4 - The whole jump

After the lowest point the cord throws the jumper back up. In this model no energy is lost, so the jumper rises past \(y = L_0\), the cord goes slack again, and the jumper flies up to the deck and starts over. To follow that we integrate 7.2.5 across the switch numerically, adding a small damping force \(-c\dot y\) in the stretched phase to represent the energy that the rubber of a real cord turns into heat. The equation of motion is then

\[ \ddot y = g - \frac{F_{\mathrm{cord}}}{m} , \qquad F_{\mathrm{cord}} = \begin{cases} \max\bigl(0,\ k(y - L_0) + c\dot y\bigr) & y > L_0 , \\ 0 & y \leq L_0 . \end{cases} \]

The \(\max\) keeps the cord from pushing, which the damping term would otherwise do while a nearly slack cord shortens quickly. We use the Euler-Cromer method of the lid mechanism, which updates the velocity first and then moves with the new velocity:

\[ \begin{aligned} \dot y_{i+1} &= \dot y_i + \Delta t\,\ddot y(y_i, \dot y_i) , \\ y_{i+1} &= y_i + \Delta t\,\dot y_{i+1} . \end{aligned} \]

def jump(m=70.0, k=100.0, L0=20.0, c=0.0, g=9.81, T=40.0, dt=1e-3):
    n = int(T/dt)
    t, y, v = np.arange(n)*dt, np.zeros(n), np.zeros(n)
    for i in range(n - 1):
        stretch = y[i] - L0
        F_cord = k*stretch + c*v[i] if stretch > 0 else 0.0   # a slack cord pulls nothing
        v[i + 1] = v[i] + dt*(g - max(F_cord, 0.0)/m)        # nor pushes
        y[i + 1] = y[i] + dt*v[i + 1]
    return t, y, v
Code
fig, ax = plt.subplots(figsize=(6, 3))
for c_, col, lab in ((0.0, 'C0', '$c = 0$'), (40.0, 'C3', r'$c = 40$ N$\cdot$s/m')):
    tt, yy, vv = jump(c=c_)
    ax.plot(tt, yy, color=col, lw=1.8, label=lab)
ax.axhline(20, color='0.5', ls='--', lw=1)
ax.text(39, 19, '$L_0$', ha='right', va='bottom')
ax.invert_yaxis()
ax.set_xlabel('$t$ [s]'); ax.set_ylabel('$y$ [m]'); ax.grid(alpha=0.3); ax.legend(loc='lower right')
ax.set_xlim(0, 40); ax.set_ylim(46, 0)
end_ticks(fig)
plt.show()

Without damping the jumper returns to the deck every 7.3 s, and the first dip agrees with the analytic lowest point of 44.8 m. With damping each rebound is lower, the cord stays taut after a few bounces, and the jumper settles into a damped oscillation about \(y_s = 26.9\) m. As in the figure, \(y\) points down.

In the simulation below the bridge deck is 50 m above the water. Change the cord and the jumper and watch the lowest point and the peak deceleration. The margin is smaller than it looks, because the lowest point grows faster than the mass: a jumper of 95 kg on the same cord reaches 50.7 m and goes in the water.

Example 8: The parachute

A skydiver of mass \(m = 80\) kg, equipment included, jumps from an aircraft and falls with the parachute packed. After \(t_o = 30\) s the canopy opens (Figure 7.2.11). How fast does the skydiver fall before and after the canopy opens, and how hard is the deceleration when it does?

Figure 7.2.11: A skydiver falling at the speed \(v\) under the weight \(mg\) and the drag \(\tfrac{1}{2}\rho C_D A v^2\).

Step 1 - Equation of motion and terminal velocity

With \(v\) positive downward, the weight pulls down and the drag of the air, which grows with the square of the speed as in Example 4, pushes up:

\[ m\dot v = mg - c v^2 , \qquad c = \tfrac{1}{2}\rho C_D A . \tag{7.2.6}\]

The drag constant \(c\) collects the air density \(\rho\), the drag coefficient \(C_D\) and the frontal area \(A\). A skydiver in the belly-down position has \(c_1 \approx 0.25\) kg/m; a canopy of some 40 m² raises it to \(c_2 \approx 30\) kg/m. As the speed grows the drag catches up with the weight, and the acceleration vanishes at the terminal velocity,

\[ mg = c v_t^2 \quad\Longrightarrow\quad v_t = \sqrt{\frac{mg}{c}} . \]

Code
m, g, c, v = sp.symbols('m g c v', positive=True)
vals = {m: 80, g: sp.Rational(981, 100)}
c1, c2 = sp.Rational(1, 4), 30
v_t = sp.sqrt(m*g/c)

ltx(r"v_{t,1} &=", v_t.subs(vals).subs(c, c1).evalf(4), r"~\text{m/s}",
    r"\\ v_{t,2} &=", v_t.subs(vals).subs(c, c2).evalf(4), r"~\text{m/s}", aligned=True)

\[ \begin{aligned}v_{t,1} &=56.03~\text{m/s}\\ v_{t,2} &=5.115~\text{m/s}\end{aligned} \]

Without the canopy the skydiver approaches 56 m/s, about 200 km/h; under the canopy 5.1 m/s, which is a landing speed the legs can absorb.

Step 2 - The free fall

Before the canopy opens, 7.2.6 with \(c = c_1\) is the ODE of the free fall, started from rest when the skydiver leaves the aircraft,

\[ m\dot v = mg - c v^2 , \qquad v(0) = 0 . \]

It is first order and nonlinear, but dsolve finds the general solution. SymPy writes it with an integration constant \(C_1\) that comes out imaginary when we fit \(v(0) = 0\); substituting it gives a real result,

\[ v(t) = v_t\tanh\frac{gt}{v_t} . \tag{7.2.7}\]

Code
vf = sp.Function('v')
general = sp.dsolve(sp.Eq(m*vf(t).diff(t), m*g - c*vf(t)**2), vf(t)).rhs
C1 = sp.Symbol('C1')
C1_val = sp.solve(sp.Eq(general.subs(t, 0), 0), C1)[0]
v_free = sp.simplify(general.subs(C1, C1_val))

ltx(r"v(t) &=", general, r"\\ C_1 &=", C1_val, r"\\ v(t) &=", v_free, aligned=True)

\[ \begin{aligned}v(t) &=- \dfrac{\sqrt{g} \sqrt{m}}{\sqrt{c} \tanh{\left(\sqrt{c} \sqrt{g} \left(C_{1} \sqrt{m} - \dfrac{t}{\sqrt{m}}\right) \right)}}\\ C_1 &=- \dfrac{i \pi}{2 \sqrt{c} \sqrt{g} \sqrt{m}}\\ v(t) &=\dfrac{\sqrt{g} \sqrt{m} \tanh{\left(\dfrac{\sqrt{c} \sqrt{g} t}{\sqrt{m}} \right)}}{\sqrt{c}}\end{aligned} \]

With \(v_t = \sqrt{mg/c}\) this is 7.2.7. For small \(t\), \(\tanh x \approx x\) and \(v \approx gt\): at first the skydiver falls freely, as the drag is still small. The time scale \(v_t/g \approx 5.7\) s sets how quickly the drag takes over, and after three of those, some 17 s, the speed is within 1% of \(v_t\). At \(t_o = 30\) s the skydiver falls at the terminal velocity for all practical purposes.

Step 3 - The canopy opens

If the canopy opened instantly, \(c\) would jump from \(c_1\) to \(c_2\) while the speed is still \(v_{t,1}\), and 7.2.6 would give the acceleration

\[ \dot v = g\left(1 - \frac{v_{t,1}^2}{v_{t,2}^2}\right) = g\left(1 - \frac{c_2}{c_1}\right) , \]

which for the ratio \(c_2/c_1 = 120\) is a deceleration of \(119g\). No one survives that. A real canopy takes a few seconds to fill, so the drag grows gradually. We model this by letting the drag constant rise linearly from \(c_1\) to \(c_2\) over the opening time \(T_o\),

\[ c(t) = \begin{cases} c_1 & t < t_o , \\ c_1 + (c_2 - c_1)\dfrac{t - t_o}{T_o} & t_o \leq t \leq t_o + T_o , \\ c_2 & t > t_o + T_o . \end{cases} \]

With a time-dependent \(c\) the variables no longer separate, and we integrate 7.2.6 with forward Euler, \(v_{i+1} = v_i + \Delta t\left(g - c(t_i)v_i^2/m\right)\), for a few opening times.

def fall(T_o, t_o=30.0, c1=0.25, c2=30.0, m=80.0, g=9.81, T=45.0, dt=1e-4):
    t = np.arange(0, T, dt)
    c = np.interp(t, [t_o, t_o + T_o], [c1, c2])   # c1 before, the ramp, c2 after
    v = np.zeros_like(t)
    for i in range(len(t) - 1):
        v[i + 1] = v[i] + dt*(g - c[i]*v[i]**2/m)
    a = g - c*v**2/m                               # the acceleration at every step
    return t, v, a
Code
fig, axes = plt.subplots(2, 1, figsize=(6, 4.4), sharex=True)
peaks = {}
for T_o, col in ((0.5, 'C3'), (1.5, 'C1'), (3.0, 'C0')):
    tt, vv, aa = fall(T_o)
    peaks[T_o] = -aa.min()/9.81
    axes[0].plot(tt, vv, color=col, lw=1.8, label=f'$T_o = {T_o}$ s')
    axes[1].plot(tt, -aa/9.81, color=col, lw=1.8)
axes[0].set_ylabel('$v$ [m/s]'); axes[0].legend(loc='upper right'); axes[0].grid(alpha=0.3)
axes[1].set_ylabel(r'$-\dot v/g$'); axes[1].set_xlabel('$t$ [s]'); axes[1].grid(alpha=0.3)
axes[1].set_xlim(28, 40); axes[0].set_ylim(0, 60); axes[1].set_ylim(0, 18)
end_ticks(fig)
plt.tight_layout(); plt.show()

Code
ltx(*[s for T_o, n in peaks.items()
      for s in (fr"T_o = {T_o}~\text{{s}}:\quad \max(-\dot v) &\approx", round(n, 1), r"\,g", r"\\")][:-1],
    aligned=True)

\[ \begin{aligned}T_o = 0.5~\text{s}:\quad \max(-\dot v) &\approx16.60\,g\\T_o = 1.5~\text{s}:\quad \max(-\dot v) &\approx9.50\,g\\T_o = 3.0~\text{s}:\quad \max(-\dot v) &\approx6.60\,g\end{aligned} \]

The peak deceleration falls quickly with the opening time: 6.6g for a canopy that fills in 3 s, a hard but normal opening, against more than twenty times the weight for one that fills in half a second. The speed curves show why. The drag grows in proportion to \(c\), so the deceleration builds up over the opening time, and by the time \(c\) has reached its final value the speed has already fallen. This is the same lesson as the triangular push of Example 1: when a force changes quickly, the way it rises matters as much as its final value. Canopies are built to open slowly on purpose, with a slider that holds the lines together while the canopy fills.

Open the canopy yourself in the simulation, with any opening time.

Example 9: Packages on a circular guide

Small packages are released from rest at \(A\) and slide down a smooth guide, a quarter circle of radius \(R\), onto a conveyor belt at \(B\) (Figure 7.2.12). The task is to find the normal force between the guide and a package as a function of the angle \(\theta\), and the angular velocity \(\omega\) of the conveyor’s drive pulley, of radius \(r\), at which the packages arrive on the belt without sliding.

Figure 7.2.12: The package slides from rest at \(A\) down the guide of radius \(R\) and leaves it at \(B\), where the belt runs over a pulley of radius \(r\).

Step 1 - Kinematics in natural coordinates

The package moves on a circle about \(O\), so its position is fixed by the single angle \(\theta(t)\), measured from \(OA\). With \(x\) to the right and \(y\) up, the unit vector from \(O\) to the package and the position are

\[ \bm e_R = \begin{bmatrix}-\cos\theta\\ -\sin\theta\end{bmatrix} , \qquad \bm r = R\,\bm e_R . \]

The natural coordinates of Particle kinematics fit the problem: the normal \(\bm e_n = -\bm e_R\) points to the centre of the circle and the tangent \(\bm e_t = \bm e_n\times\bm e_z\) points along the path in the direction of increasing \(\theta\),

\[ \bm e_n = \begin{bmatrix}\cos\theta\\ \sin\theta\end{bmatrix} , \qquad \bm e_t = \begin{bmatrix}\sin\theta\\ -\cos\theta\end{bmatrix} . \]

Differentiating \(\bm r\) twice and projecting on the two unit vectors gives the familiar components of circular motion,

\[ v_t = \dot{\bm r}\cdot\bm e_t = R\dot\theta , \qquad a_t = \ddot{\bm r}\cdot\bm e_t = R\ddot\theta , \qquad a_n = \ddot{\bm r}\cdot\bm e_n = R\dot\theta^2 . \]

We let SymPy do the differentiation and the projection.

Code
R, r, m, g, N = sp.symbols('R r m g N', positive=True)
theta = sp.Function('theta')(t)
th, thd, thdd = sp.symbols(r'theta \dot\theta \ddot\theta', real=True)
named = {theta.diff(t, 2): thdd, theta.diff(t): thd, theta: th}   # readable symbols for display

ee_n = sp.Matrix([sp.cos(theta), sp.sin(theta), 0])
ee_t = ee_n.cross(sp.Matrix([0, 0, 1]))
rr = -R*ee_n
a_t = sp.simplify(rr.diff(t, 2).dot(ee_t))
a_n = sp.simplify(rr.diff(t, 2).dot(ee_n))

ltx(r"\bm e_t &=", ee_t.subs(named), r"\\ a_t &=", a_t.subs(named), r"\\ a_n &=", a_n.subs(named),
    aligned=True)

\[ \begin{aligned}\bm e_t &=\left[\begin{matrix}\sin{\left(\theta \right)}\\- \cos{\left(\theta \right)}\\0\end{matrix}\right]\\ a_t &=R \ddot\theta\\ a_n &=R \dot\theta^{2}\end{aligned} \]

Step 2 - Free body diagram and equations of motion

On the package act its weight \(\bm F_W = -mg\,\bm e_y\) and the normal force \(\bm F_N = N\bm e_n\) from the smooth guide (Figure 7.2.13). Projecting Newton’s second law on the two unit vectors gives

\[ \begin{aligned} \bm e_n:&\quad N - mg\sin\theta = mR\dot\theta^2 , \\ \bm e_t:&\quad mg\cos\theta = mR\ddot\theta , \end{aligned} \]

since the weight \(-mg\,\bm e_y\) has the component \(-mg\sin\theta\) along \(\bm e_n\) and \(mg\cos\theta\) along \(\bm e_t\). The tangential equation holds the angular acceleration, the normal equation the contact force.

Figure 7.2.13: The package on the guide with its weight and the normal force, in natural coordinates.
Code
FF_W = sp.Matrix([0, -m*g, 0])
FF_N = N*ee_n
eqs = [sp.Eq((FF_W + FF_N).dot(ee_n), m*a_n), sp.Eq((FF_W + FF_N).dot(ee_t), m*a_t)]
sol = sp.solve([e.subs(named) for e in eqs], [N, thdd], dict=True)[0]
sol = {k: sp.trigsimp(e) for k, e in sol.items()}
sol | la

\[ \begin{aligned} N &= m \left(R \dot\theta^{2} + g \sin{\left(\theta \right)}\right) \\[9.0pt] \ddot\theta &= \dfrac{g \cos{\left(\theta \right)}}{R} \end{aligned} \]

Step 3 - The differential equation

The tangential equation is the equation of motion of the package. With its initial conditions at \(A\), where the package is released from rest, it reads

\[ \ddot\theta = \frac{g}{R}\cos\theta , \qquad \theta(0) = 0 , \quad \dot\theta(0) = 0 , \tag{7.2.8}\]

and the normal equation then gives the contact force at every instant from the solution,

\[ N(t) = mR\dot\theta^2 + mg\sin\theta . \]

7.2.8 is nonlinear in \(\theta\) and has no solution in elementary functions, so we integrate it numerically. With \(\omega = \dot\theta\) it becomes two first-order equations, which the Euler-Cromer method advances over the time step \(\Delta t\),

\[ \begin{aligned} \omega_{i+1} &= \omega_i + \Delta t\,\frac{g}{R}\cos\theta_i , \\ \theta_{i+1} &= \theta_i + \Delta t\,\omega_{i+1} , \end{aligned} \]

until the package reaches \(B\) at \(\theta = \pi/2\). We take a guide of \(R = 1.5\) m, packages of \(m = 2\) kg and a conveyor pulley of \(r = 0.15\) m.

def slide(R=1.5, g=9.81, dt=1e-5):
    t, theta, omega = [0.0], [0.0], [0.0]
    while theta[-1] < np.pi/2:
        omega.append(omega[-1] + dt*g/R*np.cos(theta[-1]))
        theta.append(theta[-1] + dt*omega[-1])
        t.append(t[-1] + dt)
    return np.array(t), np.array(theta), np.array(omega)
Code
vals = {R: sp.Rational(3, 2), r: sp.Rational(15, 100), m: 2, g: sp.Rational(981, 100)}
tt, th_n, om_n = slide()
N_n = 2*(1.5*om_n**2 + 9.81*np.sin(th_n))           # the normal equation along the solution

ltx(r"t_B &\approx", round(tt[-1], 3), r"~\text{s}",
    r"\\ \dot\theta_B &\approx", round(om_n[-1], 3), r"~\text{rad/s}",
    r"\\ v_B = R\dot\theta_B &\approx", round(1.5*om_n[-1], 3), r"~\text{m/s}",
    r"\\ N_B &\approx", round(N_n[-1], 2), r"~\text{N}", aligned=True)

\[ \begin{aligned}t_B &\approx0.72~\text{s}\\ \dot\theta_B &\approx3.62~\text{rad/s}\\ v_B = R\dot\theta_B &\approx5.42~\text{m/s}\\ N_B &\approx58.86~\text{N}\end{aligned} \]

The package needs 0.72 s to slide down the guide and arrives at \(B\) at 5.42 m/s, pressed against the guide with 58.9 N, three times its weight. The time histories show how the angle and the contact force develop: the package starts slowly, since at \(A\) the guide is vertical and the package is in free fall, and the normal force grows from zero as the package speeds up and the guide turns it.

Code
fig, axes = plt.subplots(2, 1, figsize=(5, 4), sharex=True)
axes[0].plot(tt, np.degrees(th_n), color='C0', lw=2)
axes[0].set_ylabel(r'$\theta$ [deg]'); axes[0].set_ylim(0, 90); axes[0].grid(alpha=0.3)
axes[0].set_yticks([0, 30, 60, 90])
axes[1].plot(tt, N_n, color='C3', lw=2, label='Euler-Cromer')
axes[1].plot(tt[::4000], 3*2*9.81*np.sin(th_n[::4000]), 'o', color='k', ms=4,
             label=r'$3mg\sin\theta$')
axes[1].set_ylabel('$N$ [N]'); axes[1].set_xlabel('$t$ [s]'); axes[1].grid(alpha=0.3)
axes[1].legend(loc='upper left'); axes[1].set_ylim(0, 60)
for a in axes: a.set_xlim(0, tt[-1])
end_ticks(fig)
plt.tight_layout(); plt.show()

Step 4 - A check in closed form

The black dots in the plot are a closed form for the contact force, which the equation of motion gives without the time history. Multiplying 7.2.8 by \(\dot\theta\) and integrating from the release, with the chain rule \(\ddot\theta = \dot\theta\,d\dot\theta/d\theta\) in the angular form of 6.3.3,

\[ \int_0^{\dot\theta}\dot\theta'\,d\dot\theta' = \int_0^\theta \frac{g}{R}\cos\theta'\,d\theta' \quad\Longrightarrow\quad \dot\theta^2 = \frac{2g}{R}\sin\theta , \]

and the normal equation becomes \(N = 3mg\sin\theta\). The numerical solution lies on it, which checks both the integration and the algebra.

Code
w, thp = sp.symbols('w theta_p', positive=True)                 # dummy variables
thd2 = sp.solve(sp.Eq(sp.integrate(w, (w, 0, thd)),
                      sp.integrate(sol[thdd].subs(th, thp), (thp, 0, th))), thd**2)[0]
N_th = sp.simplify(sol[N].subs(thd**2, thd2))
ltx(r"\dot\theta^2 &=", thd2, r"\\ N &=", N_th,
    r"\\ \dot\theta_B &=", sp.sqrt(thd2).subs(vals).subs(th, sp.pi/2).evalf(4), r"~\text{rad/s}",
    aligned=True)

\[ \begin{aligned}\dot\theta^2 &=\dfrac{2 g \sin{\left(\theta \right)}}{R}\\ N &=3 g m \sin{\left(\theta \right)}\\ \dot\theta_B &=3.617~\text{rad/s}\end{aligned} \]

Step 5 - The conveyor speed

The package slides onto the belt without slipping only if the belt moves at the speed the package arrives with. The belt speed is the rim speed of the pulley, so

\[ \omega r = R\dot\theta_B \quad\Longrightarrow\quad \omega = \frac{R\dot\theta_B}{r} . \]

Code
omega = 1.5*om_n[-1]/0.15
ltx(r"\omega &\approx", round(omega, 2), r"~\text{rad/s} \approx", round(omega*30/np.pi), r"~\text{rpm}",
    aligned=True)

\[ \begin{aligned}\omega &\approx36.17~\text{rad/s} \approx345~\text{rpm}\end{aligned} \]

The drive pulley turns at 345 rpm, and in closed form \(\omega = \sqrt{2gR}/r\). Both results rest on the smooth guide. A real guide with friction slows the packages, and the belt then runs faster than they arrive; the packages accelerate on the belt by sliding. Boxes take no harm from that; eggs would.

Example 10: The simple pendulum

A small bob of mass \(m\) hangs from a pivot on a light rod of length \(L\) and swings in a vertical plane (Figure 7.2.14). We derive the equation of motion, solve it for small and for large swings, and find the tension in the rod.

Figure 7.2.14: The pendulum at the angle \(\theta\) from the vertical, and the free body diagram of the bob with the rod tension \(T\) and the weight. The tangent \(\bm e_t\) points in the direction of increasing \(\theta\), the normal \(\bm e_n\) toward the pivot.

Step 1 - Equations of motion

The bob moves on a circle of radius \(L\), so the natural coordinates of Example 9 apply again, with the arc length \(s = L\theta\), the speed \(v = L\dot\theta\) and the accelerations \(a_t = L\ddot\theta\) and \(a_n = L\dot\theta^2\). The rod tension acts along \(\bm e_n\), and the weight has the component \(-mg\sin\theta\) along the tangent and \(-mg\cos\theta\) along the normal. Newton’s second law in the two directions reads

\[ \begin{aligned} \bm e_t:&\quad -mg\sin\theta = mL\ddot\theta , \\ \bm e_n:&\quad T - mg\cos\theta = mL\dot\theta^2 . \end{aligned} \]

Two equations in the two unknowns \(\ddot\theta\) and \(T\), which we solve symbolically as in Example 9.

Code
m, L, g, T = sp.symbols('m L g T', positive=True)
th_s, thd, thdd = sp.symbols(r'theta \dot\theta \ddot\theta', real=True)
ee_t = sp.Matrix([sp.cos(th_s), sp.sin(th_s)])         # increasing theta
ee_n = sp.Matrix([-sp.sin(th_s), sp.cos(th_s)])        # from the bob toward the pivot
FF = T*ee_n + sp.Matrix([0, -m*g])
sol = sp.solve([sp.Eq(FF.dot(ee_t), m*L*thdd), sp.Eq(FF.dot(ee_n), m*L*thd**2)], [thdd, T], dict=True)[0]
sol = {k: sp.trigsimp(e) for k, e in sol.items()}
sol | la

\[ \begin{aligned} T &= m \left(L \dot\theta^{2} + g \cos{\left(\theta \right)}\right) \\[9.0pt] \ddot\theta &= - \dfrac{g \sin{\left(\theta \right)}}{L} \end{aligned} \]

The mass cancels from the tangential equation, which is the equation of motion of the pendulum,

\[ \ddot\theta = -\frac{g}{L}\sin\theta , \qquad \theta(0) = \theta_0 ,\quad \dot\theta(0) = 0 . \tag{7.2.9}\]

The sine makes 7.2.9 nonlinear, and it has no solution in elementary functions.

Step 2 - Small swings

For small angles, \(\sin\theta \approx \theta\), and 7.2.9 becomes the undamped spring equation of Example 6 with \(\omega_n^2 = g/L\),

\[ \ddot\theta = -\frac{g}{L}\theta \quad\Longrightarrow\quad \theta(t) = \theta_0\cos\left(\sqrt{\frac{g}{L}}\,t\right) , \qquad T_0 = 2\pi\sqrt{\frac{L}{g}} . \]

The period \(T_0\) depends on neither the mass nor the amplitude, which is why a pendulum can keep time.

Code
th0 = sp.symbols('theta_0', positive=True)
th = sp.Function('theta')
lin = sp.dsolve(sp.Eq(th(t).diff(t, 2), -g/L*th(t)), th(t),
                ics={th(0): th0, th(t).diff(t).subs(t, 0): 0}).rhs
ltx(r"\theta_{\text{lin}}(t) =", lin)

\[ \theta_{\text{lin}}(t) =\theta_{0} \cos{\left(\dfrac{\sqrt{g} t}{\sqrt{L}} \right)} \]

Step 3 - Large swings

For larger swings we integrate 7.2.9 numerically. With \(\omega = \dot\theta\) the second-order equation becomes two first-order ones, and the Euler-Cromer method of Example 7 advances them,

\[ \begin{aligned} \omega_{i+1} &= \omega_i - \Delta t\,\frac{g}{L}\sin\theta_i , \\ \theta_{i+1} &= \theta_i + \Delta t\,\omega_{i+1} . \end{aligned} \]

Euler-Cromer keeps the energy of an undamped oscillator bounded over many periods, where plain forward Euler would let the swing grow. We take \(L = 1\) m and compare the two solutions for release angles of \(10^\circ\), \(60^\circ\) and \(150^\circ\).

def swing(theta0, L=1.0, g=9.81, T=6.0, dt=1e-4):
    n = int(T/dt)
    t, theta, omega = np.arange(n)*dt, np.zeros(n), np.zeros(n)
    theta[0] = theta0
    for i in range(n - 1):
        omega[i + 1] = omega[i] - dt*g/L*np.sin(theta[i])
        theta[i + 1] = theta[i] + dt*omega[i + 1]
    return t, theta, omega
Code
fig, axes = plt.subplots(3, 1, figsize=(6, 5.4), sharex=True)
f_lin = sp.lambdify((t, th0), lin.subs({L: 1, g: 9.81}))
for ax, deg in zip(axes, (10, 60, 150)):
    tt, tht, _ = swing(np.radians(deg))
    ax.plot(tt, np.degrees(tht), color='C0', lw=1.8, label='nonlinear')
    ax.plot(tt, np.degrees(f_lin(tt, np.radians(deg))), color='C3', ls='--', lw=1.4,
            label=r'$\sin\theta\approx\theta$')
    ax.set_ylabel(r'$\theta$ [deg]'); ax.set_ylim(-1.3*deg, 1.3*deg); ax.grid(alpha=0.3)
    ax.set_yticks([-deg, 0, deg])
    ax.set_title(fr'$\theta_0 = {deg}^\circ$', fontsize=10)
axes[0].legend(loc='lower left', fontsize=8)
axes[-1].set_xlabel('$t$ [s]'); axes[-1].set_xlim(0, 6)
end_ticks(fig)
plt.tight_layout(); plt.show()

At \(10^\circ\) the two curves are indistinguishable over three periods. At \(60^\circ\) the real pendulum falls behind, and at \(150^\circ\) its period is 1.76 times the small-angle one: near the top the restoring component \(mg\sin\theta\) is small, and the bob lingers there. We measure the period from the zero crossings of \(\theta\) and plot it against the amplitude.

Code
def period(theta0):
    tt, tht, _ = swing(theta0, T=20.0, dt=5e-4)
    down = np.where((tht[:-1] > 0) & (tht[1:] <= 0))[0]   # crossings from + to -
    return tt[down[1]] - tt[down[0]]

amps = np.linspace(5, 170, 34)
T0 = 2*np.pi*np.sqrt(1/9.81)
fig, ax = plt.subplots(figsize=(5, 3))
ax.plot(amps, [period(np.radians(a))/T0 for a in amps], 'o-', color='C0', ms=3)
ax.set_xlabel(r'$\theta_0$ [deg]'); ax.set_ylabel('$T/T_0$'); ax.grid(alpha=0.3)
ax.set_xlim(5, 170); ax.set_ylim(1, 2.5)
end_ticks(fig)
plt.show()

The period is within 1% of \(T_0\) up to about \(23^\circ\) and grows without bound as the amplitude approaches \(180^\circ\), where the pendulum balances upside down.

Step 4 - The rod tension

The normal equation gives the tension at every instant of the numerical solution,

\[ T(t) = mg\cos\theta(t) + mL\dot\theta(t)^2 , \]

which we evaluate along the swings from \(60^\circ\) and \(150^\circ\) in units of the weight.

Code
fig, ax = plt.subplots(figsize=(6, 3))
for deg, col in ((60, 'C0'), (150, 'C3')):
    tt, tht, omt = swing(np.radians(deg), T=4.0)
    ax.plot(tt, np.cos(tht) + 1.0*omt**2/9.81, color=col, lw=1.8, label=fr'$\theta_0 = {deg}^\circ$')
    ax.plot(tt[::2500], 3*np.cos(tht[::2500]) - 2*np.cos(np.radians(deg)), 'o', color='k', ms=3)
ax.axhline(0, color='0.5', lw=1)
ax.set_xlabel('$t$ [s]'); ax.set_ylabel('$T/(mg)$'); ax.grid(alpha=0.3); ax.legend(loc='upper right')
ax.set_xlim(0, 4); ax.set_ylim(-1.5, 5)
end_ticks(fig)
plt.show()

The tension peaks each time the bob passes the bottom, at \(3 - 2\cos\theta_0 = 2\) times the weight for \(60^\circ\) and \(4.7\) times for \(150^\circ\). At the turning points of the large swing it is negative: the rod pushes the bob. A string cannot do that, so a pendulum on a string released from \(150^\circ\) goes slack and the bob falls inside the circle.

The black dots are a closed form that checks the numbers. Multiplying 7.2.9 by \(\dot\theta\) and integrating from the release at rest, with the chain rule \(\ddot\theta = \dot\theta\,d\dot\theta/d\theta\), gives \(L\dot\theta^2 = 2g(\cos\theta - \cos\theta_0)\), and then

\[ T = mg\left(3\cos\theta - 2\cos\theta_0\right) . \]

The simulation integrates 7.2.9 in the browser, optionally with a damping term \(-c\dot\theta\), and draws the small-angle solution as a ghost. Drag the bob to release it from a new angle.

Example 11: The banked curve

A car of mass \(m = 1500\) kg drives around a curve of radius \(R = 100\) m whose road is banked at the angle \(\beta = 20^\circ\) (Figure 7.2.15). We first ask at which constant speeds the tyres hold, on a dry road with static friction coefficient \(\mu_s = 0.8\) and on a wet one with \(\mu_s = 0.3\). Then the driver accelerates through the curve on the wet road, from 15 m/s at a full engine power of \(P = 40\) kW against an air drag \(c v^2\) with \(c = 0.4\) kg/m, and we ask when the tyres let go.

Figure 7.2.15: The car seen from behind on a road banked at \(\beta\). The centre of the curve lies on the axis at the distance \(R\) to the left; \(\bm e_n\) points toward it and \(\bm e_z\) up. The friction \(F_f\) across the road is drawn down the slope. The direction of travel \(\bm e_t\) points into the page.

Step 1 - Acceleration and free body diagram

The car follows a horizontal circle, so in the natural basis \((\bm e_t, \bm e_n, \bm e_z)\), with \(\bm e_t\) along the road, its acceleration is

\[ \bm a = \dot v\,\bm e_t + \frac{v^2}{R}\,\bm e_n . \]

Across the road the tyres take the normal force \(N\), perpendicular to the road surface, and the friction \(F_f\) along the slope, positive toward the inside of the curve. Along the road the driven wheels push with the traction \(F_t\), and the air resists with \(c v^2\). With the weight, the forces are

\[ \bm F_N = N\begin{bmatrix}0\\ \sin\beta\\ \cos\beta\end{bmatrix} , \quad \bm F_f = F_f\begin{bmatrix}0\\ \cos\beta\\ -\sin\beta\end{bmatrix} , \quad \bm F_t = \begin{bmatrix}F_t - c v^2\\ 0\\ 0\end{bmatrix} , \quad \bm F_W = \begin{bmatrix}0\\ 0\\ -mg\end{bmatrix} . \]

Step 2 - Equations of motion

Newton’s second law in the three directions gives

\[ \begin{aligned} \bm e_t:&\quad F_t - c v^2 = m\dot v , \\ \bm e_n:&\quad N\sin\beta + F_f\cos\beta = m\frac{v^2}{R} , \\ \bm e_z:&\quad N\cos\beta - F_f\sin\beta - mg = 0 , \end{aligned} \]

three equations in the acceleration \(\dot v\) and the two contact forces \(N\) and \(F_f\).

Code
m, g, R, c, v, beta, N, F_f, F_t, vd = sp.symbols('m g R c v beta N F_f F_t \\dot{v}', real=True)
FF_N = N*sp.Matrix([0, sp.sin(beta), sp.cos(beta)])
FF_f = F_f*sp.Matrix([0, sp.cos(beta), -sp.sin(beta)])
FF_t = sp.Matrix([F_t - c*v**2, 0, 0])
FF_W = sp.Matrix([0, 0, -m*g])
aa = sp.Matrix([vd, v**2/R, 0])

sol = sp.solve(list(FF_N + FF_f + FF_t + FF_W - m*aa), [vd, N, F_f], dict=True)[0]
sol = {k: sp.trigsimp(sp.expand(e)) for k, e in sol.items()}
sol | la

\[ \begin{aligned} F_{f} &= m \left(- g \sin{\left(\beta \right)} + \dfrac{v^{2} \cos{\left(\beta \right)}}{R}\right) \\[9.0pt] N &= m \left(g \cos{\left(\beta \right)} + \dfrac{v^{2} \sin{\left(\beta \right)}}{R}\right) \\[9.0pt] \dot{v} &= \dfrac{F_{t}}{m} - \dfrac{c v^{2}}{m} \end{aligned} \]

The tangential equation is the differential equation for the speed. The other two say what the road must supply across the curve at that speed: the normal force grows with the speed, and the friction changes sign at the speed where \(v^2\cos\beta = gR\sin\beta\). At that design speed the bank alone supplies the normal acceleration and the tyres carry no side load,

\[ v_0 = \sqrt{gR\tan\beta} . \]

Faster than \(v_0\), \(F_f > 0\) and the tyres must pull the car toward the inside, as drawn; slower, \(F_f < 0\) and they hold it up the slope.

Step 3 - Constant speed

At constant speed \(\dot v = 0\), the engine only balances the drag, \(F_t = cv^2\), and the tyres hold as long as static friction can supply the side force, \(|F_f| \leq \mu_s N\). Setting \(F_f = \pm\mu_s N\) in the solution and solving for \(v\) gives the limits

\[ v_{\max}^2 = gR\,\frac{\sin\beta + \mu_s\cos\beta}{\cos\beta - \mu_s\sin\beta} , \qquad v_{\min}^2 = gR\,\frac{\sin\beta - \mu_s\cos\beta}{\cos\beta + \mu_s\sin\beta} . \]

If \(\mu_s \geq \tan\beta\) the numerator of \(v_{\min}^2\) is negative and the car can stand still on the bank.

Code
mu = sp.symbols('mu_s', positive=True)
vals = {g: sp.Rational(981, 100), R: 100, beta: sp.rad(20), m: 1500, c: sp.Rational(2, 5)}
v0 = sp.sqrt(g*R*sp.tan(beta))
v_lim = lambda s: sp.sqrt(g*R*(sp.sin(beta) + s*mu*sp.cos(beta))/(sp.cos(beta) - s*mu*sp.sin(beta)))

def kmh(e):
    return (3.6*e).evalf(3)

rows = [r"v_0 &=", v0.subs(vals).evalf(3), r"~\text{m/s} =", kmh(v0.subs(vals)), r"~\text{km/h}"]
for mu_v in (sp.Rational(8, 10), sp.Rational(3, 10)):
    vmax = v_lim(+1).subs(vals).subs(mu, mu_v)
    vmin2 = (v_lim(-1)**2).subs(vals).subs(mu, mu_v)
    vmin = sp.sqrt(vmin2) if vmin2 > 0 else 0
    rows += [r"\\ \mu_s = " + sp.latex(mu_v.evalf(2)) + r":\quad v &\in [",
             kmh(sp.sympify(vmin)), r",\ ", kmh(vmax), r"]~\text{km/h}"]
ltx(*rows, aligned=True)

\[ \begin{aligned}v_0 &=18.9~\text{m/s} =68.0~\text{km/h}\\ \mu_s = 0.8:\quad v &\in [0,\ 145.0]~\text{km/h}\\ \mu_s = 0.3:\quad v &\in [27.1,\ 97.3]~\text{km/h}\end{aligned} \]

On a dry road the car holds from standstill up to 145 km/h; on a wet one only between 27 km/h and 97 km/h. At \(\beta = 0\) the same wet road would hold only up to \(\sqrt{\mu_s g R} = 62\) km/h. The bank is what lets the road be fast.

Step 4 - Accelerating through the curve

At full power the traction is limited by the engine, \(F_t = P/v\), and the tangential equation becomes the ODE of the speed,

\[ \dot v = \frac{1}{m}\left(\frac{P}{v} - c v^2\right) , \qquad v(0) = 15~\text{m/s} . \tag{7.2.10}\]

It is nonlinear, and we integrate it with forward Euler, \(v_{i+1} = v_i + \Delta t\,\dot v(v_i)\). At every step the solution of Step 2 gives \(N\) and \(F_f\). The tyre now has to supply the traction and the side force at once, and a tyre’s static friction limits the total force in the road plane, so the tyres hold as long as

\[ \sqrt{F_t^2 + F_f^2} \leq \mu_s N . \]

The ratio of the two sides is the share of the available grip that the car uses; the tyres let go when it reaches one.

f_N = sp.lambdify(v, sol[N].subs(vals))
f_Ff = sp.lambdify(v, sol[F_f].subs(vals))

def accelerate(P=40e3, v0=15.0, mu_s=0.3, m=1500.0, c=0.4, dt=1e-3, T=20.0):
    t, v_, use = [0.0], [v0], []
    while t[-1] < T:
        F_t = P/v_[-1]
        use.append(np.hypot(F_t, f_Ff(v_[-1]))/(mu_s*f_N(v_[-1])))
        if use[-1] >= 1:                              # the tyres let go here
            break
        v_.append(v_[-1] + dt*(F_t - c*v_[-1]**2)/m)
        t.append(t[-1] + dt)
    return np.array(t), np.array(v_), np.array(use)
Code
tt, vv, use = accelerate()
ltx(r"t_{\text{slip}} &\approx", round(tt[-1], 2), r"~\text{s}",
    r"\\ v_{\text{slip}} &\approx", round(3.6*vv[-1], 1), r"~\text{km/h}", aligned=True)

\[ \begin{aligned}t_{\text{slip}} &\approx10.27~\text{s}\\ v_{\text{slip}} &\approx96.20~\text{km/h}\end{aligned} \]

Code
fig, axes = plt.subplots(2, 1, figsize=(5.5, 4.2), sharex=True)
axes[0].plot(tt, 3.6*vv, color='C0', lw=2)
axes[0].axhline(float(kmh(v0.subs(vals))), color='0.5', ls=':', lw=1)
axes[0].set_ylabel('$v$ [km/h]'); axes[0].grid(alpha=0.3)
axes[1].plot(tt, use, color='C3', lw=2)
axes[1].axhline(1, color='0.5', lw=1)
axes[1].set_ylabel(r'$\sqrt{F_t^2 + F_f^2}/(\mu_s N)$'); axes[1].set_xlabel('$t$ [s]')
axes[1].grid(alpha=0.3); axes[1].set_ylim(0, 1.05)
for a in axes: a.set_xlim(0, tt[-1])
end_ticks(fig)
plt.tight_layout(); plt.show()

The car gathers speed quickly at first, when the engine’s power turns into a large traction \(P/v\), and more slowly as the speed and the drag grow. The tyres let go after 10.3 s at 96 km/h, just below the constant-speed limit of 97 km/h. The grip used does not rise steadily. At first the traction takes most of it; it falls as the speed approaches the design speed of 68 km/h (dotted), where the bank carries the whole side load, and rises again once the car is faster than that and the friction must hold it in the curve. The traction still in use at the end is what moves the slip a little below the constant-speed limit.

Example 12: A part sliding along a turning arm

An arm turns in a horizontal plane about the hub \(O\) with the angle of Example 7 in Particle kinematics,

\[ \theta(t) = 0.2t + 0.02t^3 , \]

with \(\theta\) in radians and \(t\) in seconds (Figure 7.2.16). A part of mass \(m = 0.5\) kg sits in a smooth slot along the arm, released from rest relative to the arm at \(r = 0.2\) m when the arm starts. In Example 7 the distance \(r(t)\) was prescribed; here nothing holds the part along the arm, and its motion follows from the equations of motion. We look for \(r(t)\), the time at which the part reaches the end of the arm at \(r = 1.2\) m, and the force the slot wall exerts on it.

Figure 7.2.16: The arm at the angle \(\theta\) with the part in its slot at the distance \(r\). The smooth slot can only push across the arm, with \(F_\theta\).

Step 1 - Free body diagram and equations of motion

The plane is horizontal, so the weight is carried by the floor of the slot and does not enter the motion in the plane. The slot is smooth, so its wall pushes only across the arm, along \(\bm e_\theta\): there is no force along the arm. The acceleration in polar coordinates, from Particle kinematics, gives Newton’s second law in the two directions,

\[ \begin{aligned} \bm e_r:&\quad 0 = m\left(\ddot r - r\dot\theta^2\right) , \\ \bm e_\theta:&\quad F_\theta = m\left(r\ddot\theta + 2\dot r\dot\theta\right) . \end{aligned} \tag{7.2.11}\]

The radial equation contains the unknown motion \(r(t)\) and no force; the transverse equation gives the unknown force once the motion is known.

Code
m, F_th = sp.symbols('m F_theta', real=True)
rf = sp.Function('r')
theta = sp.Rational(1, 5)*t + sp.Rational(1, 50)*t**3
r_t = rf(t)

eqs = [sp.Eq(0, m*(r_t.diff(t, 2) - r_t*theta.diff(t)**2)),
       sp.Eq(F_th, m*(r_t*theta.diff(t, 2) + 2*r_t.diff(t)*theta.diff(t)))]
sol = sp.solve(eqs, [r_t.diff(t, 2), F_th], dict=True)[0]
r_s, rd_s = sp.symbols(r'r \dot{r}', real=True)
named = {r_t.diff(t): rd_s, r_t: r_s}                 # readable symbols for display
ltx(r"\ddot r &=", sp.factor(sol[r_t.diff(t, 2)].subs(named)), r"\\ F_\theta &=",
    sp.collect(sp.expand(sol[F_th].subs(named)), m), aligned=True)

\[ \begin{aligned}\ddot r &=\dfrac{r \left(3 t^{2} + 10\right)^{2}}{2500}\\ F_\theta &=m \left(\dfrac{3 \dot{r} t^{2}}{25} + \dfrac{2 \dot{r}}{5} + \dfrac{3 r t}{25}\right)\end{aligned} \]

Step 2 - The differential equation

The radial equation is the ODE of the part,

\[ \ddot r = r\dot\theta^2 , \qquad r(0) = 0.2~\text{m} , \quad \dot r(0) = 0 . \tag{7.2.12}\]

Without a force along the arm the part cannot follow the circle it is on: the arm carries it round, and it drifts outward. When the arm turns at a constant rate \(\dot\theta = \omega\), 7.2.12 has constant coefficients and dsolve gives the closed form \(r = r_0\cosh\omega t\), an exponential flight outward.

Code
w, r0 = sp.symbols('omega r_0', positive=True)
r_const = sp.dsolve(sp.Eq(rf(t).diff(t, 2), w**2*rf(t)), rf(t),
                    ics={rf(0): r0, rf(t).diff(t).subs(t, 0): 0}).rhs
ltx(r"\dot\theta = \omega:\quad r(t) =", sp.simplify(r_const.rewrite(sp.cosh)))

\[ \dot\theta = \omega:\quad r(t) =r_{0} \cosh{\left(\omega t \right)} \]

Our arm speeds up, \(\dot\theta = 0.2 + 0.06t^2\), and with this time-dependent coefficient 7.2.12 has no closed form. We integrate it with the Euler-Cromer method, \(\dot r_{i+1} = \dot r_i + \Delta t\,r_i\dot\theta(t_i)^2\) and \(r_{i+1} = r_i + \Delta t\,\dot r_{i+1}\), until the part reaches the end of the arm, and evaluate the slot force from the transverse equation at every step.

thd_f = sp.lambdify(t, theta.diff(t))
thdd_f = sp.lambdify(t, theta.diff(t, 2))

def slide_out(r0=0.2, L=1.2, m=0.5, dt=1e-4):
    t_, r, rd = [0.0], [r0], [0.0]
    while r[-1] < L:
        rd.append(rd[-1] + dt*r[-1]*thd_f(t_[-1])**2)
        r.append(r[-1] + dt*rd[-1])
        t_.append(t_[-1] + dt)
    t_, r, rd = map(np.array, (t_, r, rd))
    F = m*(r*thdd_f(t_) + 2*rd*thd_f(t_))          # the transverse equation along the solution
    return t_, r, rd, F
Code
tt, rr, rd, F = slide_out()
ltx(r"t_{\text{end}} &\approx", round(tt[-1], 2), r"~\text{s}",
    r"\\ \dot r(t_{\text{end}}) &\approx", round(rd[-1], 2), r"~\text{m/s}",
    r"\\ F_\theta(t_{\text{end}}) &\approx", round(F[-1], 2), r"~\text{N}", aligned=True)

\[ \begin{aligned}t_{\text{end}} &\approx4.70~\text{s}\\ \dot r(t_{\text{end}}) &\approx1.56~\text{m/s}\\ F_\theta(t_{\text{end}}) &\approx2.72~\text{N}\end{aligned} \]

Step 3 - The motion and the slot force

The part leaves the end of the arm after 4.70 s, moving outward at 1.56 m/s. The plot compares its path along the arm with the motion \(r = 0.2 + 0.04t^2\) that Example 7 prescribed, and shows the slot force and its two parts.

Code
fig, axes = plt.subplots(2, 1, figsize=(5.5, 4.4), sharex=True)
axes[0].plot(tt, rr, color='C0', lw=2, label='free in the slot')
axes[0].plot(tt, 0.2 + 0.04*tt**2, color='0.5', ls='--', lw=1.4, label='Example 7, prescribed')
axes[0].set_ylabel('$r$ [m]'); axes[0].grid(alpha=0.3); axes[0].legend(loc='upper left')
axes[0].set_ylim(0, 1.2)
axes[1].plot(tt, F, color='C3', lw=2, label=r'$F_\theta$')
axes[1].plot(tt, 0.5*rr*thdd_f(tt), color='C3', ls=':', lw=1.2, label=r'$mr\ddot\theta$')
axes[1].plot(tt, 2*0.5*rd*thd_f(tt), color='C3', ls='--', lw=1.2, label=r'$2m\dot r\dot\theta$')
axes[1].set_ylabel('force [N]'); axes[1].set_xlabel('$t$ [s]'); axes[1].grid(alpha=0.3)
axes[1].legend(loc='upper left', fontsize=8); axes[1].set_ylim(0, None)
for a in axes: a.set_xlim(0, tt[-1])
end_ticks(fig)
plt.tight_layout(); plt.show()

For the first two seconds the part barely moves along the arm, since \(r\dot\theta^2\) is small while the arm turns slowly, and it falls behind the prescribed motion of Example 7. As the arm speeds up, \(r\dot\theta^2\) grows with both the speed and the distance, the part accelerates outward ever faster, and it overtakes the prescribed motion just before the end of the arm. The slot force grows with it, and from the middle of the motion it is dominated by the term \(2m\dot r\dot\theta\). The arm must push the part across faster and faster as the part moves out to where the arm’s rim speed \(r\dot\theta\) is higher. To make the part follow the motion of Example 7 instead, a gripper would have to supply the radial force \(F_r = m(\ddot r - r\dot\theta^2)\) of the prescribed \(r(t)\): pushing the part outward for the first two seconds, ahead of where it would drift on its own, and holding it back from then on.

Example 13: A loop with friction

A roller coaster car enters a circular loop of radius \(R = 8\) m at the speed \(v_0\) (Figure 7.2.17). The wheels lose energy to rolling resistance, which we model as a friction force \(\mu N\) against the motion with \(\mu = 0.03\). We want the speed and the normal force around the loop, and the smallest entry speed at which the car stays on the track over the top. The loop in Roller coaster loop was shaped to avoid exactly the problem a circle has, and this example shows what that problem is.

Figure 7.2.17: The car at the angle \(\theta\) from the bottom of a loop of radius \(R\), entered at \(v_0\). On the right, the free body diagram of the car with the normal force \(N\) toward the centre, the friction \(\mu N\) against the motion, and the weight.

Step 1 - Equations of motion

We measure \(\theta\) from the bottom of the loop, and the car runs anticlockwise. The tangent and the normal toward the centre are

\[ \bm e_t = \begin{bmatrix}\cos\theta\\ \sin\theta\end{bmatrix} , \qquad \bm e_n = \begin{bmatrix}-\sin\theta\\ \cos\theta\end{bmatrix} , \]

so the weight \(-mg\,\bm e_y\) has the component \(-mg\sin\theta\) along the tangent and \(-mg\cos\theta\) along the normal. With the normal force \(N\bm e_n\) and the friction \(-\mu N\bm e_t\), Newton’s second law in natural coordinates reads

\[ \begin{aligned} \bm e_t:&\quad -mg\sin\theta - \mu N = m\dot v , \\ \bm e_n:&\quad N - mg\cos\theta = m\frac{v^2}{R} . \end{aligned} \]

The friction couples the two: the normal force decides how much speed is lost, and the speed decides the normal force. We solve the pair for the acceleration and the normal force.

Code
m, g, R, mu, v, th, vd, N = sp.symbols('m g R mu v theta \\dot{v} N', real=True)
ee_t = sp.Matrix([sp.cos(th), sp.sin(th)])
ee_n = sp.Matrix([-sp.sin(th), sp.cos(th)])
FF = N*ee_n - mu*N*ee_t + sp.Matrix([0, -m*g])
sol = sp.solve([sp.Eq(FF.dot(ee_t), m*vd), sp.Eq(FF.dot(ee_n), m*v**2/R)], [vd, N], dict=True)[0]
sol = {k: sp.expand(sp.trigsimp(e)) for k, e in sol.items()}
sol | la

\[ \begin{aligned} N &= g m \cos{\left(\theta \right)} + \dfrac{m v^{2}}{R} \\[9.0pt] \dot{v} &= - g \mu \cos{\left(\theta \right)} - g \sin{\left(\theta \right)} - \dfrac{\mu v^{2}}{R} \end{aligned} \]

Step 2 - The differential equations

The car moves along the circle, so its angle changes at \(\dot\theta = v/R\). Together with the tangential equation this gives two first-order ODEs for the state \((\theta, v)\), with the car entering at the bottom,

\[ \begin{aligned} \dot\theta &= \frac{v}{R} , \\ \dot v &= -g\sin\theta - \mu\left(\frac{v^2}{R} + g\cos\theta\right) , \end{aligned} \qquad \theta(0) = 0 ,\quad v(0) = v_0 , \tag{7.2.13}\]

and the normal force at each instant is

\[ \frac{N}{mg} = \frac{v^2}{gR} + \cos\theta . \tag{7.2.14}\]

The friction model only holds while the track pushes on the car, \(N \geq 0\). When \(N\) reaches zero the car leaves the track and falls, so we stop the integration there. We integrate 7.2.13 with Euler-Cromer, updating the speed first and moving with the new speed,

\[ \begin{aligned} v_{i+1} &= v_i + \Delta t\,\dot v(\theta_i, v_i) , \\ \theta_{i+1} &= \theta_i + \Delta t\,\frac{v_{i+1}}{R} . \end{aligned} \]

def ride(v0, mu=0.03, R=8.0, g=9.81, dt=1e-4):
    t, th_, v_ = [0.0], [0.0], [v0]
    while th_[-1] < 2*np.pi:
        N_mg = v_[-1]**2/(g*R) + np.cos(th_[-1])
        if N_mg < 0 or v_[-1] <= 0:                # off the track, or stopped and rolling back
            return np.array(t), np.array(th_), np.array(v_), False
        vdot = -g*np.sin(th_[-1]) - mu*g*N_mg      # mu*N/m with N/m = g*N_mg
        v_.append(v_[-1] + dt*vdot)
        th_.append(th_[-1] + dt*v_[-1]/R)
        t.append(t[-1] + dt)
    return np.array(t), np.array(th_), np.array(v_), True

A car entering at 22 m/s makes it round. The time histories show the speed falling to its minimum at the top and the normal force swinging from more than six times the weight at the entry to under one at the top.

Code
tt, thn, vn, ok = ride(22.0)
fig, axes = plt.subplots(2, 1, figsize=(5.5, 4.2), sharex=True)
axes[0].plot(tt, vn, color='C0', lw=2)
axes[0].set_ylabel('$v$ [m/s]'); axes[0].grid(alpha=0.3)
axes[1].plot(tt, vn**2/(9.81*8) + np.cos(thn), color='C3', lw=2)
axes[1].axhline(0, color='0.5', lw=1)
axes[1].set_ylabel('$N/(mg)$'); axes[1].set_xlabel('$t$ [s]'); axes[1].grid(alpha=0.3)
for a in axes: a.set_xlim(0, tt[-1])
end_ticks(fig)
plt.tight_layout(); plt.show()

Step 3 - The minimum entry speed

Below some entry speed the car does not make it over the top. We find that speed by bisection on the simulation: a run that goes round raises the lower bound, a run that leaves the track lowers the upper bound, until the bounds agree to a millimetre per second.

Code
def v0_min(mu, lo=10.0, hi=40.0):
    while hi - lo > 1e-3:
        mid = (lo + hi)/2
        lo, hi = (lo, mid) if ride(mid, mu=mu, dt=2e-4)[3] else (mid, hi)
    return hi

v_crit = {mu_v: v0_min(mu_v) for mu_v in (0.0, 0.03, 0.1)}
ltx(*[s for mu_v, vc in v_crit.items()
      for s in (fr"\mu = {mu_v}:\quad v_{{0,\min}} &\approx", round(vc, 2), r"~\text{m/s}", r"\\")][:-1],
    aligned=True)

\[ \begin{aligned}\mu = 0.0:\quad v_{0,\min} &\approx19.81~\text{m/s}\\\mu = 0.03:\quad v_{0,\min} &\approx20.96~\text{m/s}\\\mu = 0.1:\quad v_{0,\min} &\approx23.92~\text{m/s}\end{aligned} \]

The friction-free value is 19.8 m/s. Rolling resistance of \(\mu = 0.03\) raises it by about 6%, and a much more lossy \(\mu = 0.1\) by about 21%. Friction acts in proportion to \(N\), and \(N\) is largest in the lower half of the loop, so most of the speed is lost on the way up.

Step 4 - A check in closed form

The speed around the loop also follows without the time history. With \(s = R\theta\) and the chain rule of 6.3.3, \(\dot v = v\,dv/ds = \frac{1}{2R}\,d(v^2)/d\theta\), and the tangential equation becomes an equation in \(u = v^2\) and the angle alone,

\[ \frac{du}{d\theta} + 2\mu u = -2gR\left(\sin\theta + \mu\cos\theta\right) , \qquad u(0) = v_0^2 . \tag{7.2.15}\]

It is linear and of first order, and dsolve returns its solution, a decaying exponential plus a part that follows the sine and cosine on the right,

\[ u(\theta) = v_0^2 e^{-2\mu\theta} + \frac{2gR}{1 + 4\mu^2}\Bigl[\left(1 - 2\mu^2\right)\left(\cos\theta - e^{-2\mu\theta}\right) - 3\mu\sin\theta\Bigr] . \]

With \(\mu = 0\) it reduces to energy conservation, \(v^2 = v_0^2 - 2gR(1 - \cos\theta)\), and 7.2.14 to \(N/(mg) = v_0^2/(gR) - 2 + 3\cos\theta\). The normal force is then smallest at the top and stays non-negative only if \(v_0^2 \geq 5gR\), the classic result for a circular loop. With friction we find the minimum entry speed from the closed form with a root finder on the smallest normal force around the loop, and compare with the bisection.

Code
from scipy.optimize import brentq
ths, v0 = sp.symbols('theta v_0', positive=True)
u = sp.Function('u')
ode = sp.Eq(u(ths).diff(ths) + 2*mu*u(ths), -2*g*R*(sp.sin(ths) + mu*sp.cos(ths)))
u_th = sp.simplify(sp.dsolve(ode, u(ths), ics={u(0): v0**2}).rhs)
f_N = sp.lambdify((ths, v0, mu), (u_th/(g*R) + sp.cos(ths)).subs({g: 9.81, R: 8}))
grid = np.linspace(0, 2*np.pi, 4001)
closed = {mu_v: brentq(lambda vv: f_N(grid, vv, mu_v).min(), 5, 40) for mu_v in v_crit}

ltx(*[s for mu_v in v_crit
      for s in (fr"\mu = {mu_v}:\quad v_{{0,\min}} &\approx", round(closed[mu_v], 3),
                r"~\text{(closed form)},\quad", round(v_crit[mu_v], 3), r"~\text{(bisection)}", r"\\")][:-1],
    aligned=True)

\[ \begin{aligned}\mu = 0.0:\quad v_{0,\min} &\approx19.81~\text{(closed form)},\quad19.81~\text{(bisection)}\\\mu = 0.03:\quad v_{0,\min} &\approx20.96~\text{(closed form)},\quad20.96~\text{(bisection)}\\\mu = 0.1:\quad v_{0,\min} &\approx23.92~\text{(closed form)},\quad23.92~\text{(bisection)}\end{aligned} \]

The two agree to the resolution of the bisection. Plotting 7.2.14 around the loop at the minimum entry speed for \(\mu = 0.03\) shows the price of a circle: the rider feels 6.6 times the weight at the bottom and nothing at the top.

Code
fig, ax = plt.subplots(figsize=(5.5, 3.2))
for mu_v, col in ((0.0, 'C0'), (0.03, 'C3')):
    vc = closed[0.03]
    ax.plot(np.degrees(grid), f_N(grid, vc, mu_v), color=col, lw=2,
            label=fr'$\mu = {mu_v}$, $v_0 = {vc:.2f}$ m/s')
ax.axhline(0, color='0.5', lw=1)
ax.set_xlabel(r'$\theta$ [deg]'); ax.set_ylabel('$N/(mg)$'); ax.grid(alpha=0.3); ax.legend()
ax.set_xlim(0, 360); ax.set_ylim(-1, 7)
end_ticks(fig)
plt.show()

At the same entry speed the friction-free car keeps a margin at the top, while the car with friction just touches zero. Both curves start at \(N/(mg) = 1 + v_0^2/(gR) \approx 6.6\) at the entry, a load a passenger cannot take for long. A real loop is therefore not a circle. It is tall and narrow, with a large radius at the bottom where the car is fast and a small one at the top where it is slow, as in Roller coaster loop.

In the simulation below, lower the entry speed until the car leaves the track at the top, or raise the friction and watch the speed drain away around the loop. It integrates 7.2.13 the same way.