---
title: Sensitivity
heading: How much does the output move when a part drifts?
eyebrow: A5 · Lesson 22 · Sensitivity
xp: 50
---

::: hook
Every resistor and capacitor is a little off its marked value, and drifts further as it warms and ages. A designer has to know which parts matter: if a resistor is 1% high, does the filter's corner move by 1%, by 0.1%, or by 10%? The derivative answers this, in a form engineers call sensitivity: the percentage change in the output for each percent change in a part.
:::

::: play
- The curve is a voltage divider's output fraction, $H = \frac{R_2}{R_1 + R_2}$, as $R_2$ varies with $R_1$ fixed, on log axes.
- On log axes a percentage change is a fixed distance, so the slope of the curve is the sensitivity: percent out per percent in.
- $R_1$ and the marked $R_2$ are in kΩ. Move them: where the curve is flat, $R_2$ hardly matters; where it's steep, it matters fully.
:::

```sim plot
view: graph
x: R2 = 100..100k Ω log
y: H = 0.001..1 log
slider: R1 = 1..30 = 10
slider: R2v = 0.1..100 = 4.7
plot: R2/(R1*1e3 + R2) | samples: 300 | label: H
point: R2v*1e3, R2v/(R1 + R2v) | label: R2
readout: sensitivity to R2 here = R1/(R1 + R2v) | digits: 3
```

::: predict
## An RC low-pass has its corner at $1/(2\pi RC)$. If $R$ is 5% high and $C$ is 2% low, about how far does the corner move?

- [ ] Up 7%
- [x] Down about 3%
- [ ] Down 7%
- [ ] Up 3%

::: reveal
Down about 3%. The corner goes as $R^{-1}C^{-1}$, so each part's sensitivity is $-1$: a 5% rise in $R$ lowers it 5%, and a 2% fall in $C$ raises it 2%. Together, about $-5\% + 2\% = -3\%$. The exact answer, $\frac{1}{1.05 \times 0.98} - 1 = -2.8\%$, is close because the changes are small.
:::
:::

::: nameit
## Sensitivity

The sensitivity of $y$ to a part $x$ is the relative change in $y$ per relative change in $x$:

$$S_x^y = \frac{x}{y}\frac{dy}{dx} = \frac{d\ln y}{d\ln x}$$

So for small changes, $\frac{\Delta y}{y} \approx S_x^y\,\frac{\Delta x}{x}$. A sensitivity of 1 passes a part's error straight through; $\tfrac12$ halves it; $-1$ flips its sign.

## Rules that save work

- **Powers:** if $y = kx^n$, then $S_x^y = n$. So a corner $1/(2\pi RC)$ has sensitivity $-1$ to both $R$ and $C$, and a resonance $1/(2\pi\sqrt{LC})$ has $-\tfrac12$ to each.
- **Products and quotients add:** $S_x^{uv} = S_x^u + S_x^v$ and $S_x^{u/v} = S_x^u - S_x^v$.
- **Several parts at once:** $\frac{\Delta y}{y} \approx \sum_i S_{x_i}^y\frac{\Delta x_i}{x_i}$.

## Worst case and typical case

The **worst case** pushes every part to the end of its tolerance in the direction that hurts: $\left|\frac{\Delta y}{y}\right| \le \sum_i |S_i|\,t_i$ for tolerances $t_i$. If the errors are independent and random, they rarely all line up, and a **root-sum-square** estimate, $\sqrt{\sum_i (S_it_i)^2}$, is more typical.

## Where it matters

A divider $\frac{R_2}{R_1 + R_2}$ has sensitivities $\frac{R_1}{R_1 + R_2}$ to $R_2$ and $-\frac{R_1}{R_1 + R_2}$ to $R_1$, both less than 1. An op amp with feedback, gain $\frac{A}{1 + A\beta}$, has a sensitivity of only $\frac{1}{1 + A\beta}$ to its open-loop gain $A$: that's why feedback makes amplifiers predictable even though $A$ varies wildly between chips.
:::

::: example
## An RC low-pass uses 10 kΩ and 10 nF. $R$ comes out 5% high and $C$ 2% low. Where is the corner?

::: solution
1. **Nominal corner.**
   $$\begin{aligned} f_c &= \frac{1}{2\pi \times 10^4 \times 10^{-8}} \\ &= 1591.5\ \text{Hz} \end{aligned}$$
