Monte Carlo Yield Analysis
Real components have manufacturing tolerances. A resistor labeled “10k” might be anywhere from 9.5k to 10.5k (5% tolerance). Monte Carlo analysis simulates your circuit hundreds of times with randomized component values to see how often the design meets spec.
Determine whether an RC lowpass filter with 5% resistors and 10% capacitors reliably hits a 10 kHz bandwidth target.
Workflow
Section titled “Workflow”-
Define the circuit
Start with a known-good netlist. You can generate one with
create_from_template:{"template_name": "rc_lowpass","params": {"r": "1.59k", "c": "10n"}}Read the generated
.cirfile content for the next step. -
Run Monte Carlo
Use the
monte_carlotool with component tolerances:{"netlist_text": "* RC Lowpass\nV1 in 0 AC 1\nR1 in out 1.59k\nC1 out 0 10n\n.ac dec 100 1 1meg\n.end","n_runs": 100,"tolerances": {"R1": 0.05,"C1": 0.10},"seed": 42}This runs 100 simulations, each time varying R1 by up to +/-5% and C1 by up to +/-10% using a normal distribution.
-
Analyze results
The tool returns per-run
.rawfile paths. For each run, usemeasure_bandwidthto get the -3dB frequency, then compute statistics across all runs:- Mean bandwidth
- Standard deviation
- Min / max range
- Yield: percentage of runs where bandwidth falls within your spec window (e.g., 8 kHz to 12 kHz)
-
Interpret
With 5% resistors and 10% capacitors, expect roughly +/-15% variation in cutoff frequency (tolerances add in quadrature for an RC product). If yield is too low, consider tighter-tolerance components or a design with more margin.
Key takeaway
Section titled “Key takeaway”Monte Carlo analysis answers “will this design work in production?” rather than “does it work with ideal components?” Running 100 iterations typically takes under 30 seconds since each AC simulation is fast. For high-confidence yield estimates, use 500+ runs.