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

From LTwiki-Wiki for LTspice
Line 1: Line 1:
LTspice supports parametric sweeps trough the .step directive
+
LTspice supports parametric sweeps trough the .step directive:
  
 
  .step param RLoad list 5 10 15
 
  .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 are very in-comprehensive when having more than 3-4 steps. A way of getting more comprehensible results the .measure directive can be used, to perform individual measurements in the circuit
+
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)
 
  .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
+
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
 
  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.

Revision as of 10:59, 7 March 2013

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.