Skip to article frontmatterSkip to article content

2.5Examples, exercises and solutions

Here are some examples and exercises that deals with forces. Make sure you practice IDEA.

2.5.1Exercises set 1

2.5.2Answers set 1

Solution to Exercise 1

F=mv0Δtx^\vec{F} = -\frac{m v_0}{\Delta t} \hat{x}

Solution to Exercise 2
Interpret
Develop
Evaluate
Assess
Solution to Exercise 3
  1. a=Fma = \frac{F}{m} is constant
  2. v(t)=v0+atv(t) = v_0 + at
  3. x(t)=v0t+12at2x(t) = v_0 t + \frac{1}{2}at^2
Solution to Exercise 4
  1. a=Fm=F0msin(2πf0t)a = \frac{F}{m} = \frac{F_0}{m} \sin (2\pi f_0 t) is not constant
  2. v(t)=v0+F02πf0m(1cos(2πf0t))v(t) = v_0 + \frac{F_0}{2 \pi f_0 m} \left ( 1 - \cos (2\pi f_0 t ) \right )
  3. x(t)=v0t+12at2x(t) = v_0 t + \frac{1}{2}at^2
Solution to Exercise 5
  1. Particle moves at constant velocity, thus path is a straight line:
r(t)=r0+v0t=x0i^+y0j^+v0xti^+v0ytj^\vec{r}(t) = \vec{r}_0 + \vec{v}_0 t = x_0 \hat{i} + y_0 \hat{j} + v_{0x} t \hat{i} + v_{0y} t \hat{j}

At t=0:r(0)=0i^+yA(^j)r(0)=r0=0i^+yAj^x0=0 and y0=yAt=0: \vec{r}(0) = 0\hat{i} + y_A\hat(j) \rightarrow \vec{r}(0) = \vec{r}_0 = 0\hat{i} + y_A\hat{j} \rightarrow x_0 = 0 \text{ and } y_0 = y_A

At t=t1:r(t1)=xBi^+0(^j)r(t1)=r0+v0t1=(0+v0xt1)i^+(yA+v0yt1)j^v0x=xBt1 and v0y=yAt1t=t_1: \vec{r}(t_1) = x_B\hat{i} + 0\hat(j) \rightarrow \vec{r}(t_1) = \vec{r}_0 +\vec{v}_0 t_1 = (0 + v_{0x}t_1 )\hat{i} + (y_A + v_{0y}t_1 ) \hat{j} \rightarrow v_{0x} = \frac{x_B}{t_1} \text{ and } v_{0y} = -\frac{y_A}{t_1}

  1. Thus, we find v=xBt1i^yAt1j^\vec{v} = \frac{x_B}{t_1} \hat{i} -\frac{y_A}{t_1}\hat{j}
Solution to Exercise 6
  1. x^=cosθx^+sinθy^=123x^+12y^y^=sinθx^+cosθy^=12x^+123y^\begin{split} \hat{x}' = \cos \theta \hat{x} + \sin \theta \hat{y} = \frac{1}{2}\sqrt{3}\hat{x} + \frac{1}{2} \hat{y}\\ \hat{y}' = -\sin \theta \hat{x} + \cos \theta \hat{y} = -\frac{1}{2} \hat{x} + \frac{1}{2}\sqrt{3} \hat{y}\end{split}
  2. Invert:

    x^=cosθx^sinθy^=123x^12y^y^=sinθx^+cosθy^=12x^+123y^\begin{split} \hat{x} = \cos \theta \hat{x}' - \sin \theta \hat{y}' = \frac{1}{2}\sqrt{3}\hat{x}' - \frac{1}{2} \hat{y}'\\ \hat{y} = \sin \theta \hat{x}' + \cos \theta \hat{y}' = \frac{1}{2} \hat{x}' + \frac{1}{2}\sqrt{3} \hat{y}' \end{split}

   velocity:

v=vxx^+vyy^=vx(cosθx^sinθy^)+vy(sinθx^+cosθy^)=(vxcosθ+vysinθ)x^+(vxsinθ+vycosθ)y^\begin{split} \vec{v} &= v_x \hat{x} + v_y \hat{y} \\ &= v_x \left ( \cos \theta \hat{x}' - \sin \theta \hat{y}' \right ) +v_y \left ( \sin \theta \hat{x}' + \cos \theta \hat{y}' \right ) \\ &= \left ( v_x \cos \theta + v_y \sin \theta \right ) \hat{x}' + \left ( -v_x \sin \theta + v_y \cos \theta \right ) \hat{y}' \end{split}

    from which we find

v=(323+52)x^+(32+523)y^\vec{v} = \left ( \frac{3}{2}\sqrt{3} + \frac{5}{2} \right ) \hat{x}' + \left ( -\frac{3}{2} + \frac{5}{2}\sqrt{3} \right ) \hat{y}'
Solution to Exercise 7
x^=cos(2πft)x^+sin(2πft)y^y^=sin(2πft)x^+cos(2πft)y^\begin{split} \hat{x}' = \cos (2\pi ft) \hat{x} + \sin (2\pi ft) \hat{y}\\ \hat{y}' = -\sin (2\pi ft) \hat{x} + \cos (2\pi ft) \hat{y} \end{split}

The unit vectors of S’ rotate with a frequency ff with respect to the unit vectors of S. This means, that the coordinate system of S’ rotates: the rotation angle is a function of time, i.e. θ(t)=2πft\theta (t) = 2 \pi f t

From the figure we see, that the coordinates of a point P, (xp,yp)(x_p, y_p ) according to S, are related to those used by S’, (xp,yp) (x'_p, y'_p ) via:

xp=OPcos(α+θ)=OP(cosαcosθsinαsinθ)=xpcosθypsinθyp=OPsin(α+θ)=OP(cosαsinθ+sinαcosθ)=xpsinθ+ypcosθ\begin{split} x_p = OP \cos ( \alpha + \theta ) = OP \left ( \cos \alpha \cos \theta - \sin \alpha \sin \theta \right) = x'_p \cos \theta - y'_p \sin \theta \\ y_p = OP \sin ( \alpha + \theta ) = OP \left ( \cos \alpha \sin \theta + \sin \alpha \cos \theta \right) = x'_p \sin \theta + y'_p \cos \theta \end{split}

or written as the coordinate transformation:

x=xcosθysinθy=xsinθ+ycosθ\begin{split} x = x' \cos \theta - y' \sin \theta \\ y = x' \sin \theta + y' \cos \theta \end{split}

with its inverse

x=xcosθ+ysinθy=xsinθ+ycosθ\begin{split} x' = x \cos \theta + y \sin \theta \\ y' = -x \sin \theta + y \cos \theta \end{split}

Note that in this case θ=2πft\theta = 2 \pi ft, that is: it is a function of tt.

a) From the above relation we find that the point (1,0) in S will be denoted by S’ as (x(t),y(t))=(cos(2πft),sin(2πft))(x'(t), y'(t)) = (\cos (2 \pi ft), -\sin ( 2\pi ft))

b) the velocity of the point (1,0) in S is according to S of course zero: dxdt=0,dydt=0\frac{dx}{dt} = 0, \frac{dy}{dt} = 0 S’ will say:

x(t)=cos(2πft)dxdt=2πfsin(2πft)y(t)=sin(2πft)dydt=2πfcos(2πft)\begin{split} x'(t) = \cos ( 2\pi ft) \rightarrow \frac{dx'}{dt} = -2 \pi f \sin (2\pi ft) \\ y'(t) = -\sin ( 2\pi ft) \rightarrow \frac{dy'}{dt} = 2 \pi f \cos (2\pi ft) \end{split}
Solution to Exercise 8
  1. Since v0\vec{v}_0 and F\vec{F} are parallel, the particle will not deviate from the line x=y. Hence, we are dealing with a 1-dimensional problem. The original coordinate system, (x,y)(x,y), is not wrong: it is just not handy as it makes the problem look like 2D. Thus, we change our coordinate system, such that the new xx-axis coincides with the original x=y line.

  2. N2: mdvdt=bvm\frac{dv}{dt} = -b v with initial conditions: t=0x=0t= 0 \rightarrow x=0 and t=0v=v0 t=0 \rightarrow v = v_0

  3. dvdtbmv=0v=Aebmt\frac{dv}{dt} - \frac{b}{m} v = 0 \rightarrow v = A e^{-\frac{b}{m}t} initial condition: t=0v=v0A=v0t= 0 \rightarrow v=v_0 \Rightarrow A = v_0 Thus: v(t)=v0ebmtv(t) = v_0 e^{-\frac{b}{m}t}

  4. for t:v0t \rightarrow \infty: v \rightarrow 0. The particle comes to rest and then, obviously, the friction force is zero.

Solution to Exercise 9

to be processed

Solution to Exercise 10

to be processed

2.5.3Exercises set 2

Source
import numpy as np
import matplotlib.pyplot as plt
from ipywidgets import interact, IntSlider
import matplotlib.patches as patches

# Constants
Lrope = 5  # meters

# Arrow scaling parameters
max_arrow_len = 3  # meters max arrow length
max_force = 40  # expected max force in Newtons
arrow_scale = max_arrow_len / max_force  # meters per Newton

# Function to calculate forces and update plot
def update_plot(Fgirl=10, Delta=2):
    Fboys_y = Fgirl / 2
    Fboys_x = Lrope / (4 * Delta * 1e-2) * Fgirl
    Fboys = np.sqrt(Fboys_x**2 + Fboys_y**2)
    
    # Calculate angle in degrees
    angle_rad = np.arctan2(Delta/100, Lrope/2)
    angle_deg = np.degrees(angle_rad)
    
    # Clear the previous plot
    plt.figure(figsize=(10, 4))
    ax = plt.gca()
    ax.set_xlim(-1, 6)
    ax.set_ylim(-0.5, 7.5)
    ax.set_xticks([])
    ax.set_yticks([])
    ax.set_aspect('auto')
    ax.grid(True)
    
    # Draw rope
    x = [0, 2.5, 5]
    y = [0, Delta, 0]
    ax.plot(x, y, 'r-', lw=4, zorder=1)
    
    # Draw participants
    ax.plot(2.5, Delta, 'ko', markersize=10, label='Girl', zorder=4)
    ax.plot(0, 0, 'bo', markersize=12, label='Boy (Left)', zorder=4)
    ax.plot(5, 0, 'bo', markersize=12, label='Boy (Right)', zorder=4)
    ax.legend(loc='upper right')

    # Force arrows
    girl_len = min(arrow_scale * Fgirl, max_arrow_len)
    boy_len = min(arrow_scale * Fboys, max_arrow_len)
    
    # Girl's force
    ax.arrow(2.5, Delta, 0, girl_len, head_width=0.1, color='k', length_includes_head=True, zorder=5)
    ax.text(2.5, Delta + girl_len + 0.1, f'{Fgirl} N', ha='center', fontsize=10, zorder=5)
    
    # Boys’ forces along rope
    dx = -2.5
    dy = -Delta
    vec_len = np.sqrt(dx**2 + dy**2)
    ux, uy = dx / vec_len, dy / vec_len  # unit vector along rope
    
    # Left boy arrow
    ax.arrow(2.5, Delta, boy_len * ux, boy_len * uy, head_width=0.1, color='b', length_includes_head=True, zorder=5)
    ax.text(2.5 + boy_len * ux * 1.1, Delta + boy_len * uy * 1.1, f'{Fboys:.1f} N', ha='right', fontsize=10, color='b', zorder=5)

    # Right boy arrow
    ax.arrow(2.5, Delta, -boy_len * ux, boy_len * uy, head_width=0.1, color='b', length_includes_head=True, zorder=5)
    ax.text(2.5 - boy_len * ux * 1.1, Delta + boy_len * uy * 1.1, f'{Fboys:.1f} N', ha='left', fontsize=10, color='b', zorder=5)
    
    # Display angle
    ax.text(0.5, 7, f"Angle: {angle_deg:.2f}°", fontsize=12, color='purple')

    plt.show()

