Advanced SIMPLIS Training / Module 3 - Getting Ready to Model |
The SIMPLIS Monte Carlo analysis allows you to delve further into a design and see how the design responds to statistical parameter variation. Parameters can also be matched, where two parameter values will track each other every simulation run. Finally, the Monte Carlo log file outputs the actual parameter values used in the simulation and the seed value so that simulation can be repeated.
To download the examples for Module 3, click Module_3_Examples.zip
In this topic:
This topic addresses the following key concepts:
In this topic, you will learn the following:
The SIMPLIS Monte Carlo Analysis is similar to the SIMPLIS Mutli-Step Analysis except instead of stepping a parameter, the Monte Carlo seed value is stepped. The seed value is used to determine the values of each statistical distribution function used in the design. If no statistical distribution functions are used in the circuit, each seed value will produce the same simulation results.
There are three statistical distribution functions for use in the SIMPLIS Monte Carlo Analysis, Gauss(), GaussTrunc(), Unif(), and Wc(). Each of these functions has a different numerical return value when the function is called. The table and histograms pictured below describe each function. The histograms were generated with tol=0.1, or 10%, a mean value of 1, with 10,000 steps (runs), and 50 histogram bins.
Function | Meaning | Histogram |
Gauss(tol) |
Gaussian. Returns a random with a mean of 1.0 and a standard deviation of tol/3. Random values have a Gaussian or Normal distribution. Important: The Gauss() function can return values greater than
(1 + tol) and less than (1 - tol). This becomes particularly important
when you are using a large tolerance, as the return value may be outside
of a reasonable range. To use a truncated Gaussian distribution, see
GaussTrunc() below.
|
|
GaussTrunc(tol) |
Truncated Gaussian. As with Gauss() but values greater than (1 + tol) and less than (1 - tol) are rejected, and the program picks another random number inside the Gaussian distribution. |
|
Unif(tol) | Uniform. Returns a random value in the range 1.0 +/- tol with a uniform distribution. | |
WC(tol) | Worst-Case. Returns either 1.0-tol or 1.0+tol chosen at random. |
You assign statistical distribution functions to component values like any other parametrized value. The statistical distribution function and the nominal value must be enclosed in the curly braces {}, indicating the value is an expression to be evaluated. For example, a 1k Ω, 5% resistor with a Gaussian distribution was a value of:
{1k*Gauss(0.05)}
Every Monte Carlo step, the Gauss(0.05) function will return a value with a Gaussian distribution, which is then multiplied by the nominal value and the resistor is assigned this numerical result. On voltage sources and a few other dialogs, you must use the literal property editing dialog to enter text values enclosed in curly braces. In the next exercise you will edit the value of the input voltage source, V1 using the literal property editing method.
There are times when you may want to have multiple component values which match or track each other. In the SIMPLIS Monte Carlo analysis, this is accomplished by first assigning a variable statement to depend on a statistical distribution function, then using that variable to parametrize the individual matching components. This "master" variable is evaluated once - from then on, the value is constant.
One place where this comes in useful is for PWL inductors, such as L4 in this example circuit. This inductor is used to model the magnetizing inductance of the transformer including saturation effects. In the next exercise you will verify that the inductance of each segment of the inductor L4 is varied in proportion to a Gaussian distribution function.
.var L4_Tol={Gauss(0.20)} { '*' } { '*' } L4's tolerance : {L4_Tol} { '*' }The first line assigns the return value of the Gauss(0.20) function to the variable L4_Tol, which is in turn, used to parametrize each y-axis point for L4. The other three lines were purposely placed in the F11 window to allow us to easily see the value returned by the Gauss(0.20) function. Each line is a comment, with the middle line also displaying the value of L4_Tol.
Piecewise Linear Inductors, such as L4 in this example, are implemented with a .MODEL statement, which in this case, starts on line #50. The PWL points are listed as X,Y pairs starting at X0 and Y0. Notice the X values have the same numerical values you saw in the dialog. The Y-values are all multiplied by the constant value L4_Tol. The L4_Tol is constant because the value is evaluated once per Monte Carlo run, and from that point onwards, the same constant value is used in the expressions for L4_Tol. The value of L4_Tol will almost certainly be different for the next Monte Carlo simulation step.
The value of the L4_Tol variable is 1.0696640600968, which represents a 6.97% increase in inductance values. Calculating the change in inductance is left as an independent study exercise.
As with the SIMPLIS_Multi Step Analysis the SIMetrix/SIMPLIS Pro and Elite licenses can use multiple processor cores to simulate the Monte Carlo steps in parallel. Using multiple cores allows multiple step values to be simultaneously simulated, and the simulation time to be reduced. The number of cores allowed by the licenses are:
License | Number of Physical Cores |
Pro | 4 |
Elite | 16 |
In addition to the maximum number of cores allowed by your license, you are obviously limited by the number of cores your computer has. For this limitation, SIMetrix/SIMPLIS only uses the physical cores, not the hyper-threaded cores. In the next exercise you will run a multi-core, multi-step simulation.
This exercise assumes your computer has more than one physical core and that you are using a SIMetrix/SIMPLIS Pro license.
SIMetrix/SIMPLIS has an extremely powerful histogram plotting function. In the last exercise, you executed 32 simulations to get a valid statistical sample, and the histogram plotting functions requires a minimum of 16 runs. In the next two exercises you will plot the histogram for the converter switching frequency.
Plotting histograms is different from plotting time domain curves because the histogram function is expecting a single measured value per Monte Carlo step. Compare this to plotting the converter output voltage after a transient simulation - there may be 10,000 points in the output voltage vector, each one representing the voltage at a particular simulation time. If you were to average the output voltage over the simulation time span, you would have just one measurement per Monte Carlo step. This is exactly what a histogram is - the frequency of a particular scalar measurement over a statistical sample.
Therefore, every histogram will require a function to operate on the voltage or current, and this function must return a single scalar value for each Monte Carlo step. For the above mentioned example, the function used to return the average value of a voltage or current from a time-domain simulation is Mean1(). For this example you will plot the frequency of the converter frequency using the Frequency() function.
The log file is automatically created as a plain text file which can be opened in a spreadsheet program or otherwise machine parsed. A human-readable log file can be viewed using the
. A sample log file appears as follows:Behind the scenes, a pseudo-random number generator is used to generate the Monte Carlo seed values. The seed values are used by each statistical probability function to generate the function return value. As a result, a particular Monte Carlo step can be repeated if you know the seed number used for that step, and the circuit has not changed at all between the first and second runs.
In the next exercise you will find the run with the lowest frequency and it's seed number, then repeat a simulation using the seed value.
On the waveform viewer window:
Curve name: Inductor Current (simplis_pop_primary_1_1)
Source group: simplis_pop_primary_1_1
Curve id : 17
Run number : 22
In this exercise, you have found the run number which produced the lowest converter switching frequency. In the next exercise, you will find the seed value and the simulated parameter values from the Monte Carlo Log file.
You now know that run number 22 produced the lowest switching frequency. To find the seed value which corresponds to this run number, you open the Monte Carlo Log file. To open the Monte Carlo Log file, follow these steps:
Note the seed value 1988583953 which was used for this run. In this converter, the switching frequency is highly dependent on the inductance value. Not unexpectedly, the evaluated parameter value for the inductance is higher than the default value, which requires longer charging and discharging times, and hence a lower switching frequency results.
In the next exercise, you will run a single step simulation using the same parameter values which generated the lowest frequency simulation run. You do this by running a Monte Carlo simulation using the seed value found in this exercise.
All actions described in this topic can be automated using the Design Verification Module (DVM). For example, the input voltage source value can be modified to use a statistical distribution function before launching a Monte Carlo simulation. DVM then launches the Monte Carlo simulation and as an additional feature, captures the fixed probe measurements and saves these measurements to a HTML formatted report file.
In this exercise you will run a 32 step Monte Carlo simulation using DVM and as in exercise #5 you will determine the worst case minimum switching frequency. As discussed in the SIMPLIS Mutli-Step Analysis, DVM requires a prepared schematic and a testplan. The schematic used in the previous topic will also work for DVM Monte Carlo, so the only other item is the testplan. A testplan with a single Monte Carlo test is shown below. The single test takes the schematic, changes the V1 value to {310*Unif(0.0333)}, and launches the Monte Carlo test with the values the user entered in the DVM Control Panel.
*** | ||
*** 3.2_monte_carlo_basic.testplan | ||
*** | ||
*?@ Analysis | Change( V1.VALUE , {Vin} ) | Label |
*** | ||
MonteCarlo | {310*Unif(0.0333)} | DVM Monte Carlo |
To run a DVM Monte Carlo simulation, follow these steps:
The Monte Carlo DVM Report contains all the seed, parameter, and scalar measurement data taken from the simulation run. This table shows the seeds and measured values.
Note that run #22 is the simulation with the lowest frequency. It should be pointed out that DVM doesn't produce different results than a ordinary SIMPLIS Monte Carlo simulation. Instead, DVM automates the process of setting up the schematic and collecting the results into a HTML formatted report.