Running Monte Carlo analysis using a script

This page describes how to generate and run a Monte Carlo analysis using script commands. The Monte Carlo analysis tool allows users to run extensive Monte Carlo analysis, sweeping across multiple parameters. This can be useful for assessing statistical variations of circuit elements on overall circuit performance, as well as the effects of variations in component-level simulations. The same example used in the section "Monte Carlo analysis" will be re-generated in this page. For additional information and detailed implementation of the script commands, please see the "Measurement and optimization data" section. Please note that, all the script commands used in this example could also be applied to sweep and optimization analyses.

To generate and run the Monte Carlo analysis using script commands, user can open the
run_monte_carlo.icp
file and follow the three steps listed below; or, open and run the script file
run_monte_carlo_script.lsf
.

After the Monte Carlo analysis object is superficially generated, the parameters can then be defined and added to it. The following commands define two coupling coefficient parameters (cpl_2 and cpl_3) and add them to the Monte Carlo analysis object "MC_script" in the "Parameters" tab.

Please note that, the parameter's properties "Distribution", "Process" and "Mismatch" are also defined as "struct"s since variety of sub-properties is defined in these single properties. After the parameters are successfully set, the Monte Carlo analysis will appear in the "Optimizations and Sweeps" tab as shown in the figure below:

The next step is to add the results (free spectral range, bandwidth and gain) to this Monte Carlo analysis. The commands listed below add the results to the Monte Carlo analysis object as shown in the editing window below.

Running the Monte Carlo analysis

The Monte Carlo analysis runs the trials in batches of 10 or less and automatically updates the analysis status window after each batch of trials. After the Monte Carlo analysis has been run, the parameters and results are listed at the right-hand side of the window. The following command runs the yield analysis "MC_script" and loads the result to it. After the yield analysis has been run, the analysis process and the results will be shown in the "Monte Carlo analysis status" window as shown below.

# run the Monte Carlo analysisrunsweep(MC_name);

Close the "Monte Carlo analysis status" window and all the results will be shown in the Result View window.

Viewing the results

The Monte Carlo analysis results could also be plotted by using script commands. The commands below retrieve and plot the free spectral range histogram and probability density function.