---
title: Problem set 11
heading: "Problem set 11: numerical methods on circuits and signals"
eyebrow: A13 · Problem set 11
type: problems
---

::: hook
These problems apply the course's methods to the work a circuit simulator and a signal-processing pipeline actually do: Newton's method on diodes, companion models for time stepping, stiffness, conditioning of nodal matrices, fitting, interpolating tables, sampling and Monte Carlo tolerance analysis. They prepare for the circuit-simulator project. Use $I_s = 10^{-14}$ A and $nV_T$ = 25.85 mV for diodes.
:::

::: pool
pick: 12

::: check
kind: parts
given: V = 0.6 | 0.65 | 0.7

## A diode is linearized at {V} V for Newton's method.

::: part
answer: 1e-14/0.02585*exp(V/0.02585)*1000
unit: mS
tolerance: 0.5%

### What is its companion conductance $g_d$?

::: misses
- [1e-14*exp(V/0.02585)*1000] That's the current; divide by $nV_T$ for the conductance.
- [any] $g_d = \frac{I_s}{nV_T}e^{V/nV_T}$.
:::
:::

::: part
answer: (1e-14*(exp(V/0.02585) - 1) - 1e-14/0.02585*exp(V/0.02585)*V)*1000
unit: mA
tolerance: 0.5%

### What is the companion current source $I_d - g_dV$?

::: misses
- [any] $I_d - g_dV$, negative for a forward-biased diode.
:::
:::
:::

::: check
kind: parts
given: E = 5 | 12; R = 1000 | 4700; V0 = 0.6 | 0.7

## A source of {E} V drives a diode through {R} Ω. Take one Newton step on the diode voltage from {V0} V.

::: part
answer: V0 - ((E - V0)/R - 1e-14*(exp(V0/0.02585) - 1))/(-1/R - 1e-14/0.02585*exp(V0/0.02585))
unit: V
tolerance: 0.1%

### Where does it land?

::: misses
- [any] $f(V) = \frac{E - V}{R} - I_s(e^{V/nV_T} - 1)$; step $V - f/f'$.
:::
:::
:::

::: check
kind: parts
given: C = 2.2 | 4.7; L = 1 | 100; h = 1 | 10

## A transient run uses backward Euler with h = {h} µs.

::: part
answer: C/h
unit: S
tolerance: 0.5%

### What conductance stands for a {C} µF capacitor?

::: misses
- [h/C] For a capacitor it's $C/h$; $h/L$ is the inductor's.
- [any] $C/h$.
:::
:::

::: part
answer: h/L*1000
unit: mS
tolerance: 0.5%

### What conductance stands for a {L} mH inductor?

::: misses
- [any] $h/L$.
:::
:::
:::

::: check
kind: parts
given: C = 1 | 4.7; h = 0.5 | 2

## The trapezoidal rule steps a {C} µF capacitor with h = {h} µs.

::: part
answer: 2*C/h
unit: S
tolerance: 0.5%

### What is its companion conductance?

::: misses
- [C/h] That's backward Euler; the trapezoidal rule doubles it.
- [3*C/(2*h)] That's BDF2.
- [any] $2C/h$.
:::
:::
:::

::: check
kind: parts
given: t1 = 1 | 10; t2 = 1 | 5; T = 1 | 10

## A circuit's time constants are {t1} ns and {t2} ms. You simulate {T} ms.

::: part
answer: T*1e-3/(2*t1*1e-9)
tolerance: 0.5%

### At least how many forward Euler steps does stability demand?

::: misses
- [T/(2*t2)] Stability is set by the fastest time constant.
- [any] $h < 2\tau_\text{fast}$.
:::
:::

::: part
answer: T/(t2/20)
tolerance: 0.5%

### How many backward Euler steps of $\tau_\text{slow}/20$?

::: misses
- [any] Accuracy for the slow mode sets the step.
:::
:::
:::

::: check
kind: parts
given: R1 = 1 | 10; R2 = 1000000000 | 100000000

## A nodal matrix contains conductances from a {R1} Ω resistor and a {R2} Ω resistor.

::: part
answer: log(R2/R1)
tolerance: 1%

### About how many digits might its solution lose, taking κ ≈ the ratio of conductances?

::: misses
- [any] $\log_{10}\frac{G_\max}{G_\min}$.
:::
:::
:::

::: check
kind: parts
given: n = 100 | 1000 | 10000 | 100000 | 1000000

## A resistor ladder with {n} nodes has a tridiagonal nodal matrix.

