---
title: Problem set 11
heading: "Problem set 11: computation, higher order and boundaries"
eyebrow: A8 · Problem set 11
type: problems
---

::: hook
These problems use lessons 45 to 51: numerical solutions, stiff equations, higher-order equations and stability, power series solutions, and boundary value problems. Several ask about a method's behavior rather than the answer: how big a step, how many steps, how close to unstable.
:::

::: pool
pick: 12

::: check
kind: parts
given: h = 0.1 | 0.05; n = 10 | 20

## Euler's method solves $\dot y = -y$ from $y(0) = 1$ with step $h$ = {h}.

::: part
answer: (1 - h)^n
tolerance: 0.1%

### What is $y$ after {n} steps?

::: misses
- [exp(-h*n)] That's the exact solution.
- [any] Multiply by $1 - h$ each step.
:::
:::

::: part
answer: exp(-h*n) - (1 - h)^n
tolerance: 1%

### By how much does it fall short of the exact value?

::: misses
- [any] $e^{-nh} - (1 - h)^n$.
:::
:::
:::

::: check
kind: parts
given: e1 = 0.004 | 0.01; r = 2 | 4

## A method's error at a fixed time is {e1} with step $h$. Halving $h$ divides the error by about {r}.

::: part
answer: log(r)/log(2)
tolerance: 0.5%

### What is the method's order?

::: misses
- [r] The error goes as $h^p$, so the factor is $2^p$.
- [any] $2^p = $ {r}.
:::
:::

::: part
answer: e1/r^2
tolerance: 0.5%

### What error do you expect with $h/4$?

::: misses
- [any] Two halvings.
:::
:::
:::

::: check
kind: parts
given: tau = 1 | 2 | 5 | 10 | 20 | 50

## A circuit's fastest time constant is {tau} µs.

::: part
answer: 2*tau
unit: µs

### What is forward Euler's largest stable step?

::: misses
- [any] $2\tau$.
:::
:::

::: part
answer: 1/(1 + 10)
tolerance: 0.5%

### Backward Euler takes a step of $10\tau$. By what factor does that mode shrink per step?

::: misses
- [any] $\frac{1}{1 + h/\tau}$.
:::
:::
:::

::: check
kind: parts
given: tf = 1 | 2; ts = 0.5 | 2

## A circuit has time constants of {tf} µs and {ts} s. You simulate 5 s.

::: part
answer: 5/(2*tf*1e-6)

### How many forward Euler steps at the stability limit?

::: misses
- [any] $\frac{5}{2\tau_f}$.
:::
:::

::: part
answer: 5/(ts/100)

### How many backward Euler steps of $\tau_s/100$?

::: misses
- [any] $\frac{5}{\tau_s/100}$.
:::
:::
:::

::: check
kind: parts
given: h = 0.1 | 0.2 | 0.5 | 1 | 1.5 | 3

## Methods on $\dot y = -y$ with step $h$ = {h}.

::: part
answer: (1 - h/2)/(1 + h/2)
tolerance: 0.5%

### What is the trapezoidal rule's factor per step?

::: misses
- [any] $\frac{1 + h\lambda/2}{1 - h\lambda/2}$ with $\lambda = -1$.
:::
:::

::: part
answer: exp(-h)
tolerance: 0.5%

### What is the exact factor per step?

::: misses
- [any] $e^{-h}$.
:::
:::
:::

::: check
kind: parts
given: a2 = 3 | 4; a1 = 2 | 5

## $s^3 + \given{a2}s^2 + \given{a1}s + a_0$.

::: part
answer: a2*a1

### Above what $a_0$ is it unstable?

::: misses
- [any] $a_2a_1 > a_0$ for stability.
:::
:::

::: part
answer: sqrt(a1)
tolerance: 0.5%

### At that boundary, at what angular frequency does it oscillate?

::: misses
- [any] $\pm j\sqrt{a_1}$.
:::
:::
:::

::: check
kind: parts
given: K = 1..7 int

## Three unit stages in a loop: $(s + 1)^3 + \given{K} = 0$.

::: part
answer: 8 - K

### How much more loop gain before it oscillates?

::: misses
- [any] The limit is $K = 8$.
:::
:::

::: part
answer: sqrt(3)
tolerance: 0.5%

### At what angular frequency would it oscillate?

::: misses
- [any] $\sqrt{a_1}$ with $a_1 = 3$.
:::
:::
:::

::: check
kind: parts
given: c = 1 | 3; t = 0.5 | 2

## $(s + \given{c})^3 = 0$ is the characteristic equation.

::: part
answer: t^2*exp(-c*t)
tolerance: 0.5%

### What is the solution $t^2e^{-\given{c}t}$ at $t$ = {t}?

::: misses
- [any] Evaluate it.
:::
:::

::: part
answer: 2/c
tolerance: 0.5%

### When does $t^2e^{-\given{c}t}$ peak?

::: misses
- [1/c] That's $te^{-ct}$.
- [any] Derivative $(2t - ct^2)e^{-ct} = 0$.
:::
:::
:::

::: check
kind: parts
given: L = 0.5 | 2; n = 2 | 3

## $y'' + \lambda y = 0$, $y(0) = y(\given{L}) = 0$.

::: part
answer: (n*pi/L)^2
tolerance: 0.5%

### What is the {n}th eigenvalue?

