Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

3.1 Examples, exercises and solutions

Updated: 27 jan 2026

Worked Examples

Slowing a mass down

We continue with the worked example from chapter 2: a mass, mm, has initial velocity v0v_0. From t=0t=0 onwards a force FF (with magnitude μmg\mu mg, μ>0\mu >0) is acting on mm, slowing it down. Eventually, mm will come to a stand still. The problem is 1-dimensional.

How much work has FF done?

Interpret the problem
Develop the solution
Evaluate the solution
Assess the solution

First we make a sketch and draw what is relevant for this problem. We can use the same figure as used in chapter 2.

We conclude our interpret-phase with our idea on how to approach this problem:

  • the force is a friction force, hence it is not conservative.

  • work and change of kinetic energy are related: W12=Ekin,2Ekin,1W_{12} = E_{kin,2} - E_{kin,1}

  • we do know the velocity of mm at the beginning and at the end: v0v_0 and 0, respectively.

Is friction a conservative force?

As a second example: let us investigate of the friction force, F=μmgF = - \mu mg, of the above example a conservative force is or not.

Interpret the problem
Develop and Evaluate the solution
Assess the solution

Again, we start with a sketch and draw what is relevant for this problem. We can use a similar figure as above, but with even less detail.

As we deal with a 1-dimensional problem, vector arrows above FF, vv or xx are not needed. But don’t be deceived: when dealing with work we have to evaluate an inner product and even in a 1-dimensional case quantities like force have direction.

We can proceed via different directions:

  1. find a potential or show that this doesn’t exist;

  2. show that Fdr=0\oint \vec{F}\cdot d\vec{r} = 0 always or find at least one closed path for which the work is non-zero.

We opt for the second approach: find one path from x=x1x=x_1 to x=x1x=x_1 for which x1x1Fdx0\int_{x_1}^{x_1} F dx \neq 0.

Cycling in a force field

The professor likes to cycle in a force field during his break. The force field is given by: F=yx^F = y \hat{x}. As he has to return for his next lecture, he cycles in a closed loop. He moves from (0,0) to (1,0) to (1,1) to (0,1) to (0,0) - or the other way around. Given that he has to have enough energy to educate the students, he wonders: how much work do I do during the ride and does that differ when I go clockwise?

Interpret the problem
Develop the solution
Evaluate the solution
Assess the solution

Let’s first make a sketch of the situation. In this case we need to get some idea of the force field and the path. We can do that by plotting some vectors. This can be done by hand, but also by using Python:

Source
import numpy as np
import matplotlib.pyplot as plt


def plot_vector_field(F, xlim=(-.5, 1.5), ylim=(-.5, 1.5), N=20, scale=None):
    x = np.linspace(xlim[0], xlim[1], N)
    y = np.linspace(ylim[0], ylim[1], N)
    X, Y = np.meshgrid(x, y)

    Fx, Fy = F(X, Y)

    plt.figure(figsize=(5, 5))
    plt.quiver(X, Y, Fx, Fy, scale=scale)
    
    plt.arrow(1, 0, 0, .9, head_width=0.1, head_length=0.1, fc='red', ec='red', linewidth=2)
    plt.arrow(0, 1, 0, -.9, head_width=0.1, head_length=0.1, fc='red', ec='red', linewidth=2)
    plt.arrow(0, 0, .9, 0, head_width=0.1, head_length=0.1, fc='red', ec='red', linewidth=2)
    plt.arrow(1, 1, -.9, 0, head_width=0.1, head_length=0.1, fc='red', ec='red', linewidth=2)

    plt.xlabel("x")
    plt.ylabel("y")
    plt.xlim(xlim)
    plt.ylim(ylim)
    # plt.savefig("../images/ch3_ex_force_field.svg") 
    plt.show()

def F(x, y):
    return y, 0

plot_vector_field(F)

def F(x, y):
    return y, 0

plot_vector_field(F)
the force field plot with arrows directed in the x direction with length proportional to y.

