examples Monte_Carlo, replace variable rndseed by function setseed

This commit is contained in:
h_vogt 2016-08-06 21:22:17 +02:00 committed by rlar
parent d8a6e11d56
commit bff1b9b6c5
3 changed files with 12 additions and 12 deletions

View File

@ -20,8 +20,8 @@
* without the reset switch there is some strange drift
* towards lower and lower frequencies
reset
set run ="$&run" $ create a variable from the vector
set rndseed = $run $ set the rnd seed value to the loop index
set run = $&run $ create a variable from the vector
setseed $run $ set the rnd seed value to the loop index
source MC_2_circ.sp $ load the circuit, including model data
tran 15p 200n 0
write mc_ring{$run}.out buf $ write each sim output to its own rawfile

View File

@ -22,9 +22,9 @@ begin
let halfffts = unitvec(mc_runsp)$ vector for storing measure results at -40dB rising
unlet mc_runsp
set mc_runs ="$&mc_runs" $ create a variable from the vector
set mc_runs = $&mc_runs $ create a variable from the vector
let seeds = mc_runs + 2
set rndseed = "$&seeds"
setseed $&seeds
unlet seeds
echo source the input file
@ -44,7 +44,7 @@ begin
dowhile run <= mc_runs
set run ="$&run" $ create a variable from the vector
set run = $&run $ create a variable from the vector
* run=0 simulates with nominal parameters
if run > 0
@ -52,7 +52,7 @@ begin
echo * * * * * *
echo Source the circuit again internally for run no. $run
echo * * * * * *
set rndseed = $run
setseed $run
mc_source $ re-source the input file
else
echo run no. $run
@ -136,7 +136,7 @@ else
* put data into the correct bins
let run = 0
dowhile run < mc_runs
set run = "$&run" $ create a variable from the vector
set run = $&run $ create a variable from the vector
let val = maxffts[{$run}]
let part = 0
* Check if val fits into a bin. If yes, raise bin by 1

View File

@ -74,9 +74,9 @@ cout buf ss 0.2pF
let halfffts = unitvec(mc_runsp)$ vector for storing measure results at -40dB rising
unlet mc_runsp
set mc_runs ="$&mc_runs" $ create a variable from the vector
set mc_runs = $&mc_runs $ create a variable from the vector
let seeds = mc_runs + 2
set rndseed = "$&seeds"
setseed $&seeds
unlet seeds
save buf $ we just need buf, save memory by more than 10x
@ -90,7 +90,7 @@ cout buf ss 0.2pF
dowhile run <= mc_runs
set run ="$&run" $ create a variable from the vector
set run = $&run $ create a variable from the vector
* run=0 simulates with nominal parameters
if run > 0
@ -98,7 +98,7 @@ cout buf ss 0.2pF
echo * * * * * *
echo Source the circuit again internally for run no. $run
echo * * * * * *
set rndseed = $run
setseed $run
mc_source $ re-source the input file
else
echo run no. $run
@ -182,7 +182,7 @@ else
* put data into the correct bins
let run = 0
dowhile run < mc_runs
set run = "$&run" $ create a variable from the vector
set run = $&run $ create a variable from the vector
let val = maxffts[{$run}]
let part = 0
* Check if val fits into a bin. If yes, raise bin by 1