---
title: Problem set 11
heading: "Problem set 11: simulating mechanics"
eyebrow: B1 · Problem set 11
type: problems
---

::: hook
These problems use the course's labs: the motion lab (13), the energy and momentum lab (23), the rotation lab (33), the oscillations lab (44) and the drag simulation lab (49). Each asks the question that comes before or after a simulation: what step to choose, how long to run, how to read a result, and how far to trust it.
:::

::: pool
pick: 12

::: check
kind: parts
given: E = 2 | 8; k = 2 | 5 | 10

## A simulation's error is {E} mm with time step h. The step is made {k} times smaller.

::: part
answer: E/k
unit: mm
tolerance: 0.5%

### What error does Euler's method then give?

::: misses
- [E/k^4] That's RK4's scaling; Euler is first order.
- [any] Euler's error is proportional to h.
:::
:::

::: part
answer: E/k^4
unit: mm
tolerance: 0.5%

### If the method was RK4 instead, what error would the smaller step give?

::: misses
- [E/k] That's Euler's scaling; RK4 is fourth order.
- [any] RK4's error is proportional to $h^4$.
:::
:::
:::

::: check
kind: parts
given: w = 2 | 6.28; h = 0.001 | 0.01; T = 10 | 60; X = 1 | 5

## Explicit Euler steps an undamped oscillator of angular frequency {w} rad/s for {T} s.

::: part
answer: (1 + w^2*h^2)^(T/h)
tolerance: 0.5%

### By what factor does its energy grow with step {h} s?

::: misses
- [1 + w^2*h^2] That's one step; compound it over $T/h$ steps.
- [any] Each step multiplies the energy by $1 + \omega^2h^2$.
:::
:::

::: part
answer: ln(1 + X/100)/(w^2*T)
unit: s
tolerance: 1%

### Using $(1 + \omega^2h^2)^{T/h} \approx e^{\omega^2hT}$, what largest step keeps the growth under {X}%?

::: misses
- [any] Solve $\omega^2hT = \ln\left(1 + \frac{X}{100}\right)$.
:::
:::
:::

::: check
kind: parts
given: j = 5 | 50; e = 1 | 10

## Position is sampled to estimate velocity by central differences. The motion's third derivative (jerk) reaches {j} m/s³.

::: part
answer: sqrt(6*e/1000/j)*1000
unit: ms
tolerance: 0.5%

### What largest sample spacing keeps the error under {e} mm/s?

::: misses
- [6*e/1000/j*1000] The error goes as $h^2$: take the square root.
- [any] $\frac{h^2}{6}\dddot x \le \epsilon$.
:::
:::

::: part
answer: e/4
unit: mm/s
tolerance: 0.5%

### What error does half that spacing give?

::: misses
- [e/2] A central difference is second order.
- [any] Halving h quarters the error.
:::
:::
:::

::: check
kind: parts
given: x1 = 40 | 55; y1 = 0.2 | 0.6; y2 = -0.1 | -0.4; dx = 0.08 | 0.15

## A simulated projectile is at x = {x1} m, height {y1} m at one step, and at height {y2} m one step later, having moved {dx} m farther.

::: part
answer: y1/(y1 - y2)
tolerance: 0.5%

### What fraction of the step had passed when it reached the ground?

::: misses
- [-y2/(y1 - y2)] That's the fraction remaining.
- [any] $\frac{y_1}{y_1 - y_2}$.
:::
:::

::: part
answer: x1 + dx*y1/(y1 - y2)
unit: m
tolerance: 0.5%

### Where did it land?

::: misses
- [any] Interpolate x by the same fraction.
:::
:::
:::

::: check
kind: parts
given: m = 0.057 | 0.43; d = 6.7 | 22; Cd = 0.5 | 0.25

## A ball of mass {m} kg and diameter {d} cm has $C_d$ = {Cd}, in air of 1.2 kg/m³.

::: part
answer: 1.2*Cd*pi*(d/200)^2/(2*m)
unit: /m
tolerance: 0.5%

### What is its drag parameter $k = \frac{\rho C_dA}{2m}$?

