Difference between revisions of "Simulation Command"

From LTwiki-Wiki for LTspice
Line 2: Line 2:
 
  .tran <Tstep> <Tstop> [Tstart [dTmax]] [modifiers]
 
  .tran <Tstep> <Tstop> [Tstart [dTmax]] [modifiers]
 
  .ac <oct, dec, lin> <Nsteps> <StartFreq> <EndFreq>
 
  .ac <oct, dec, lin> <Nsteps> <StartFreq> <EndFreq>
  .dc
+
  .dc <srcnam> <Vstart> <Vstop> <Vincr> [<srcnam2> <Vstart2> <Vstop2> <Vincr2>]
  .noise
+
  .noise V(<out>[,<ref>]) <src> <oct, dec, lin> <Nsteps> <StartFreq> <EndFreq>
  .tf
+
  .tf V(<node>[, <ref>]) <source> '''''OR''''' I(<voltage source>) <source>
 
  .op
 
  .op
 
At the schematic level these commands may be entered directly as a [[SPICE Directive]] (''ctrl''-right-click on the text to edit) or may be entered via the drop down menu item: '''Simulate => Edit Simulation Cmd'''.
 
At the schematic level these commands may be entered directly as a [[SPICE Directive]] (''ctrl''-right-click on the text to edit) or may be entered via the drop down menu item: '''Simulate => Edit Simulation Cmd'''.
 +
 +
