¿ªÔÆÌåÓý

Re: Monte Carlo


 

--- In LTspice@..., Panama Mike <panamatex@y...> wrote:
Brian,

Anyone got a way of doing a monte carlo run (AC or AC sweep)
using the resistor and capacitance tolerances?
Those tolerances are just for the bill of material, like
the partnumber and mfg.

About as close as you can get to doing Monte Carlo in LTspice
is with parameterized curly brace expressions using the rand()
function. Attached is an example.
Hello Mike,
I like your example. Could you put it into the Example&#92;Educational
folder of LTSPICE?

Only one correction of this schematic.

> SYMATTR Value {1n*(1+a*(rand(x+600)-.5))}
> !.param a=.2 ; 20% component tolerance

This line should have the comment 10% and not 20% for the used
formula {1n*(1+a*(rand(x+600)-.5))}) .

The reason is the used function (rand(x+400)-.5)) gives only
values from -0.5 to +0.5 .

Normally we always have +/-tolerance of passive components. If a
component is specified with 10% tolerance, then it has a tolerance of
+/-10%.


We could also adjust the formula by a factor of 2 instead.
> SYMATTR Value {1n*(1+2*a*(rand(x+600)-.5))}
Now we will get +/-20% tolerance for a = 0.2 .

Best Rgeards
Helmut

Join [email protected] to automatically receive all group messages.