::: misses
- [1.2*Cd*pi*(d/100)^2/(2*m)] Use the radius in the area.
- [any] $A = \pi r^2$.
:::
:::

::: part
answer: sqrt(9.8/(1.2*Cd*pi*(d/200)^2/(2*m)))
unit: m/s
tolerance: 0.5%

### What is its terminal speed?

::: misses
- [any] $kv^2 = g$.
:::
:::
:::

::: check
kind: parts
given: T = 5 | 20; h = 0.001 | 0.01

## A simulation runs RK4 for {T} s with step {h} s.

::: part
answer: 4*T/h
tolerance: 0.5%

### How many times does it evaluate the forces?

::: misses
- [T/h] RK4 evaluates the forces four times per step.
- [any] Four evaluations per step.
:::
:::

::: part
answer: 4*T/h*2
tolerance: 0.5%

### How many with the step halved, to check convergence?

::: misses
- [any] Twice as many steps.
:::
:::
:::

::: check
kind: parts
given: r = 0.5 | 0.8; n = 5 | 10

## On a scope, a ringing oscillator's peaks shrink to {r} of their size over {n} cycles.

::: part
answer: ln(1/r)/n
tolerance: 0.5%

### What is the logarithmic decrement?

::: misses
- [ln(1/r)] Divide by the number of cycles.
- [any] $\delta = \frac1n\ln\frac{x_0}{x_n}$.
:::
:::

::: part
answer: pi*n/ln(1/r)
tolerance: 0.5%

### What is its Q?

::: misses
- [n/ln(1/r)] $Q = \frac{\pi}{\delta}$.
- [any] $Q = \pi/\delta$.
:::
:::
:::

::: check
kind: parts
given: f = 100 | 1000; Q = 50 | 500; n = 10 | 20

## A resonance at {f} Hz with Q = {Q} is to be measured by sweeping the drive frequency.

::: part
answer: f/Q
unit: Hz
tolerance: 0.5%

### What is its half-power bandwidth?

::: misses
- [any] $\Delta f = f_0/Q$.
:::
:::

::: part
answer: f/Q/n
unit: Hz
tolerance: 0.5%

### What frequency step puts {n} points across that bandwidth?

::: misses
- [any] Bandwidth over the number of points.
:::
:::
:::

::: check
kind: parts
given: n = 10 | 20 | 50; e = 0.1 | 0.01

## A sine wave is sampled {n} times per cycle, and its largest sample is read as its amplitude.

::: part
answer: (1 - cos(pi/n))*100
unit: %
tolerance: 0.5%

### By how much can that reading fall short, at worst?

::: misses
- [(1 - cos(2*pi/n))*100] The worst case puts the peak halfway between samples, π/n away.
- [any] $1 - \cos\frac{\pi}{n}$.
:::
:::

::: part
answer: pi/acos(1 - e/100)
tolerance: 0.5%

### How many samples per cycle keep the shortfall under {e}%?

::: misses
- [any] Solve $1 - \cos\frac{\pi}{n} = \epsilon$.
:::
:::
:::

::: check
kind: parts
given: z = 0.01 | 0.05; w = 10 | 100; F = 1000 | 1000000; r = 2 | 5

## A driven oscillator ($\omega_0$ = {w} rad/s, ζ = {z}) starts from rest. Its starting transient decays as $e^{-\zeta\omega_0t}$.

::: part
answer: ln(F)/(z*w)
unit: s
tolerance: 0.5%

### How long until the transient has fallen by a factor of {F}?

::: misses
- [ln(F)/w] Include ζ: the decay rate is $\zeta\omega_0$.
- [any] $t = \frac{\ln F}{\zeta\omega_0}$.
:::
:::

::: part
answer: ln(F)/(z*w)*r*w/(2*pi)
tolerance: 0.5%

### How many drive cycles is that, driving at {r} times $\omega_0$?

::: misses
- [any] Time times the drive frequency, $\frac{r\omega_0}{2\pi}$.
:::
:::
:::

::: check
kind: parts
given: w = 3.13 | 10 | 50; X = 0.1 | 1

## Symplectic Euler steps an oscillator of {w} rad/s. Its energy wobbles by about $\frac{h\omega}{2}$ of its value.