# Create interactive widgets
interact(update_plot,
         Fgirl=IntSlider(min=5, max=25, step=1, value=10, description='F_girl (N)'),
         Delta=IntSlider(min=1, max=5, step=1, value=2, description='Delta (cm)'))
Loading...
Source
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
from IPython.display import HTML

# Parameters
alpha_deg = float(input('alpha (degrees) from 0 to 45'))       # angle of the slope in degrees
mu = float(input('mu (-) from 0 to 1'))            # friction coefficient
g = 981              # gravity in cm/s²
t_stop = 1           # seconds
dt = 0.01            # time step in seconds

# Convert to radians
alpha = np.radians(alpha_deg)

# Effective acceleration with and without friction
geff = g * (np.sin(alpha) - mu * np.cos(alpha)) if np.sin(alpha) > mu * np.cos(alpha) else 0
gnofric = g * np.sin(alpha)

# Time array
t = np.arange(0, t_stop, dt)

# Position and velocity arrays
x_fric = 0.5 * geff * np.cos(alpha) * t**2
y_fric = -0.5 * geff * np.sin(alpha) * t**2
v_fric = geff * t

x_nofric = 0.5 * gnofric * np.cos(alpha) * t**2
y_nofric = -0.5 * gnofric * np.sin(alpha) * t**2
v_nofric = gnofric * t

# Setup figure and axes
fig, (ax1, ax2, ax3) = plt.subplots(1, 3, figsize=(15, 5))
plt.subplots_adjust(wspace=0.4)

# Left plot: slope animation
ax1.set_xlim(50, 400)
ax1.set_ylim(50, 350)
ax1.set_aspect('equal')
ax1.set_title("Masses Sliding on a Slope")

# Middle plot: x-position over time
ax2.set_xlim(0, t_stop)
ax2.set_ylim(0, max(max(x_nofric), max(x_fric)) * 1.2)
ax2.set_title("x-position over time")
line1, = ax2.plot([], [], 'r-', label='x (no friction)')
line2, = ax2.plot([], [], 'b-', label='x (friction)')
ax2.legend()
ax2.set_xticklabels([])
ax2.set_yticklabels([])

# Right plot: velocity over time
ax3.set_xlim(0, t_stop)
ax3.set_ylim(0, max(max(v_nofric), max(v_fric)) * 1.2)
ax3.set_title("Velocity over time")
line3, = ax3.plot([], [], 'r--', label='v (no friction)')
line4, = ax3.plot([], [], 'b--', label='v (friction)')
ax3.legend()
ax3.set_xticklabels([])
ax3.set_yticklabels([])

# Sloped surface
x0, y0 = 100, 300
dx = 250
dy = -dx * np.tan(alpha)
ax1.plot([x0, x0 + dx], [y0, y0 + dy], 'k')
ax1.plot([x0, x0 + dx], [y0 + dy, y0 + dy], 'k')

# Mass markers
mass_nofric, = ax1.plot([], [], 'ro', label='No friction')
mass_fric, = ax1.plot([], [], 'bo', label='With friction')
ax1.legend()
ax1.set_xticklabels([])
ax1.set_yticklabels([])
def init():
    line1.set_data([], [])
    line2.set_data([], [])
    line3.set_data([], [])
    line4.set_data([], [])
    mass_nofric.set_data([], [])
    mass_fric.set_data([], [])
    return line1, line2, line3, line4, mass_nofric, mass_fric