::: part
answer: 8*n
tolerance: 1%

### About how many operations does the Thomas algorithm need?

::: misses
- [2*n^3/3] That's dense elimination.
- [any] About 8n.
:::
:::
:::

::: check
kind: parts
given: v1 = 4.5 | 3.2; v2 = 1.7 | 2.1; t = 2 | 5

## A capacitor discharging through a resistor reads {v1} V and, {t} ms later, {v2} V.

::: part
answer: t/ln(v1/v2)
unit: ms
tolerance: 0.5%

### What is the time constant?

::: misses
- [t/log(v1/v2)] Use the natural logarithm.
- [any] $\tau = \frac{t}{\ln(v_1/v_2)}$.
:::
:::
:::

::: check
kind: parts
given: R0 = 10 | 5; dR = 1.94 | 0.97; x = 2 | 3

## A thermistor table gives {R0} kΩ at 25 °C and {R0} − {dR} kΩ at 30 °C.

::: part
answer: R0 - dR*x/5
unit: kΩ
tolerance: 0.5%

### What does linear interpolation give at {x} °C above 25 °C?

::: misses
- [any] Move a fraction x/5 of the way between the entries.
:::
:::
:::

::: check
kind: parts
given: s = 0.1 | 0.5 | 1 | 2 | 5 | 10

## A divider's ratio is $\frac{R_2}{R_1 + R_2}$ with $R_1 = R_2$, each with an independent spread of {s}%.

::: part
answer: s/sqrt(2)/2
unit: %
tolerance: 0.5%

### What is the relative spread of the ratio?

::: misses
- [s] The ratio's sensitivity to each resistor is only ½.
- [s/sqrt(2)] Each resistor enters with sensitivity ½: $\sqrt{(s/2)^2 + (s/2)^2}$.
- [any] Add in squares: $\sqrt{\left(\frac s2\right)^2 + \left(\frac s2\right)^2}$.
:::
:::
:::

::: check
kind: parts
given: f = 900 | 1100 | 1600; fs = 1000 | 1200

## A tone at {f} Hz is sampled at {fs} Hz with no anti-aliasing filter.

::: part
answer: abs(f - fs*floor(f/fs + 0.5))
unit: Hz
tolerance: 0.5%

### At what frequency does it appear?

::: misses
- [f] It's above half the sample rate, so it folds back.
- [any] The distance from f to the nearest multiple of $f_s$.
:::
:::
:::

::: check
kind: parts
given: x = 0.3 | 0.5 | 1

## RK4 simulates an LC tank with $h\omega$ = {x}.

::: part
answer: sqrt((1 - x^2/2 + x^4/24)^2 + (x - x^3/6)^2)
tolerance: 0.001%

### By what factor does each step multiply the amplitude?

::: misses
- [any] $\lvert1 + z + \frac{z^2}{2} + \frac{z^3}{6} + \frac{z^4}{24}\rvert$ with $z = jh\omega$.
:::
:::
:::

::: check
kind: parts
given: f1 = 1000 | 1010; d = 5 | 20; fs = 48000

## Two tones {d} Hz apart near {f1} Hz are sampled at 48 kHz.

::: part
answer: 48000/d
tolerance: 0.5%

### At least how many samples does an FFT need to put them in separate bins?

::: misses
- [any] $N \ge f_s/\Delta f$.
:::
:::
:::

::: check
kind: parts
given: x = 0.6 | 0.7; y = 0.5 | 0.6

## Two diodes in a circuit give Newton a 2 × 2 Jacobian $\begin{pmatrix}g_1 + 10^{-3} & -10^{-3}\\ -10^{-3} & g_2 + 10^{-3}\end{pmatrix}$, with $g_i$ the diodes' conductances at node voltages {x} and {y} V.

::: part
answer: (1e-14/0.02585*exp(x/0.02585) + 1e-3)*(1e-14/0.02585*exp(y/0.02585) + 1e-3) - 1e-6
tolerance: 0.5%

### What is its determinant?

::: misses
- [any] $(g_1 + G)(g_2 + G) - G^2$ with $G = 10^{-3}$ S.
:::
:::
:::

::: check
kind: parts
given: T = 10 | 100; h = 1 | 0.1

## A transient runs {T} ms with a fixed step of {h} µs, solving a 1000-node sparse system each step.

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

### How many time steps is that?

::: misses
- [T/h] Convert milliseconds to microseconds.
- [any] $T/h$ in matching units.
:::
:::
:::
:::
