¿ªÔÆÌåÓý

Re: Monte Carlo


 

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.

--Mike

--- MonteCarlo.asc ---
Version 4
SHEET 1 1268 692
WIRE -512 368 -512 336
WIRE -512 256 -512 240
WIRE -512 240 -400 240
WIRE -112 240 -48 240
WIRE 880 240 880 272
WIRE 880 336 880 368
WIRE 800 240 800 272
WIRE 800 352 800 368
WIRE 800 240 880 240
WIRE -48 240 -48 272
WIRE -48 336 -48 368
WIRE -112 240 -112 272
WIRE -112 352 -112 368
WIRE -48 240 160 240
WIRE -320 240 -112 240
WIRE 1200 368 1200 352
WIRE 1200 272 1200 240
WIRE 1200 240 880 240
WIRE 240 240 528 240
WIRE 592 240 800 240
FLAG 880 368 0
FLAG -512 368 0
FLAG 800 368 0
FLAG -48 368 0
FLAG -112 368 0
FLAG 1200 368 0
SYMBOL cap 864 272 R0
SYMATTR InstName C1
SYMATTR Value {1n*(1+a*(rand(x+600)-.5))}
SYMBOL voltage -512 240 R0
SYMATTR InstName V1
SYMATTR Value AC 1
SYMBOL ind 816 256 M0
SYMATTR InstName L1
SYMATTR Value {10u*(1+a*(rand(x+500)-.5))}
SYMBOL cap -64 272 R0
SYMATTR InstName C2
SYMATTR Value {1n*(1+a*(rand(x+100)-.5))}
SYMBOL ind -96 256 M0
SYMATTR InstName L2
SYMATTR Value {10u*(1+a*(rand(x)-.5))}
SYMBOL res -304 224 R90
WINDOW 0 0 56 VBottom 0
WINDOW 3 32 56 VTop 0
SYMATTR InstName R1
SYMATTR Value 100
SYMBOL res 1184 368 M180
WINDOW 0 36 76 Left 0
WINDOW 3 36 40 Left 0
SYMATTR InstName R2
SYMATTR Value 100
SYMBOL ind 256 256 M270
WINDOW 0 32 56 VTop 0
WINDOW 3 5 56 VBottom 0
SYMATTR InstName L3
SYMATTR Value {20u*(1+a*(rand(x+300)-.5))}
SYMBOL cap 592 224 R90
WINDOW 0 0 32 VBottom 0
WINDOW 3 32 32 VTop 0
SYMATTR InstName C3
SYMATTR Value {500p*(1+a*(rand(x+400)-.5))}
TEXT -264 504 Left 0 !.ac oct 100 300K 10Meg
TEXT 160 488 Left 0 !.step param X 0 20 1
TEXT 160 464 Left 0 !.param a=.2 ; 20% component tolerance


__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more

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