Skip to article frontmatterSkip to article content

1.6Examples, exercises and solutions

1.6.1Exercises

Source
# Moving a box

## Importing libraries
import numpy as np
import matplotlib.pyplot as plt

## Constants
m = 2 #kg
F = 30 #N
g = 9.81 #m/s^2
theta = np.deg2rad(10) #degrees

## Time step
dt = 0.01 #s
t = np.arange(0, 10, dt) #s
t_F_stop = ..

## Initial conditions
x = np.zeros(len(t)) #m
v = np.zeros(len(t)) #m/s


## Loop to calculate position and velocity
for i in range(1, len(t)):
    if t[i] < ..:
        a = F/m - g*np.sin(theta)
    else:
        a = -g*np.sin(theta)
    v[i] = v[i-1] + ..
    x[i] = x[i-1] + v[i]*dt

## Plotting results
figs, axs = plt.subplots(1, 2, figsize=(10, 5)) 

axs[0].set_xlabel('Time (s)')
axs[0].set_ylabel('Velocity (m/s)')
axs[0].plot(t, v, 'k.', markersize=1)


axs[1].set_xlabel('Time (s)')
axs[1].set_ylabel('Position (m)')
axs[1].plot(t, x, 'k.', markersize=1)



plt.show()
### Your code
### Your code

1.6.2Solutions

Solution to Exercise 1
F=kv2[kgms2]=[.][m2s2][.]=[kgm]\begin{aligned} F &= k v^2\\ [\frac{\text{kgm}}{\text{s}^2}] &= [.][\frac{\text{m}^2}{\text{s}^2}] \Rightarrow [.]=[\frac{\text{kg}}{\text{m}}] \end{aligned}
Solution to Exercise 2

The physical constants cc, GG and \hbar have the following numerical values and SI-units:

c=2.99792458108  m/sG=6.6741011  m3/kgs2=1.0541034  kgm2/s\begin{split} c &= 2.99792458 \cdot 10^8 \; \mathrm{m/s} \\ G &= 6.674 \cdot 10^-11 \; \mathrm{m^3/kg\cdot s^2} \\ \hbar &= 1.054 \cdot 10^{-34} \; \mathrm{kg m^2/s} \end{split}

Note: the value of cc is precise, i.e. by definition given this value. The second is defined via the frequency of radiation corresponding to the transition between the two hyperfine levels of the ground state of the caesium-133 atom.

If we want to combine these three units into a length scale, L\mathcal{L}, we try the following:

[L]=[c]A[G]B[]C\left [ \mathcal{L} \right ] = [c]^A [G]^B [ \hbar ]^C

What we mean here, is that the units of the quantities (denoted by [.]) left and right should be the same. Thus, we get:

m1=(ms)A(m3kgs2)B(kgm2s)Cm^1 = \left (\frac{m}{s} \right )^A \left (\frac{m^3}{kg s^2} \right )^B \left (\frac{kg m^2}{s} \right )^C

We try to find A,B,CA, B, C such that the above equation is valid. We can write this equation as:

m1=mA+3B+2CkgB+CsA2BCm^1 = m^{A+3B+2C} \cdot kg^{-B+C} \cdot s^{-A-2B-C}

If we split this into requirements for m, kg, s we get:

m:1=A+3B+2Ckg:0=CBs:0=A2BC\begin{split} m: 1 &= A + 3B +2C \\ kg: 0 &= C-B \\ s: 0 &= -A-2B-C \end{split}

From the second equation we get B=CB=C. Substitute this into the first and third and we find:

m:1=A+5Bs:0=A3B\begin{split} m: 1 &= A + 5B \\ s: 0 &= -A-3B \end{split}

Add these two equations: 1=2BB=121 = 2B \rightarrow B= \frac{1}{2} and thus C=12C = \frac{1}{2} and A=32A = -\frac{3}{2}.

So if we plug these values into our starting equation we see:

L=Gc3=1.621035  m\mathcal{L} = \sqrt{\frac{\hbar G}{c^3}} = 1.62 \cdot 10^{-35} \; \mathrm{m}

We can repeat this for energy, E\mathcal{E}:

[E]=[c]α[G]β[]γ\left [ \mathcal{E} \right ] = [c]^\alpha [G]^\beta [ \hbar ]^\gamma

Note: the unit of energy, [J] needs to be written in terms of the basic units: [J]=kgm2/s2[J] = \mathrm{kg m^2/s^2}.

The outcome is: α=52\alpha = \frac{5}{2}, β=12\beta = -\frac{1}{2}, γ=12\gamma = \frac{1}{2} and thus our energy is:

E=c5G=1.96109  J\mathcal{E} = \sqrt{\frac{\hbar c^5}{G}} = 1.96 \cdot 10^{9} \; \mathrm{J}
Solution to Exercise 3
  1. The size of a duck is on the order of 30cm30 \mathrm{cm}. It flies at a speed of about 70km/h70\mathrm{km/h}, that is 20m/s20\mathrm{m/s}. Thus we compute for the Reynolds number of a flying duck:
ReρvLμ=4.0105Re \equiv \frac{\rho v L}{\mu} = 4.0 \cdot 10^5

Clearly, the inertial force is dominant.

What about a swimming duck? Now the velocity is much smaller: v1  m/s=3.6  km/hv \approx 1 \; \mathrm{m/s} = 3.6 \; \mathrm{km/h}. The viscosity of water is μw=1.0  mPas\mu_w = 1.0 \; \mathrm{mPa \cdot s} and the water density is 1.0103  kg/m31.0 \cdot 10^3 \; \mathrm{kg/m^3}. We, again, calculate the Reynolds number:

RewρvLμ=3.0105Re_w \equiv \frac{\rho v L}{\mu} = 3.0 \cdot 10^5

Hence, also in this case inertial forces are dominant. This perhaps comes as a surprise, after all the velocity is much smaller and the viscosity much larger. However, the water density is also much larger!

  1. For a swimming bacterium the numbers change. The size is now about 1μ\mum and the velocity 60 μm/s\mu \mathrm{m/s} (numbers taken from internet). That gives:
RebρvLμ=6.0105Re_b \equiv \frac{\rho v L}{\mu} = 6.0 \cdot 10^{-5}

and we see that here viscous forces are dominating.

  1. For an oil tanker the Reynolds number is easily on the order of 108. Obviously, viscous forces don’t do much. An oil tanker that wants to slow down can not do so by just stopping the motors and let the drag force decelerate them: the Reynolds number shows that the viscous drag is negligible compared to the inertial forces. Thus, the tanker has to use ots engines to slow down. Again the inertia of the system is so large, that it will take a long time to slow down. And a long time, means a long trajectory.

  2. For the flow of water through a (circular) pipe the Reynolds number uses as length scale the pipe diameter. We can relate the velocity of the water in the pipe tot the total volume that is flowing per second through a cress section of the pipe:

Q=π4D2vv=4QπD2Q = \frac{\pi}{4} D^2 v \rightarrow v = \frac{4Q}{\pi D^2}

Thus we can also write ReRe as:

ReρvDμ=4QπmuρD2=4QπνD2Re \equiv \frac{\rho v D}{\mu} = \frac{4Q}{\pi \frac{mu}{\rho} D^2} = \frac{4Q}{\pi \nu D^2}
  1. If Re=2300Re = 2300 for the pipe flow, we have:
Re=vDν=2300v=2300νDRe = \frac{vD}{\nu} = 2300 \rightarrow v = \frac{2300 \nu}{D}

with ν=1.0106  m2/s\nu = 1.0 \cdot 10^{-6} \; \mathrm{m^2/s} and D=1.0102  mD = 1.0 \cdot 10^{-2} \; \mathrm{m} we find: v=0.23  m/sv = 0.23 \; \mathrm{m/s} and Q=1.8105  m3/s=0.018  liter/sQ = 1.8 \cdot 10^{-5} \; \mathrm{m^3/s} = 0.018 \; \mathrm{liter/s}.

Solution to Exercise 4
  1. =1012=10^{-12}
  2. =1021=10^{21}
  3. =103=10^{-3}
Solution to Exercise 5
# Moving a box

## Importing libraries
import numpy as np
import matplotlib.pyplot as plt


part_4 = 1 # Turn to 0 for first part