::: part
answer: 2*X/100/w
unit: s
tolerance: 0.5%

### What largest step keeps the wobble under {X}%?

::: misses
- [X/100/w] The wobble is $\frac{h\omega}{2}$, so $h = \frac{2\epsilon}{\omega}$.
- [any] Solve $\frac{h\omega}{2} = \epsilon$.
:::
:::

::: part
answer: 2/w
unit: s
tolerance: 0.5%

### Above what step does the method go unstable?

::: misses
- [any] Symplectic Euler is stable for $h\omega < 2$.
:::
:::
:::

::: check
kind: parts
given: F0 = 0 | 10; F1 = 40 | 60; F2 = 20 | 30; s = 0.5 | 2

## A force is measured at three points {s} m apart: {F0} N, {F1} N and {F2} N.

::: part
answer: s*(F0 + 2*F1 + F2)/2
unit: J
tolerance: 0.5%

### What work does the trapezoid rule give over the whole span?

::: misses
- [s*(F0 + F1 + F2)] The end points get half weight.
- [any] $\frac s2(F_0 + 2F_1 + F_2)$.
:::
:::

::: part
answer: s*(F0 + 4*F1 + F2)/3
unit: J
tolerance: 0.5%

### What does Simpson's rule give?

::: misses
- [any] $\frac s3(F_0 + 4F_1 + F_2)$.
:::
:::
:::

::: check
kind: parts
given: R = 3 | 5; ve = 2.5 | 3.5; P = 1.3 | 2.5

## A rocket with mass ratio $m_0/m_f$ = {R} and exhaust speed {ve} km/s lifts off with thrust {P} times its weight and burns at a steady rate, climbing vertically.

::: part
answer: (1 - 1/R)*ve*1000/(P*9.8)
unit: s
tolerance: 0.5%

### How long does the burn last?

::: misses
- [any] $\dot m = \frac{P m_0g}{v_e}$ and $t_b = \frac{m_0 - m_f}{\dot m}$.
:::
:::

::: part
answer: ve*ln(R) - (1 - 1/R)*ve/P
unit: km/s
tolerance: 0.5%

### What speed does it reach at burnout?

::: misses
- [ve*ln(R)] Subtract the gravity loss $gt_b$.
- [any] $v_e\ln R - gt_b$.
:::
:::
:::

::: check
kind: parts
given: h = 1 | 2; e = 0.6 | 0.8; hm = 1 | 10

## A ball dropped from {h} m bounces with restitution {e}.

::: part
answer: ceil(ln(hm/1000/h)/(2*ln(e)))
tolerance: 0.5%

### After how many bounces does its peak height first fall below {hm} mm?

::: misses
- [ceil(ln(hm/1000/h)/ln(e))] Each bounce's height is $e^2$ times the last.
- [any] Solve $he^{2n} < h_\text{min}$.
:::
:::

::: part
answer: sqrt(2*h/9.8)*(1 + e)/(1 - e)
unit: s
tolerance: 0.5%

### How long does all the bouncing take?

::: misses
- [any] $\sqrt{2h/g}\,\frac{1 + e}{1 - e}$.
:::
:::
:::

::: check
kind: parts
given: n = 5 | 20; k = 100 | 1000; m = 0.1 | 1

## A chain of {n} masses of {m} kg, joined by {k} N/m springs between two walls, is simulated with symplectic Euler.

::: part
answer: 2*sqrt(k/m)*sin(n*pi/(2*(n + 1)))
unit: rad/s
tolerance: 0.5%

### What is the highest mode's angular frequency?

::: misses
- [sqrt(k/m)] The highest mode, neighbors opposing, is nearly twice as fast.
- [any] $2\sqrt{k/m}\sin\frac{n\pi}{2(n + 1)}$.
:::
:::

::: part
answer: 2/(2*sqrt(k/m)*sin(n*pi/(2*(n + 1))))
unit: s
tolerance: 0.5%

### What is the largest stable time step?

::: misses
- [2/sqrt(k/m)] The fastest mode sets the limit.
- [any] $h < \frac{2}{\omega_\text{max}}$.
:::
:::
:::
:::
