i am through this issue: i have to run montecarlo simulations with a trimming process: each montecarlo simulation must run at least twice in order to verified the results after trimming.
I could not find how to run just the ith montecarlo simulation
The script flow should be as folows:
run ith montecarlo sim
set the trimmed parameter
re-run ith montecarlo sim
check the results
I did it with another design kit but with AMS technology (Austriamicrosystems) i don't know how to do it.
I am using IC5.10.41.
Thanks a lot.
In OCEAN, you'd use the monteCarlo(?numIters 1 ?startIter N) function, where N is the iteration number. So, something like this:
for(N 1 100 monteCarlo(?numIters 1 ?startIter N) monteRun() ; analyze the results and then do your trimming: desVar("..." ...) monteRun() ;analyze the results again and collect the final data)
In IC615 (in IC614 as an engineering feature) we have a new capability called "pre run scripts" in ADE XL which allow you to do this directly in ADE XL during monte carlo.
In reply to Andrew Beckett:
it works percfectly.
the script i wrote works fine but i get these warnings:
*WARNING* hiCreateForm: ** phase_margin_25_upper ** illegal duplicate field
symbol in list of fields*WARNING* hiCreateForm: ** phase_margin_25_lower **
illegal duplicate field symbol in list of fields*WARNING* hiCreateForm: **
phase_margin_25_limits ** illegal duplicate field symbol in list of
fields*WARNING* hiCreateForm: ** phase_margin_25 ** illegal duplicate field
symbol in list of fields
the number they are printed on the screen increase every montecarlo.
it is just curiosity: what they are saying ?
thanks a lot
In reply to LucaPico:
You're probably seeing the same issue as solution 11487734 that I wrote a while back. You're probably redefining the monteExpr() inside your loop, and each time you call monteExpr it adds to the previous expressions, and does not replace them. You'd also see this replication if you call monteResults() after the simulation. So either do not define the monteExpr inside the loop, or use delete('monteExpr) before you define them each time.
your solution works fine. Many thanks.
I have another issue on the same script.
It happened that some montecarlo simulations do not converge and the script does not proced because of error in the fprintf data type.
when this happens it writes in the log file ERROR
To prevent the script from stopping, I am doing this way (i found it the easiest way):
while((check !="ERROR") || (check != "EOF")
fscanf(file_port "%s" check)
if(check == "ERROR")
but when i put the (check != "EOF") statement in the while loop it goes in infinte loop (because in the first montecarlo simulation i run, there is no error).
i think the log file i am pointing to is not closed or i am putting the wrong string for detecting the end of the file.
Thanks a lot again
i have another issue with montecarlo simulations
if I am running for example for(mc_index 1 5....and find some problems in the 4th simulationThen I write for(mc_index 4 5... to run just the 4th and the 5thbut i got different results for the 4th run
probably different seeds have been taken
i also set the random seed with srandom() but never changed.