2. **Linear estimate.** Both sensitivities are $-1$, so the corner moves by about
   $$-5\% - (-2\%) = -3\%$$
   to 1544 Hz.
3. **Exact value.**
   $$\begin{aligned} f_c &= \frac{1591.5}{1.05 \times 0.98} \\ &= 1546.7\ \text{Hz} \end{aligned}$$
   a change of $-2.8\%$.
4. **Compare.** The linear estimate is off by about 0.2%, the size of the second-order terms it leaves out:
   $$0.05^2 - 0.05 \times 0.02 + 0.02^2 = 0.0019$$

**Answer:** the corner lands at 1546.7 Hz, 2.8% low; the linear estimate gives 1544 Hz.
:::
:::

::: example
## A divider uses $R_1$ = 10 kΩ on top and $R_2$ = 4.7 kΩ below, both 1%. What are its sensitivities, and its worst-case error?

::: solution
1. **Sensitivities.**
   $$\begin{aligned} \frac{R_1}{R_1 + R_2} &= \frac{10}{14.7} \\ &= 0.680 \end{aligned}$$
   so $S_{R_2} = 0.680$ and $S_{R_1} = -0.680$.
2. **Worst case.** $R_2$ high and $R_1$ low (or the reverse):
   $$\begin{aligned} &0.680 \times 1\% + 0.680 \times 1\% \\ &= 1.36\% \end{aligned}$$
3. **Root-sum-square.**
   $$0.680\sqrt{2} = 0.96\%$$
4. **Compare.** Either way, the output is less sensitive than the 2% you might fear from two 1% parts.

**Answer:** the sensitivities are $0.680$ to $R_2$ and $-0.680$ to $R_1$; the worst-case error is 1.36% and the root-sum-square error is 0.96%.
:::
:::

::: example
## An amplifier has open-loop gain $A = 10^5$ and feedback $\beta = 0.01$. Its $A$ drops 20% as it warms. How much does the closed-loop gain change?

::: solution
1. **Sensitivity to $A$.** For $G = \frac{A}{1 + A\beta}$ it is
   $$\begin{aligned} S_A &= \frac{1}{1 + A\beta} \\ &= \frac{1}{1001} \\ &= 0.000\,999 \end{aligned}$$
2. **Change in gain.**
   $$\begin{aligned} \frac{\Delta G}{G} &\approx 0.000\,999 \times (-20\%) \\ &= -0.02\% \end{aligned}$$
3. **What the feedback does.** A 20% swing in the transistors becomes a 0.02% swing in the gain: the feedback divides it by $1 + A\beta$, about 1000.

**Answer:** the closed-loop gain changes by only about $-0.02\%$.
:::
:::

::: check
given: n = 2 | -1 | 0.5 | -0.5 | 3
answer: n
tolerance: 0.5%

## A quantity goes as $y = kx^{\given{n}}$. What is its sensitivity to $x$?

::: right
Right. For a power law the sensitivity is the exponent, {answer}.
:::

::: misses
- [-n] Check the sign: it's $\frac{x}{y}\frac{dy}{dx} = \frac{x}{kx^n} \cdot nkx^{n-1}$.
- [any] Not yet. Work out $\frac{x}{y}\frac{dy}{dx}$ for $y = kx^n$.
:::
:::

::: check
given: dR = 1 | 3 | 5; dC = -2 | 1 | 4
answer: -dR - dC
tolerance: 0.5%

## An RC filter's $R$ changes by {dR}% and its $C$ by {dC}%. By about what percentage does its corner $1/(2\pi RC)$ change?

::: right
Right. Each sensitivity is $-1$, so the corner moves by about {answer}%.
:::

::: misses
- [dR + dC] The corner goes as $1/(RC)$: larger parts lower it.
- [-dR + dC] Both parts are in the denominator, so both sensitivities are $-1$.
- [any] Not yet. Add $S_R\Delta R/R + S_C\Delta C/C$ with $S = -1$ for both.
:::
:::

::: check
given: dL = 1 | 2 | 5; dC = 2 | -3
answer: -0.5*(dL + dC)
tolerance: 0.5%

## An LC circuit's $L$ rises {dL}% and its $C$ changes by {dC}%. By about what percentage does its resonance $1/(2\pi\sqrt{LC})$ move?

::: right
Right. The sensitivities are $-\tfrac12$ each: {answer}%.
:::

::: misses
- [-(dL + dC)] The square root halves the effect.
- [any] Not yet. $f_0 \propto L^{-1/2}C^{-1/2}$.
:::
:::

