John Kustin
06/02/2021, 4:59 PM.option SEED=random
.option temp=27
.tran 1n 11u
.option temp=0
.tran 1n 11u
.option temp=70
.tran 1n 11u
.control
let run=1
dowhile run <= 400
let randomseed = $rndseed
if run > 1
reset
set appendwrite
end
save all
run
write TESTTYPENAMEHERE_mc1_70degc_run_{$&run}.raw vbg randomseed
setplot tran2
write TESTTYPENAMEHERE_mc1_0degc_run_{$&run}.raw vbg randomseed
setplot tran1
write TESTTYPENAMEHERE_mc1_27degc_run_{$&run}.raw vbg randomseed
let run = run + 1
end
but only the transient sim at 70degC is being run (i always seeĀ Doing analysis at TEMP = 70.000000 and TNOM = 27.000000
).
edit: this script is still running in ngspice, so i don't know for sure if the 2 other temperatures were not simulated. i'd exepect every .tran
statement to be run
I also tried
.option SEED=random
.control
let run=1
option SEED=random
let indexvec = unitvec(400) * $rndseed
let randomseedvec = rnd(indexvec)
dowhile run <= 400
if run > 1
reset
set appendwrite
end
save all
set temp=27
option SEED=randomseedvec[$&run-1]
tran 1n 11u
set temp=0
option SEED=randomseedvec[$&run-1]
tran 1n 11u
set temp=70
option SEED=randomseedvec[$&run-1]
tran 1n 11u
write TESTTYPENAMEHERE_mc1_70degc_run_{$&run}.raw vbg
setplot tran2
write TESTTYPENAMEHERE_mc1_0degc_run_{$&run}.raw vbg
setplot tran1
write TESTTYPENAMEHERE_mc1_27degc_run_{$&run}.raw vbg
let run = run + 1
end
but I realized this is not what I want to achieve since I set the seed 3 times, when I just want it to be set once (also, ngspice complains about setting the seed more than once)
edit: could I just pick 1 seed value and use that across 3 separate spice testbenches, where each testbench handles 1 temperature? the ngspice manual does say that setting the seed value will determine a sequence of pseudo random numbers. so if each simulation uses the same numbers in that sequence, then this should achieve what i want?