The force field that the professor is cycling in.

Exercise set 1

Source
import numpy as np
import matplotlib.pyplot as plt
import ipywidgets as widgets
from ipywidgets import interact

# --- Parameters ---
x0 = 0.0
t_stop = 2.0
dt = 0.02
t = np.arange(0, t_stop + dt, dt)

def run_animation(v0, F, m):
    # --- Derived motion ---
    x = x0 + v0 * t + 0.5 * F / m * t**2
    v = v0 + F / m * t
    E_kin = 0.5 * m * v**2
    W = F * (x - x0)

    # --- Plot setup ---
    plt.clf()
    
    fig, axs = plt.subplots(2, 1, figsize=(15, 10))
    
    ax_position = axs[0]
    ax_ekin = axs[1]

    ax_position.plot(t,x,'k-')
    ax_position.set_xlim(0, t_stop)
    ax_position.set_ylim(min(x)-1, max(x)+1)
    ax_position.set_title("Position vs Time")
    ax_position.set_ylabel('$x$(m)')

    ax_ekin.plot(t,E_kin,'k-',label='$E_{kin}$')
    ax_ekin.plot(t,W,'r-',label='$W$')
    ax_ekin.set_xlim(0, t_stop)
    ax_ekin.set_ylim(0, max(E_kin)*1.1)
    ax_ekin.set_title("Kinetic Energy vs Time")
    ax_ekin.set_ylabel('$E$(J)')
    

    
# --- Interact control panel ---
interact(run_animation,
         v0=widgets.FloatSlider(min=0, max=10, step=0.5, value=5.0, description="v₀ (m/s)"),
         F=widgets.FloatSlider(min=-5, max=5, step=0.5, value=6.5, description="F (N)"),
         m=widgets.FloatSlider(min=0.5, max=5.0, step=0.1, value=1.0, description="m (kg)"))

Answers set 1

Solution to Exercise 1

a. Show ×mg=0 \vec{\nabla} \times m\vec{g} = 0
×mg=0 \vec{\nabla} \times m\vec{g} = 0 ? How to compute it? For Cartesian coordinates there is an easy to remember rule:

×F=x^y^z^xyzFxFyFz\vec{\nabla} \times \vec{F} = \begin{vmatrix}\hat{x}&\hat{y}&\hat{z}\\\frac{\partial}{\partial x}&\frac{\partial}{\partial y}&\frac{\partial}{\partial z}\\F_x&F_y&F_z\end{vmatrix}

If we chose our coordinates such that g=gz^ \vec{g} = -g \hat{z} we get:

×Fg=x^y^z^xyz00mg=0\vec{\nabla} \times \vec{F}_g = \begin{vmatrix}\hat{x}&\hat{y}&\hat{z}\\\frac{\partial}{\partial x}&\frac{\partial}{\partial y}&\frac{\partial}{\partial z}\\0&0& -mg\end{vmatrix} = 0

Thus Fg \vec{F}_g is conservative.

b. Find a VV that satisfies mg=V -m\vec{g} = -\vec{\nabla} V
Does mg=V -m\vec{g} = -\vec{\nabla} V have a solution for V? Let’s try, using the same coordinates as above.

V=mgVx=0V(x,y,z)=f(y,z)Vy=0V(x,y,z)=g(x,z)Vz=mgV(x,y,z)=mgz+h(x,y)\begin{split} -\vec{\nabla}V &= - m\vec{g} \Rightarrow \\ \frac{\partial V}{\partial x} &= 0 \rightarrow V(x,y,z) = f(y,z) \\ \frac{\partial V}{\partial y} &= 0 \rightarrow V(x,y,z) = g(x,z) \\ \frac{\partial V}{\partial z} &= mg \rightarrow V(x,y,z) = mgz + h(x,y) \end{split}

f,g,h are unknown functions. But all we need to do, is find one VV that satisfies mg=V -m\vec{g} = -\vec{\nabla} V .

