Monte Carlo Methods
Estimate quantities by random sampling — tolerance analysis, risk, integrals.
Intermediate
rng = np.random.default_rng(0)
R1 = rng.normal(10e3, 10e3 * 0.05 / 3, 100_000) # 5% resistors
R2 = rng.normal(10e3, 10e3 * 0.05 / 3, 100_000)
vout = 5 * R2 / (R1 + R2)
np.percentile(vout, [0.1, 99.9]) # worst-case spread
Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.
Discussion (0)
Sign in or join free to ask questions and discuss this topic.