The '''Edit Simulation Command''' dialog box organized like a row of tabbed index cards:
  
 
{|table width="400" cellspacing="0" border="1" style="background-color: #DDDDDD"
 
{|table width="400" cellspacing="0" border="1" style="background-color: #DDDDDD"
Line 12: Line 14:
 
| [[#Transient Analysis|Transient]]||[[#AC Analysis|AC Analysis]]||[[#DC Sweep|DC sweep]]||[[#Noise|Noise]]||[[#DC Transfer Function|DC Transfer]]||[[#DC Operating Point|DC op pnt]]
 
| [[#Transient Analysis|Transient]]||[[#AC Analysis|AC Analysis]]||[[#DC Sweep|DC sweep]]||[[#Noise|Noise]]||[[#DC Transfer Function|DC Transfer]]||[[#DC Operating Point|DC op pnt]]
 
|}
 
|}
{|table width="400" cellspacing="0" border="1" cellpadding="50" style="background-color: #DDDDDD" title="test"
+
{|table width="400" cellspacing="0" border="1" cellpadding="50" style="background-color: #DDDDDD" title="dialog box"
 
|- align="center"
 
|- align="center"
| ''Various options for the active Tab''
+
| ''Various options for the active tab''
 
|}
 
|}
 
__NOTOC__
 
__NOTOC__
  
<p title="test"> here is some text</p>
 
  
 
=== Transient Analysis ===
 
=== Transient Analysis ===
Line 29: Line 30:
  
 
Several ''modifiers'' can be placed on the .tran line.
 
Several ''modifiers'' can be placed on the .tran line.
*'''UIC:&nbsp;''' Use Initial Conditions.&nbsp; Skip the D.C. operating solution and use user-specified initial conditions.&nbsp; Normally, a dc operating point analysis is performed before starting the transient analysis.&nbsp; This directive suppresses this initialization.&nbsp; The initial conditions of some circuit elements can be can be specified on a per-instance basis.&nbsp; <b title="UIC is not a particularly recommended feature of SPICE.&nbsp; Skipping the DC operating point analysis leads to a nonphysical initial condition.&nbsp; For example, consider a voltage source connected in parallel to a capacitance.&nbsp; The node voltage is taken as zero if not specified.&nbsp; Then, in the first time step, an infinite current is required to charge the capacitor.&nbsp; The simulator cannot find a short enough time step to make the current nonsingular, and a ''time step too small convergence fail'' message will be issued.">hover here for more...</b>
+
*'''UIC:&nbsp;''' Use Initial Conditions.&nbsp; Skip the D.C. operating solution and use user-specified initial conditions.&nbsp; Normally, a dc operating point analysis is performed before starting the transient analysis.&nbsp; This directive suppresses this initialization.&nbsp; The initial conditions of some circuit elements can be can be specified on a per-instance basis.&nbsp; <b title="UIC is not a particularly recommended feature of SPICE.&nbsp; Skipping the DC operating point analysis leads to a nonphysical initial condition.&nbsp; For example, consider a voltage source connected in parallel to a capacitance.&nbsp; The node voltage is taken as zero if not specified.&nbsp; Then, in the first time step, an infinite current is required to charge the capacitor.&nbsp; The simulator cannot find a short enough time step to make the current non-singular, and a 'time step too small convergence fail' message will be issued.">Hover Hint</b>
 
*'''steady:&nbsp;''' Stop the simulation when steady state has been reached.
 
*'''steady:&nbsp;''' Stop the simulation when steady state has been reached.
 
*'''nodiscard:&nbsp;''' Don't delete the part of the transient simulation before steady state is reached.
 
*'''nodiscard:&nbsp;''' Don't delete the part of the transient simulation before steady state is reached.

Revision as of 23:02, 17 August 2009

At the netlist level the Simulation Command is simply a line of text that begins with any of the following Dot Commands:

.tran <Tstep> <Tstop> [Tstart [dTmax]] [modifiers]
.ac <oct, dec, lin> <Nsteps> <StartFreq> <EndFreq>
.dc <srcnam> <Vstart> <Vstop> <Vincr> [<srcnam2> <Vstart2> <Vstop2> <Vincr2>]
.noise V(<out>[,<ref>]) <src> <oct, dec, lin> <Nsteps> <StartFreq> <EndFreq>
.tf V(<node>[, <ref>]) <source> OR I(<voltage source>) <source>
.op

At the schematic level these commands may be entered directly as a SPICE Directive (ctrl-right-click on the text to edit) or may be entered via the drop down menu item: Simulate => Edit Simulation Cmd.

The Edit Simulation Command dialog box organized like a row of tabbed index cards:

Transient AC Analysis DC sweep Noise DC Transfer DC op pnt
Various options for the active tab


Transient Analysis

Perform a Nonlinear Transient Analysis.

Perform a transient analysis.  This is the most direct simulation of a circuit.  It basically computes what happens when the circuit is powered up. Test signals are often applied as independent sources.

Syntax: .TRAN <Tstep> <Tstop> [Tstart [dTmax]] [modifiers]
  or    .TRAN <Tstop> [modifiers]

The first form is the traditional .tran SPICE command.  Tstep is the plotting increment for the waveforms but is also used as an initial step-size guess.  LTspice uses waveform compression, so this parameter is of little value and can be omitted or set to zero.  Tstop is the duration of the simulation.  Transient analyses always start at time equal to zero.  However, if Tstart is specified, the waveform data between zero and Tstart is not saved.  This is a means of managing the size of waveform files by allowing startup transients to be ignored.  The final parameter dTmax, is the maximum time step to take while integrating the circuit equations.  If Tstart or dTmax is specified, Tstep must be specified.

Several modifiers can be placed on the .tran line.

  • UIC:  Use Initial Conditions.  Skip the D.C. operating solution and use user-specified initial conditions.  Normally, a dc operating point analysis is performed before starting the transient analysis.  This directive suppresses this initialization.  The initial conditions of some circuit elements can be can be specified on a per-instance basis.  Hover Hint
  • steady:  Stop the simulation when steady state has been reached.
  • nodiscard:  Don't delete the part of the transient simulation before steady state is reached.
  • startup:  Solve the initial operating point with independent voltage and current sources turned off (but using any constraints specified by a .ic directive).  Then start the transient analysis and linearly ramp on these sources during the first 20 us of the simulation.
  • step:  Compute the step response of the circuit.


AC Analysis

Perform a small signal AC Analysis linearized about the DC Operating Point.

The small signal (linear) ac portion of LTspice computes the ac complex node voltages as a function of frequency.  First, the dc operating point of the circuit is found.  Next, linearized small signal models for all of the nonlinear devices in the circuit are found for this operating point.  Finally, using independent voltage and current sources as the driving signal, the resultant linearized circuit is solved in the frequency domain over the specified range of frequencies.

This mode of analysis is useful for filters, networks, stability analyses, and noise considerations.

Syntax: .ac <oct, dec, lin> <Nsteps> <StartFreq> <EndFreq>

The frequency is swept between frequencies StartFreq and EndFreq.  The number of steps is defined with the keyword "oct", "dec", or "lin" and Nsteps according to the following table:

Keyword Nsteps
Oct steps per octave
Dec steps per decade
Lin steps between
StartFreq and EndFreq


DC Sweep

Noise

DC Transfer Function

DC Operating Point