So, if we take V(x,y,z)=mgz V(x,y,z) = mgz we have shown, that gravity in this form is conservative and that we can take V(x,y,z)=mgz V(x,y,z) = mgz for its corresponding potential energy.

By the way: from the first part (curl F = 0), we know that the force is conservative and we know that we could try to find V from

V(x,y,z)=refmgdr=refmgz^dr=refmgdz=mgz+const\begin{split} V(x,y,z) &= -\int_{ref} m\vec{g} \cdot d\vec{r} = \int_{ref} mg \hat{z} \cdot d\vec{r} \\ &= \int_{ref} mg dz = mgz + const \end{split}
Solution to Exercise 3

Click for the solution Friction Not Conservative.

Solution to Exercise 4

Click for the solution Conservative Force.

Solution to Exercise 5

Click for the solution Non-Conservative Force.

Solution to Exercise 6

Click for the solution Potential energy & Force.

Solution to Exercise 7

Click for the solution Force Field.

Solution to Exercise 8

Click for the solution Sinusoidal Force Field.

Exercise set 2

Source
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
from IPython.display import HTML

#  Inputs 
x0 = float(input('Initial position (m) from 0 to 10'))        # Initial position (m)
v0 = float(input('Initial velocity (m/s) from -10 to 10'))        # Initial velocity (m/s)
k = float(input('Spring constant (N/m) from 0.1 to 1'))       # Spring constant (N/m)
m = 2.0        # Mass (kg)

#  Derived 
omega = np.sqrt(k / m)
t_stop = 4.0
dt = 0.02
t_values = np.arange(0, t_stop, dt)

#  Analytical solution for x(t) 
C1 = 0.5 * x0 + 0.5 * v0 / omega
C2 = 0.5 * x0 - 0.5 * v0 / omega
x = C1 * np.exp(omega * t_values) + C2 * np.exp(-omega * t_values)

# Velocity is not needed directly as E_kin = total energy - work (from energy conservation)
W = 0.5 * k * (x**2 - x0**2)
v_squared = v0**2 + 2 * W / m
E_kin = 0.5 * m * v_squared

#  Plot setup 
fig, axs = plt.subplots(2, 2, figsize=(10, 10))
ax_block = axs[0, 0]
ax_pos = axs[1, 0]
ax_ekin = axs[0, 1]
ax_work = axs[1, 1]

# Set axis limits
ax_block.set_xlim(min(x)-1, max(x)+1)
ax_block.set_ylim(-1, 1)
ax_block.set_title("Block motion")
ax_block.set_yticks([])
ax_block.axhline(y=-0.06, color='black', linewidth=5)

ax_pos.set_xlim(0, t_stop)
ax_pos.set_ylim(min(x)-1, max(x)+1)
ax_pos.set_title("Position vs Time")

ax_ekin.set_xlim(0, t_stop)
ax_ekin.set_ylim(0, max(E_kin)*1.1)
ax_ekin.set_title("Kinetic Energy vs Time")

ax_work.set_xlim(0, t_stop)
ax_work.set_ylim(min(W)*1.1, max(W)*1.1)
ax_work.set_title("Work vs Time")

# Artists
block_dot, = ax_block.plot([], [], 'rs', markersize=10)
line_pos, = ax_pos.plot([], [], 'b')
line_ekin, = ax_ekin.plot([], [], 'g')
line_work, = ax_work.plot([], [], 'r')

#  Init 
def init():
    block_dot.set_data([], [])
    line_pos.set_data([], [])
    line_ekin.set_data([], [])
    line_work.set_data([], [])
    return block_dot, line_pos, line_ekin, line_work

#  Update function 
def update(frame):
    t = t_values[:frame]
    block_dot.set_data([x[frame]], [0])
    line_pos.set_data(t, x[:frame])
    line_ekin.set_data(t, E_kin[:frame])
    line_work.set_data(t, W[:frame])
    return block_dot, line_pos, line_ekin, line_work