def update(i):
    if i == 0:
        i = 1  # avoid empty slice

    i = min(i, len(t) - 1)

    # Update x-position lines
    line1.set_data(t[:i], x_nofric[:i])
    line2.set_data(t[:i], x_fric[:i])

    # Update velocity lines
    line3.set_data(t[:i], v_nofric[:i])
    line4.set_data(t[:i], v_fric[:i])

    # Update positions on slope (single points in lists)
    mass_nofric.set_data([x0 + x_nofric[i]], [y0 + y_nofric[i]])
    mass_fric.set_data([x0 + x_fric[i]], [y0 + y_fric[i]])

    return line1, line2, line3, line4, mass_nofric, mass_fric

ani = FuncAnimation(fig, update, frames=len(t), init_func=init, blit=True, interval=dt*1000)
HTML(ani.to_jshtml())
Loading...
Source
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
from IPython.display import HTML

# Parameters
t_stop = 5
dt = 0.01
t = np.arange(0, t_stop + dt, dt)

# Force functions definitions, explicitly use numpy vectorized operations
def force1(t):
    a = 10
    x = 0.5 * a * t**2
    v = a * t
    return x, v

def force2(t):
    x = (1/6) * 10 * t**3
    v = 0.5 * 10 * t**2
    return x, v

def force3(t):
    # Use numpy.pi and ensure t is array
    x = 125 * (1 - np.cos(np.pi * t / 2))
    v = 125 * (np.pi / 2) * np.sin(np.pi * t / 2)
    return x, v

# Choose force here: '1', '2' or '3'
force_num = input('1/2/3')  # change this to '2' or '3' for other forces

if force_num == '1':
    selected_force = force1
elif force_num == '2':
    selected_force = force2
else:
    selected_force = force3

x_vals, v_vals = selected_force(t)

# Ensure x_vals and v_vals are numpy arrays
x_vals = np.array(x_vals)
v_vals = np.array(v_vals)

# Setup figure with 3 parts:
fig = plt.figure(figsize=(12, 6))

# Left plot: mass on line
ax1 = plt.subplot2grid((2, 3), (0, 0), rowspan=2)
ax1.set_xlim(-5, np.max(x_vals)*1.1)
ax1.set_ylim(-1, 2)
ax1.axis('off')
line_y = 0.5
ax1.plot([-5, np.max(x_vals)*1.1], [line_y-0.06, line_y-0.06], 'k-', linewidth=2)
mass_marker, = ax1.plot([0], [line_y], 'rs', markersize=12)
ax1.set_title('Mass sliding on horizontal surface')

# Right top: velocity vs time
ax2 = plt.subplot2grid((2, 3), (0, 1), colspan=2)
ax2.set_xlim(0, t_stop)
ax2.set_ylim(-np.max(v_vals)*1.2, np.max(v_vals)*1.2)
ax2.set_xlabel('Time (s)')
ax2.set_ylabel('Velocity (cm/s)')
ax2.set_title('Velocity vs Time')
line_v, = ax2.plot([], [], 'b-')

# Right bottom: position vs time
ax3 = plt.subplot2grid((2, 3), (1, 1), colspan=2)
ax3.set_xlim(0, t_stop)
ax3.set_ylim(0, np.max(x_vals)*1.2)
ax3.set_xlabel('Time (s)')
ax3.set_ylabel('Position (cm)')
ax3.set_title('Position vs Time')
line_x, = ax3.plot([], [], 'r-')

plt.tight_layout()

def init():
    line_v.set_data([], [])
    line_x.set_data([], [])
    mass_marker.set_data([0], [line_y])
    return line_v, line_x, mass_marker