::: check
given: R1 = 1 | 10 | 47; R2 = 4.7 | 22 | 33
answer: R1/(R1 + R2)
tolerance: 0.5%

## A divider has $R_1$ = {R1} kΩ on top and $R_2$ = {R2} kΩ below. What is the sensitivity of its output fraction to $R_2$?

::: right
Right. $\frac{R_1}{R_1 + R_2}$ = {answer}.
:::

::: misses
- [R2/(R1 + R2)] That's the output fraction itself.
- [any] Not yet. $H = \frac{R_2}{R_1 + R_2}$; work out $\frac{R_2}{H}\frac{dH}{dR_2}$.
:::
:::

::: check
given: A = 1000 | 100000; b = 0.01 | 0.1
answer: 1/(1 + A*b)
tolerance: 0.5%

## An amplifier has open-loop gain {A} and feedback fraction {b}. What is the sensitivity of its closed-loop gain $\frac{A}{1 + A\beta}$ to $A$?

::: right
Right. $\frac{1}{1 + A\beta}$ = {answer}: feedback shrinks the effect of $A$ by the loop gain.
:::

::: misses
- [1] That's without feedback. Differentiate $\frac{A}{1 + A\beta}$.
- [any] Not yet. $\frac{dG}{dA} = \frac{1}{(1 + A\beta)^2}$; multiply by $A/G$.
:::
:::

::: check
kind: parts
given: t1 = 1 | 5; t2 = 1 | 2; t3 = 0.5 | 5

## An amplifier's gain depends on three resistors, with sensitivities $-1$ to $R_1$, $1$ to $R_2$ and $0.25$ to $R_3$. Their tolerances are {t1}%, {t2}% and {t3}%.

::: part
answer: t1 + t2 + 0.25*t3
tolerance: 0.5%

### What is the worst-case error in $G$, in percent?

::: misses
- [t1 + t2 + t3] $R_3$'s sensitivity is only 0.25.
- [any] Add $|S|\times$ tolerance for each part, with $|S|$ = 1, 1 and 0.25.
:::
:::

::: part
answer: sqrt(t1^2 + t2^2 + (0.25*t3)^2)
tolerance: 0.5%

### What is the root-sum-square estimate?

::: misses
- [any] $\sqrt{\sum (S_it_i)^2}$.
:::
:::
:::

::: check
kind: derivation
vars: R1 = 1..20, R2 = 1..20

## Derive the sensitivity of a divider's output $H = \dfrac{R_2}{R_1 + R_2}$ to $R_2$.

::: step
answer: R1/(R1 + R2)^2

### Find $dH/dR_2$.
:::

::: step
answer: R1/(R1 + R2)

### Multiply by $R_2/H$ to get the sensitivity.
:::

::: right
Right. $S_{R_2}^H = \frac{R_1}{R_1 + R_2}$, always less than 1: the divider's output follows $R_2$ only partly.
:::
:::

::: explain
## Why is sensitivity, a relative measure, more useful to a designer than the plain derivative $dy/dx$?

::: model
Part errors are specified as percentages: a 1% resistor, a 5% capacitor. A plain derivative mixes units (hertz per ohm, volts per farad) and changes with the part's value, so it can't be compared between parts or reused when values change. Sensitivity divides out the units, so it answers the question the tolerance poses: a 1% change in this part moves the output by $S$ percent. Sensitivities of different parts can be compared directly to find which ones need tight tolerances, they add simply for products and quotients, and for the power laws common in circuits they're just the exponents. That makes worst-case and statistical tolerance estimates a matter of a short sum.
:::
:::

::: practice

::: check
given: R1 = 0.1..100; R2 = 0.1..100
answer: R1/(R1 + R2)
tolerance: 0.5%

## Sensitivity of $\frac{R_2}{R_1 + R_2}$ to $R_2$, with $R_1$ = {R1} and $R_2$ = {R2}?

::: misses
- [any] $\frac{R_1}{R_1 + R_2}$.
:::
:::

::: check
given: A = 100..1000000; b = 0.001..1
answer: 1/(1 + A*b)
tolerance: 0.5%

## Sensitivity of $\frac{A}{1 + A\beta}$ to $A$, for $A$ = {A}, $\beta$ = {b}?

::: misses
- [any] $\frac{1}{1 + A\beta}$.
:::
:::
:::
