PSpice Monte Carlo Analysis and Histograms

advertisement
PSpice Monte Carlo Analysis and Histograms
PSpice Monte Carlo Analysis
.MODEL <Model_Name> <Type_Name> (<Param_Scale> <Tolerance_Spec>)
<Model_Name> is user specified, e.g. RMOD or CMOD or LMOD
<Type_Name> is RES, CAP, IND, etc.
<Param_Scale> = "<Param_Name> = <Multiplier>"
<Param_Name> is R, C, L, etc.
<Multiplier> is a real number to scale the value, usually 1
<Tolerance_Spec> = "DEV/<Distribution_Name> <Tolerance> [%]"
<Distribution_Name> is UNIFORM or GAUSS
<Tolerance> is the real number tolerance value (can be %)
.MC <#_of_Runs> {AC|DC|TRAN} <Output_Value> <Function> [Option]
<#_of_Runs> needs to be less than or equal to 100 to use PROBE
<Output_Value> has same specification as a .PRINT statement
<Function> is YMAX, etc.
<Option> is generally OUTPUT(ALL)
Example:
Perform a Monte Carlo analysis on a simple, passive low-pass filter (see Fig. 14.29b in
Irwin Basic Engineering Circuit Analysis book) with a cut-off frequency of 1 Hz.
Solution:
Monte Carlo for Low-Pass Filter by Dr. Holbert
VS
1 0
AC
1 0
R1
C1
1 2
2 0
RMOD 0.5
CMOD 0.3183098
.MODEL RMOD RES (R=1 DEV/UNIFORM 5%)
.MODEL CMOD CAP (C=1 DEV/UNIFORM 10%)
.AC DEC 20 0.1 10
.MC 100 AC V(2) YMAX OUTPUT(ALL)
.PROBE V(2)
.END
Run PSpice simulator; it will analyze 100 cases. To display plot of Bode magnitude characteristic, run
PROBE. Select All_Ac_sweep, then Add_trace of variable of interest, i.e., VDB(2). Label axis and print
hard copy.
Histograms
Important: You will need PSpice version 5.3 or greater to create histograms.
To create a histogram from within PROBE, begin by removing any pre-existing trace(s). Note that
PROBE is limited to 100 runs for plotting. Select the following menu options: (select All_Ac_sweep, if you
have not already done so), X_axis, then Performance_analysis, then Add_trace, and lastly choose a goal
function to evaluate, e.g., CutoffFreq(VDB(2),3). If there are no goal functions to choose from, you may
PspiceMC.doc
EEE 350
Page 1 of 2
need (depending on your specific PSpice version) a PROBE.GF file (could copy MSIM.GF) so that the goal
functions are available, e.g. CenterFreq(VDB(#),3) and Bandwidth(VDB(#),3).
X_Axis Menu - histograms under Performance_analysis
Histograms are used to display the results of Performance Analysis applied to a set of PSpice Monte Carlo
simulations. The only way to get histograms in Probe, is to do Performance Analysis on a set of PSpice
Monte Carlo simulations. Performance Analysis on other sets of PSpice simulations (such as multiple
temperatures or a .STEP of a parameter) results in a continuous trace rather than a histogram.
Histograms are "vertical" bar charts that show the number of occurrences of an event during each of several
divisions of the Y variable. Thus, the X axis becomes divisions of the Y variable, and the Y axis becomes
the number_of_occurrences. In Performance Analysis, the goal function value calculated from each Monte
Carlo run is an occurrence.
Only one histogram is allowed per plot. If Add_trace is used to add a second histogram, the existing
histogram is automatically deleted before the new histogram is displayed.
X_Axis Menu - Options controls the number of divisions that the X axis is divided into, and whether or not
the histogram statistics are displayed.
Exit returns you to the Axis Menu.
Histogram_divisions allows you to specify the number of divisions for the histogram.
Show_histogram_statistics turns on the display of the histogram statistics, and is the default. If the
histogram
statistics are already displayed, they can be turned off by selecting
Do_not_show_histogram_statistics. The statistics that are displayed are as follows:
n samples
the number of Monte Carlo runs that PSpice executed.
n divisions
the number of divisions that the X axis is divided into to create the histogram (i.e.,
the number of vertical bars that make up the histogram).
mean
the arithmetic average of all the goal function values.
sigma
the standard deviation.
minimum
the minimum goal function value.
10th percentile a number representing goal function values such that 10% of the goal function
values are less than or equal to the number, and also at least 90% of the goal
function values are greater than or equal to the number. If there is more than one
goal function value that satisfies this criteria, then the 10th percentile will be the
midpoint of the interval between the goal function values that satisfy the criteria.
median
same as 10th percentile, except for 50%.
90th percentile same as 10th percentile, except for 90%.
maximum
PspiceMC.doc
the maximum goal function value.
EEE 350
Page 2 of 2
Download