## Constants
m = 2 #kg
F = 30 #N
g = 9.81 #m/s^2
theta = np.deg2rad(10) #degrees

mu = 0.02
F_N = m*g*np.cos(theta) #N

## Time step
dt = 0.01 #s
t = np.arange(0, 10, dt) #s
t_F_stop = 0.5

## Initial conditions
x = np.zeros(len(t)) #m
v = np.zeros(len(t)) #m/s


## Loop to calculate position and velocity
for i in range(0, len(t)-1):
    if t[i] < t_F_stop:
        a = F/m - g*np.sin(theta) - F_N*mu*np.where(v[i] != 0, np.sign(v[i]), 0)*part_4
    else:
        a = -g*np.sin(theta) - F_N*mu*np.where(v[i] != 0, np.sign(v[i]), 0)*part_4
    v[i+1] = v[i] + a*dt
    x[i+1] = x[i] + v[i]*dt

## Plotting results
figs, axs = plt.subplots(1, 2, figsize=(10, 5)) 

axs[0].set_xlabel('Time (s)')
axs[0].set_ylabel('Velocity (m/s)')
axs[0].plot(t, v, 'k.', markersize=1)


axs[1].set_xlabel('Time (s)')
axs[1].set_ylabel('Position (m)')
axs[1].plot(t, x, 'k.', markersize=1)



plt.show()
Solution to Exercise 6
# Simulation of a base jumper 

## Importing libraries
import numpy as np
import matplotlib.pyplot as plt

## Constants
A = 0.7 #m^2
m = 75 #kg
k = 0.37 #kg/m
g = 9.81 #m/s^2

## Time step
dt = 0.01 #s
t = np.arange(0, 12, dt) #s

## Initial conditions
z = np.zeros(len(t)) #m
v = np.zeros(len(t)) #m/s
z[0] = 300 #m

## Deploy parachute
A_max = 42.6 #m^2
t_deploy_start = 2 #s
dt_deploy = 3.8 #s

## Loop to calculate position and velocity
for i in range(0, len(t)-1):
    F = - m*g - k*A*abs(v[i])*v[i]  #N
    v[i+1] = v[i] + F/m*dt #m/s
    z[i+1] = z[i] + v[i]*dt #m
    # Check if the jumper is on the ground
    if z[i+1] < 0:
        break
    # Deploy parachute
    if t[i] > t_deploy_start and t[i] < t_deploy_start + dt_deploy:
        A += (A_max - A)/dt_deploy*dt 

## Plotting results
figs, axs = plt.subplots(1, 2, figsize=(10, 5)) 

axs[0].set_xlabel('Time (s)')
axs[0].set_ylabel('Velocity (m/s)')

axs[0].plot(t, v, 'k.', markersize=1, label='numerical solution')
axs[0].vlines(t_deploy_start, v[t==t_deploy_start],0, color='gray', linestyle='--', label='parachute deploy')

axs[0].legend()

axs[1].set_xlabel('Time (s)')
axs[1].set_ylabel('Position (m)')

axs[1].plot(t, z, 'k.', markersize=1)
axs[1].vlines(t_deploy_start, 150,300, color='gray', linestyle='--', label='parachute deploy')


plt.show()
Solution to Exercise 7
import numpy as np
import matplotlib.pyplot as plt

F = 49/3
m1 = 1
dt = 0.001
t = np.arange(0, 100, dt) # s

x1 = np.zeros(len(t)) # m
x1[0] = 3
y1 = np.zeros(len(t)) # m
vx = 0
vy = 7


for i in range(0, len(t)-1):
    ax = -F*(x1[i]-0)/np.sqrt(x1[i]**2 + y1[i]**2)/m1
    ay = -F*(y1[i]-0)/np.sqrt(x1[i]**2 + y1[i]**2)/m1
    vx = vx + ax*dt
    vy = vy + ay*dt
    x1[i+1] = x1[i] + vx*dt
    y1[i+1] = y1[i] + vy*dt


plt.figure(figsize=(4,4))
plt.plot(x1, y1, 'k.', markersize=1)
plt.xlabel('x (m)')
plt.ylabel('y (m)')
plt.show()
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