Home > Community > Forums > Custom IC SKILL > Several Problems on Monte Carlo Analysis using OCEAN

## Email

Recipients email * (separate multiple addresses with commas)

Message *

 Send yourself a copy

## Subscribe

Intro copy of the newsletter section here, some intro copy of the newsletter. Instruction of how to subscribe to this newsletter.

First Name *

Last Name *

Email *

Company / Institution *

 Send Yourself A Copy

# Several Problems on Monte Carlo Analysis using OCEAN

Last post Mon, Jul 1 2013 7:50 PM by winever. 2 replies.
 Started by winever 29 Jun 2013 01:16 AM. Topic has 2 replies and 701 views
• #### Sat, Jun 29 2013 1:16 AM

• winever
• Joined on Fri, Jun 28 2013
• NanJing, Jiangsu
• Posts 17
• Points 235
Several Problems on Monte Carlo Analysis using OCEAN
 Hi, everybody!I have several problems on Monte Carlo Analysis using OCEAN. Hope somebody can give me a hand. I really appreciate it.The first problem is how to specify a seed when doing Monte Carlo analysis. I tried the command monteCarlo( ?seed "2" ?numIters "3" ...) and the Monte Carlo analysis ran successfully. But I am not sure whether it is right, because in the OCEAN reference, the monteCarlo() command do not have an argument like ?seed "2".  By the way, what should be taken into consideration when choosing the value of the seed?  Can I choose it arbitrarily?The second problem is how to select and process the result of certain run of a Monte Carlo analysis. For example, after a Monte Carlo analysis is done, I get some files, such as ac.ac , mc1-001_ac.ac , mc1-002_ac.ac , mc1-003_ac.ac and so on. How can I select the result of certain run? Say, the result of the first iteration. I tried the command selectResult( 'ac ) , and then plot() , but three curves were plotted corresponding to the three iterations of Monte Carlo analysis. Then I tried the command  selectResult( "ac-ac" ) , and then plot() , only the result of the nominal run before the Monte Carlo analysis was plotted.The third problem is that can I run an analysis using the input.scs. If the answer is yes, how can I do it? It seems that the input.scs is similar to the .sp file in Hspice. So I guess it can be used to run an analysis. However, I tried the command spectre input.scs ,and it ran successfully. But no result was plotted or saved. Even the psf file was not created.  Regards,Winever.
• Post Points: 20
• #### Mon, Jul 1 2013 8:00 AM

Re: Several Problems on Monte Carlo Analysis using OCEAN
 Winever,First of all, you really should not need to set the seed for monte carlo. It has a default seed, intended to give you the same results if you run the same circuit multiple times. It can be set in IC61X easily - in IC5141 if you desperately want to set it you'd have to use:envSetVal("asimenv.monte" "seedValue" 'string "232") ; the default is "1".I think you probably need to do this before the simulator() statement in your OCEAN script.To get to the results of a particular iteration, you can do:value(v("/out" ?result 'ac) 'iteration 2)For example. This is assuming that you've turned on the option to save family data (because otherwise it doesn't keep all the waveforms). You must use the "aliased" name of the analysis output (e.g. "ac" rather than "ac-ac") otherwise you will indeed get the nominal results. There's coverage of this in the documentation - you typically need to type:results()and compare withresults(?noAlias t)The results browser in IC5141 used to show the unaliased names - but for monte carlo you need to use the aliase names to get the result with variation. In IC615 (from ISR3 onwards), the results browser now shows the aliased name, which is better.You can run spectre from the command line - using "spectre input.scs". It will produce the output database, but by default will call it "input.raw" (i.e. whatever the input file name is, with the suffix removed, and ".raw" added instead). You can alter that by doing (say):spectre -raw ../psf input.scsto tell it to put the results elsewhere.Regards,Andrew.
• Post Points: 20
• #### Mon, Jul 1 2013 7:50 PM

• winever
• Joined on Fri, Jun 28 2013
• NanJing, Jiangsu
• Posts 17
• Points 235
Re: Several Problems on Monte Carlo Analysis using OCEAN
 It really works, Andrew. Thank you so much for help me a lot. I really appreciate it. Best regards,Winever.
• Post Points: 5
###### Sort Posts: Oldest to newest Newest to oldest
 Started by winever at 29 Jun 2013 01:16 AM. Topic has 2 replies.