def update(frame):
    mass_marker.set_data([x_vals[frame]], [line_y])  
    line_v.set_data(t[:frame], v_vals[:frame])
    line_x.set_data(t[:frame], x_vals[:frame])
    return line_v, line_x, mass_marker

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

HTML(ani.to_jshtml())

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

# Parameters
m1 = 1.0  # Red block mass
g_values = {"moon": 1.62, "earth": 9.813, "jupiter": 24.79}
M_values = [0.2, 1.0, 5.0]  # Grey block mass

# User selection
g = g_values[input('Choose: moon/earth/jupiter')]   # Options: "moon", "earth", "jupiter"
M = float(input('Choose: 0.2/1.0/5.0 kg'))        # Options: 0.2, 1.0, 5.0

# Physics
acc = M / (m1 + M) * g  # Net acceleration
t_stop = 1.5
dt = 0.02
t_vals = np.arange(0, t_stop, dt)

# Pixel scaling factor: 25 px per (m/s² * s²), as in JS
scale_factor = 25

# Initial positions
x0 = 40
y0 = 210

# Canvas setup
fig, ax = plt.subplots(figsize=(9, 5))
ax.set_xlim(0, 900)
ax.set_ylim(500, 0)
ax.axis('off')

# Static elements
ax.fill_between([20, 320], 180, 190, color='black')  # floor
pulley = plt.Circle((320, 180), 15, color='grey')
ax.add_patch(pulley)

# Graph axes
ax.plot([450, 450], [20, 470], color='black')   # y-axis
ax.plot([450, 800], [420, 420], color='black')  # x-axis
ax.text(408, 170, "x (m)", fontsize=12)
ax.text(780, 440, "t (s)", fontsize=12)

# Labels
for i, y in enumerate(range(125, 426, 75)):
    ax.text(423, y, f"{(4 - i):.1f}", fontsize=10)
for i, x in enumerate([540, 640, 740]):
    ax.text(x, 440, f"{0.5 * (i + 1):.1f}", fontsize=10)

# Grid lines
for i in range(24):
    ax.plot([450, 800], [420 - 15 * (i + 1)] * 2, color='grey', linewidth=0.5)
for i in range(17):
    ax.plot([450 + 20 * (i + 1)] * 2, [60, 420], color='grey', linewidth=0.5)

# Objects
red_block = Rectangle((x0, 150), 30, 30, color='red')
grey_block = Rectangle((320, y0), 30, 30, color='grey')
ax.add_patch(red_block)
ax.add_patch(grey_block)
cord1, = ax.plot([], [], color='black')
cord2, = ax.plot([], [], color='black')
trace, = ax.plot([], [], color='blue')
x_trace, y_trace = [], []

def update(frame):
    t = frame * dt
    disp = scale_factor * 0.5 * acc * t**2  # consistent with JS

    x = min(x0 + disp, 270)
    y = min(y0 + disp, 440)

    red_block.set_xy((x, 150))
    grey_block.set_xy((320, y))
    cord1.set_data([x + 30, 320], [165, 165])
    cord2.set_data([335, 335], [180, y])

    # Stop x-t trace when red block reaches pulley
    if x < 270:
        x_trace.append(450 + (200 * t))
        y_trace.append(420 - 1.53 * (x - x0))
        trace.set_data(x_trace, y_trace)

    return red_block, grey_block, cord1, cord2, trace


ani = FuncAnimation(fig, update, frames=len(t_vals), blit=True, interval=dt * 1000)
HTML(ani.to_jshtml())

Solution to Exercise 20

When you push with your foot on the peddle, that force is transferred to the chain of your bike. That chain exerts a force on the gear of your bike’s rear wheel, trying to get it to rotate. Your wheel touches the earth and, because of the force on the gear, the wheel exerts a force in the earth, trying to push the earth backwards. Due to action=-reaction, the earth exerts a forward force on your wheel. So actually, biking means “making the earth push you forward”!

2.5.4Answers set 2

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