::: misses
- [any] $(n\pi/L)^2$.
:::
:::

::: part
answer: L/n
tolerance: 0.5%

### Where is the first node inside the interval?

::: misses
- [any] $\sin\frac{n\pi x}{L} = 0$ at $x = L/n$.
:::
:::
:::

::: check
kind: parts
given: v = 2e8 | 1e8; L = 1 | 4

## A transmission line {L} m long, wave speed {v} m/s, shorted at both ends.

::: part
answer: v/(2*L)/1e6
unit: MHz
tolerance: 0.5%

### What is its lowest resonance?

::: misses
- [any] $\frac{v}{2L}$.
:::
:::

::: part
answer: 3*v/(2*L)/1e6
unit: MHz
tolerance: 0.5%

### What is its third resonance?

::: misses
- [any] $\frac{3v}{2L}$.
:::
:::
:::

::: check
kind: parts
given: q = 6 | 12; L = 2 | 4

## A rod with ends at 0 °C has $y'' = -\given{q}$ on $[0, \given{L}]$.

::: part
answer: q*L^2/8
unit: °C
tolerance: 0.5%

### How hot is the middle?

::: misses
- [any] $\frac{qL^2}{8}$.
:::
:::

::: part
answer: q/2*(L/4)*(3*L/4)
unit: °C
tolerance: 0.5%

### How hot is it a quarter of the way along?

::: misses
- [any] $\frac{q}{2}x(L - x)$ at $x = L/4$.
:::
:::
:::

::: check
kind: parts
given: k = 2..10 int

## RK4 has order 4 and Euler order 1. Both use a step $k$ = {k} times smaller than before.

::: part
answer: k^4

### By what factor does RK4's error shrink?

::: misses
- [k] That's Euler, order 1.
- [any] $k^4$.
:::
:::

::: part
answer: k

### By what factor does Euler's error shrink?

::: misses
- [any] Order 1: the same factor as the step.
:::
:::
:::

::: check
kind: parts
given: n = 10 | 40; L = 1 | 3

## A finite-difference grid of {n} intervals on $[0, \given{L}]$.

::: part
answer: -2*n^2/L^2
tolerance: 0.5%

### What is the diagonal entry of the $y''$ matrix?

::: misses
- [-2*n/L] Divide by $h^2$.
- [any] $-2/h^2$ with $h = L/n$.
:::
:::

::: part
answer: n - 1
tolerance: 0

### How many unknowns are there with both end values given?

::: misses
- [n + 1] The two end values are known.
- [any] The interior points.
:::
:::
:::

::: check
kind: parts
given: N = 4 | 8; k = 1 | 2

## Estimate eigenvalue $k$ = {k} of $-y'' = \lambda y$ on $[0, 1]$ with {N} intervals.

::: part
answer: 4*N^2*sin(k*pi/(2*N))^2
tolerance: 0.5%

### What does the grid give?

::: misses
- [(k*pi)^2] That's the exact value; a coarse grid gives less.
- [any] $\frac{4}{h^2}\sin^2\frac{k\pi h}{2}$.
:::
:::
:::

::: check
kind: parts
given: B = 3 | 5 | 8

## Shoot for $y'' = 6x$, $y(0) = 0$, $y(1)$ = {B}: with slope $s$, $y(1) = 1 + s$.

::: part
answer: B - 1
tolerance: 0.5%

### What slope hits the target?

::: misses
- [B] The $x^3$ term contributes 1 at $x = 1$.
- [any] Solve $1 + s = B$.
:::
:::

::: part
answer: (B - 1)/2 + 0.125
tolerance: 0.5%

### What is $y(0.5)$ on that solution?

::: misses
- [any] $y = x^3 + sx$.
:::
:::
:::

::: check
kind: parts
given: x = 1.2 | 1.5 | 1.8

## Solve $y'' + x^2y = 0$ by series with $y(0) = 1$ and $y'(0) = 0$. The recurrence is $a_{n+2} = -a_{n-2}/((n + 2)(n + 1))$, with $a_2 = a_3 = 0$.

::: part
answer: -1/12
tolerance: 0.5%

### What is $a_4$?

::: misses
- [1/12] Check the sign: $a_4 = -a_0/(4 \cdot 3)$.
- [-1/24] The divisor is $(n + 2)(n + 1)$ with $n = 2$: $4 \cdot 3 = 12$.
- [any] Not yet. Use $n = 2$: $a_4 = -a_0/(4 \cdot 3)$.
:::
:::

::: part
answer: 1/672
tolerance: 0.5%

### What is $a_8$?

::: misses
- [-1/672] Two steps of the recurrence give two minus signs.
- [any] Not yet. Use $n = 6$: $a_8 = -a_4/(8 \cdot 7)$.
:::
:::

::: part
answer: 1 - x^4/12 + x^8/672
tolerance: 0.5%

### Using the terms through $x^8$, what is $y(\given{x})$?

::: misses
- [1 - x^4/12] Include the $x^8$ term too.
- [any] Not yet. Sum $1 + a_4x^4 + a_8x^8$.
:::
:::

::: right
Right. The coefficients step four places at a time, because the equation links $a_{n+2}$ to $a_{n-2}$. Near the origin the solution is flat for a long way, like $\cos$ of something growing as $x^2$.
:::
:::
:::
