To speed up the process, you may want to use Claude cowork to run the batch using Python which Claude will make one for you automatically.
Interesting result — the MNA contradicts the React optimizer. Let me sweep mirror mismatch to show what's going on:The MNA disagrees with the optimizer by oo dB. Here's why:
analytic (React) MNA (full nodal solve)
|Ad| 1286.7 1293.4
|Acm| 3.50×10⁻⁵ 1.70×10⁻³
CMRR (dB) 151.30 117.65
← 34 dB lower
Root cause: PNP mirror β-error, which the React formula completely omits.
The textbook expression Acm = 1/(2·gm·R_tail) assumes a perfect mirror — gain exactly 1. Real PNP mirrors lose 2/(β+2) of the reference current to base currents. With β_p ≈ 106:
δ_β = 2/(β+2) = 1.84%
Predicted Acm from β-loss: δ·Rout/(2·R_tail) = 1.66×10⁻³
Observed Acm (MNA): 1.70×10⁻³
→ β-error explains 98.1% of the actual CM gain
The tail-impedance term (3.5×10⁻⁵) is real but it's the floor, not the dominant contributor. The mirror β-error is 48× larger and sets the actual CMRR.
Mirror Is-mismatch sweep confirms the mechanism — there's an asymmetric peak where Is mismatch cancels β-loss:
ΔIs/Is CMRR
−5% 106.5
−2% 111.5
0% 117.7 ← matched (β-loss alone)
+1% 123.8
+2% 155.7 ← cancellation peak (Δ_Is exactly = δ_β)
+3% 123.5
+5% 114.2
That sharp 156 dB peak at +1.84% is real but useless — it's a single bias-trim point. Process variation puts every die somewhere else on the curve.
Monte Carlo with realistic process σ (0.5% Is, 1% β):
CMRR mean = 119.4 dB
CMRR median = 117.5 dB
CMRR p10 = 112.8 dB
CMRR p90 = 127.4 dB
CMRR std = 7.3 dB
Verdict on the optimizer's CMRR numbers: systematically optimistic by ~33 dB. The 117–120 dB result is in line with what real BJT diff pairs with active loads achieve (LM394: 120 dB typ; MAT02: 124 dB typ — both trimmed). The optimizer's 151 dB was the textbook ceiling for an idealized topology, not what the topology actually delivers.
Two-line fix for the React calcPerf:
const deltaBeta = 2 / (bp + 2); // mirror β-loss
const Acm_beta = deltaBeta * Rout / (2 * RoTail);
const AcmTotal = Math.hypot(AcmLin, Acm_beta); // RMS combine
const CMRR = 20 * Math.log10(AdLin / AcmTotal);
That alone pulls the reported CMRR from 151 to ~118 dB and aligns it with what an MNA — or a real chip — would show.






































