Difference between revisions of "Parametric plot (plot measurements in relation to a swept parameter)"

From LTwiki-Wiki for LTspice
 
Line 20: Line 20:
  
 
  [[File:LTspice parametric plot.png|1200px|thumb|left|Example of a parametric sweep and parametric plot]]
 
  [[File:LTspice parametric plot.png|1200px|thumb|left|Example of a parametric sweep and parametric plot]]
 +
 +
{{#widget:DISQUS
 +
|id=ltwiki
 +
|uniqid={{PAGENAME}}
 +
|url=http://ltwiki.org/index.php5?title=Parametric_plot_(plot_measurements_in_relation_to_a_swept_parameter)
 +
}}

Latest revision as of 14:35, 16 April 2015

LTspice supports parametric sweeps trough the .step directive:

.step param RLoad list 5 10 15

which performs three simulations with the global parameter RLoad being 5, 10 and 15. The simulation will return three results, which can be plotted in relation to time or frequency, depending on the type of analysis (transient or AC analysis). But this way of displaying the results is very incomprehensible when having more than 3-5 steps, as the results visually stacks on each other. A way of getting more comprehensible results the .measure directive can be used to perform individual measurements in the circuit:

.measure I_RLload AVG I(RL)

which returns the average current trough the resistor RL. The results of the defined measurements are printed in the "SPICE Error Log" and can be extracted from this log file.

View -> SPICE Error Log

But LTspice actually also supports Parametric plots, which is achieved by right clicking on the open "SPICE Error Log" and selecting "Plot .step'ed .meas data":

SPICE Error Log -> Right click -> Plot .step'ed .meas data

Now the measurements are plotted in relation to the swept parameter, giving a much more compressed and clear visualization of the results, enabling the user to understand the circuit dependencies of the swept parameter. Furthermore the measurements can now be exported from the Parametric plot, to a more useful format than the "SPICE Error Log":

File -> Export
Example of a parametric sweep and parametric plot

blog comments powered by Disqus