#  Animation 
ani = FuncAnimation(fig, update, frames=len(t_values),
                    init_func=init, interval=dt*1000, blit=True)

plt.close(fig)  # Prevent double static plot
HTML(ani.to_jshtml())

Answers set 2

Solution to Exercise 9
  1. W=ΔEkin=0xFdx=0xkxdx=1/2kx2=1/2mv2v=kx2mW=\Delta E_{kin} = \int_0^x F \mathrm{d}x = \int_0^x k x dx = 1/2kx^2 = 1/2mv^2 \Rightarrow v = \sqrt{\frac{kx^2}{m}}

  2. The spring has mass as well.

  3. The gravitational does work as well (W=Fgdx<0W=F_g\mathrm{d}x \lt 0)

Solution to Exercise 13
Solution to Exercise 15

Work done by electric field when the electron moves from x=14Lx=\frac{1}{4}L to x=0x=0:

W=14L0F .ds=eE014L0sin(2πxL)dx=eE0L2π[cos(2πxL)]14L0=12πeE0LW=\int_{\frac{1}{4}L}^{0}{\vec{F}\ .d\vec{s}}=-eE_0\int_{\frac{1}{4}L}^{0}{\sin\left(2\pi\frac{x}{L}\right)dx=\\ -eE_0\frac{L}{2\pi}}\left[-\cos\left(2\pi\frac{x}{L}\right)\right]_{\frac{1}{4}L}^0=\frac{1}{2\pi}eE_0L

Work done is gain in kinetic energy: ΔEkin=W\Delta E_{kin}=W. Assuming the only work done is by the electric field and using initial velocity is zero: vi=0v_i=0 :

12mv2= 12πeE0Lv= eE0Lπm\frac{1}{2}mv^2=\ \frac{1}{2\pi}eE_0L\Rightarrow v=\ \sqrt{\frac{eE_0L}{\pi m}}

Note that indeed the work done is positive, as it should in this case since the electron starts with zero velocity.

Solution to Exercise 16
W=0LF .ds=0LF0etτ dxW=\int_{0}^{L}{\vec{F}\ .d\vec{s}}=\int_{0}^{L}{F_0e^{-\frac{t}{\tau}}\ dx}

Particle velocity is v0=const.v_0=const. Thus, trajectory x(t)=v0tx\left(t\right)=v_0t since at t=0x=0t=0\rightarrow x=0 Consequently: x=Lt= Lv0x=L\rightarrow t=\ \frac{L}{v_0}

Thus, we can write for the amount of work done:

W=0Lv0F0etτv0dt=F0v0[τetτ]0L/v0=F0v0τ(1eLv0τ)W=\int_{0}^{\frac{L}{v_0}}{F_0e^{-\frac{t}{\tau}}\cdot v_0dt}=\\ F_0v_0\left[-\tau e^{-\frac{t}{\tau}}\right]_0^{L/v_0}=F_0v_0\tau\left(1-e^{-\frac{L}{v_0\tau}}\right)

We note: W>0W>0 and naively, we could expect that the kinetic energy of the particle would have increased. But that isn’t the case: it started with Ekin=12mv02E_{kin}= \frac{1}{2}mv_0^2 and it kept this along the entire path as it is given that the particle is traveling with a constant velocity.

From this last statement, we immediately learn, that there must be a second force acting on the particle. This force is exactly equal and opposite to FF at all times! Otherwise, the particle would accelerate and change its velocity. Consequently, this second force also perform work on mm, the amount is exactly W-W and thus the total work done on the particle is zero which reflects that the particle does not change its kinetic energy.

Footnotes
  1. Exercise from Idema, T. (2023). Introduction to particle and continuum mechanics. Idema (2023)

References
  1. Idema, T. (2023). Introduction to particle and continuum mechanics. TU Delft OPEN Publishing. 10.59490/tb.81