Difference between revisions of "Simulation Command"
m |
|||
(10 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
At the netlist level the '''Simulation Command''' is simply a line of text that begins with any of the following Dot Commands: | At the netlist level the '''Simulation Command''' is simply a line of text that begins with any of the following Dot Commands: | ||
− | .tran | + | .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" | + | {|table width="400" cellspacing="0" border="1" cellpadding="50" style="background-color: #DDDDDD" title="LTspice dialog box" |
|- align="center" | |- align="center" | ||
− | | '' | + | | ''User options for the selected tab'' |
|} | |} | ||
__NOTOC__ | __NOTOC__ | ||
Line 20: | Line 22: | ||
=== Transient Analysis === | === Transient Analysis === | ||
+ | Perform a Nonlinear Transient Analysis. | ||
+ | |||
+ | This is a time domain analysis. Selected circuit signals may be displayed in the Waveform viewer as they are simulated, much like an oscilloscope on the bench. It basically computes what happens when the circuit is powered up and runs. Test signals are often applied as independent sources or may be taken from captured data stored on file. | ||
+ | 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. <font color="green"><b title="UIC is not a particularly recommended feature of SPICE. Skipping the DC operating point analysis may often lead to a nonphysical initial condition. For example, consider a voltage source connected in parallel to a capacitance. The node voltage is taken as zero if not specified. Then, in the first time step, an infinite current is required to charge the capacitor. 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."> Extra Hint!</b></font> | ||
+ | *'''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 === | === AC Analysis === | ||
− | Perform a small signal AC Analysis linearized about the DC Operating Point. | + | Perform a small signal AC Analysis (linearized about the DC Operating Point). |
− | + | This is a frequency domain analysis whereby the ac small signal (i.e., linear) response of the circuit is calculated using complex variable arithmetic. First, LTspice finds the dc operating point of the circuit. Next, working about this operating point, LTspice calculates linearized small signal models for all nonlinear devices. Finally, using independent small signal ac voltage and current sources as the driving signal, LTspice solves the resultant linearized circuit in the frequency domain over the specified range of frequencies. <font color="green"><b title="By specifying just a single frequency point and sweeping (stepping) any circuit parameter instead, LTspice will display the ac response over that parameter's sweep range."> Extra Hint!</b></font> | |
This mode of analysis is useful for filters, networks, stability analyses, and noise considerations. | This mode of analysis is useful for filters, networks, stability analyses, and noise considerations. | ||
Line 44: | Line 59: | ||
=== DC Sweep === | === DC Sweep === | ||
+ | Perform a DC Source Sweep Analysis. | ||
+ | |||
+ | This performs a DC analysis while sweeping the DC value of a source. It is useful for computing the DC transfer function of an amplifier or plotting the characteristic curves of a transistor for model verification. | ||
+ | Syntax: .dc <srcnam> <Vstart> <Vstop> <Vincr> [<srcnam2> <Vstart2> <Vstop2> <Vincr2>] | ||
+ | The <srcnam> is either an independent voltage or current source that is to be swept from <Vstart> to <Vstop> in <Vincr> step sizes. In the following example, the default BSIM3v3.2.4 characteristic curves are plotted: | ||
+ | |||
+ | * Example .dc sweep | ||
+ | * | ||
+ | M1 2 1 0 0 nbsim | ||
+ | Vgs 1 0 3.5 | ||
+ | Vds 2 0 3.5 | ||
+ | .dc Vds 3.5 0 -0.05 Vgs 0 3.5 0.5 | ||
+ | .model nbsim NMOS Level=8 | ||
+ | .save I(Vds) | ||
+ | .end | ||
=== Noise === | === Noise === | ||
+ | Perform a Noise Analysis. | ||
+ | |||
+ | This is a frequency domain analysis that computes the noise due to Johnson, shot and flicker noise. The output data is noise spectral density per unit square root bandwidth. | ||
+ | Syntax: .noise V(<out>[,<ref>]) <src> <oct, dec, lin> <Nsteps> <StartFreq> <EndFreq> | ||
+ | V(<out>[,<ref>]) is the node at which the total output noise is calculated. It can be expressed as V(n1, n2) to represent the voltage between two nodes. <src> is the name of an independent source to which input noise is referred. <src> is the noiseless input signal. The parameters <oct, dec, lin>, <Nsteps>, <StartFreq>, and <EndFreq> define the frequency range of interest and resolution in the manner used in the .ac directive. | ||
+ | |||
+ | Output data trace V(onoise) is the noise spectral voltage density referenced to the node(s) specified as the output in the above syntax. If the input signal is given as a voltage source, then data trace V(inoise) is the input-referred noise voltage density. If the input is specified as a current source, then the data trace inoise is the noise referred to the input current source signal. The noise contribution of each component can be plotted. These contributions are referenced to the output. You can reference them to the input by dividing by the data trace "gain". | ||
+ | |||
+ | The waveform viewer can integrate noise over a bandwidth by ''ctrl-left mouse button'' clicking on the corresponding data trace label. | ||
=== DC Transfer Function === | === DC Transfer Function === | ||
+ | Find the DC Small Signal Transfer Function. | ||
+ | |||
+ | This is an analysis mode that finds the dc small signal transfer function of a node voltage or branch current due to small variations of an independent source. | ||
+ | Syntax: .tf V(<node>[, <ref>]) <source> | ||
+ | OR .tf I(<voltage source>) <source> | ||
+ | Examples: | ||
+ | .tf V(out) Vin | ||
+ | .tf V(5,3) Vin | ||
+ | .tf I(Vload) Vin | ||
=== DC Operating Point === | === DC Operating Point === | ||
+ | Find the DC Operating Point | ||
+ | |||
+ | Perform a dc operating point solution with capacitances open circuited and inductances short circuited. Usually a dc solution is performed as part of another analysis in order to find the operating point of the circuit. Use .op if you wish only this operating point to be found. The results will appear in a dialog box. After a .op simulation, when you point at a node or current the .op solution will appear on the status bar. | ||
+ | Syntax: .op | ||
+ | There is no guarantee that the operating point of a general nonlinear circuit can be found with successive linear approximations as is done in Newton-Raphson iteration. Should direct Newton iteration fail, LTspice tries a number of other methods to find an operating point. Below is a table of the methods used and the options settings required to disable a particular method. | ||
+ | |||
+ | {|table width="300" cellspacing="0" border="1" | ||
+ | |- align="center" | ||
+ | ! Method || Directive to Disable | ||
+ | |- align="center" | ||
+ | | Direct Newton Iteration || .opt NoOpIter | ||
+ | |- align="center" | ||
+ | | Adaptive Gmin Stepping || .opt GminSteps=0 | ||
+ | |- align="center" | ||
+ | | Adaptive Source Stepping || .opt SrcSteps=0 | ||
+ | |- align="center" | ||
+ | | Pseudo Transient || .opt pTranTau=0 | ||
+ | |} | ||
+ | |||
+ | {{#widget:DISQUS | ||
+ | |id=ltwiki | ||
+ | |uniqid={{PAGENAME}} | ||
+ | |url={{fullurl:{{PAGENAME}}}} | ||
+ | }} |
Latest revision as of 18:06, 29 January 2014
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 |
User options for the selected tab |
Transient Analysis
Perform a Nonlinear Transient Analysis.
This is a time domain analysis. Selected circuit signals may be displayed in the Waveform viewer as they are simulated, much like an oscilloscope on the bench. It basically computes what happens when the circuit is powered up and runs. Test signals are often applied as independent sources or may be taken from captured data stored on file.
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. Extra 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).
This is a frequency domain analysis whereby the ac small signal (i.e., linear) response of the circuit is calculated using complex variable arithmetic. First, LTspice finds the dc operating point of the circuit. Next, working about this operating point, LTspice calculates linearized small signal models for all nonlinear devices. Finally, using independent small signal ac voltage and current sources as the driving signal, LTspice solves the resultant linearized circuit in the frequency domain over the specified range of frequencies. Extra Hint!
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
Perform a DC Source Sweep Analysis.
This performs a DC analysis while sweeping the DC value of a source. It is useful for computing the DC transfer function of an amplifier or plotting the characteristic curves of a transistor for model verification.
Syntax: .dc <srcnam> <Vstart> <Vstop> <Vincr> [<srcnam2> <Vstart2> <Vstop2> <Vincr2>]
The <srcnam> is either an independent voltage or current source that is to be swept from <Vstart> to <Vstop> in <Vincr> step sizes. In the following example, the default BSIM3v3.2.4 characteristic curves are plotted:
* Example .dc sweep * M1 2 1 0 0 nbsim Vgs 1 0 3.5 Vds 2 0 3.5 .dc Vds 3.5 0 -0.05 Vgs 0 3.5 0.5 .model nbsim NMOS Level=8 .save I(Vds) .end
Noise
Perform a Noise Analysis.
This is a frequency domain analysis that computes the noise due to Johnson, shot and flicker noise. The output data is noise spectral density per unit square root bandwidth.
Syntax: .noise V(<out>[,<ref>]) <src> <oct, dec, lin> <Nsteps> <StartFreq> <EndFreq>
V(<out>[,<ref>]) is the node at which the total output noise is calculated. It can be expressed as V(n1, n2) to represent the voltage between two nodes. <src> is the name of an independent source to which input noise is referred. <src> is the noiseless input signal. The parameters <oct, dec, lin>, <Nsteps>, <StartFreq>, and <EndFreq> define the frequency range of interest and resolution in the manner used in the .ac directive.
Output data trace V(onoise) is the noise spectral voltage density referenced to the node(s) specified as the output in the above syntax. If the input signal is given as a voltage source, then data trace V(inoise) is the input-referred noise voltage density. If the input is specified as a current source, then the data trace inoise is the noise referred to the input current source signal. The noise contribution of each component can be plotted. These contributions are referenced to the output. You can reference them to the input by dividing by the data trace "gain".
The waveform viewer can integrate noise over a bandwidth by ctrl-left mouse button clicking on the corresponding data trace label.
DC Transfer Function
Find the DC Small Signal Transfer Function.
This is an analysis mode that finds the dc small signal transfer function of a node voltage or branch current due to small variations of an independent source.
Syntax: .tf V(<node>[, <ref>]) <source> OR .tf I(<voltage source>) <source>
Examples:
.tf V(out) Vin .tf V(5,3) Vin .tf I(Vload) Vin
DC Operating Point
Find the DC Operating Point
Perform a dc operating point solution with capacitances open circuited and inductances short circuited. Usually a dc solution is performed as part of another analysis in order to find the operating point of the circuit. Use .op if you wish only this operating point to be found. The results will appear in a dialog box. After a .op simulation, when you point at a node or current the .op solution will appear on the status bar.
Syntax: .op
There is no guarantee that the operating point of a general nonlinear circuit can be found with successive linear approximations as is done in Newton-Raphson iteration. Should direct Newton iteration fail, LTspice tries a number of other methods to find an operating point. Below is a table of the methods used and the options settings required to disable a particular method.
Method | Directive to Disable |
---|---|
Direct Newton Iteration | .opt NoOpIter |
Adaptive Gmin Stepping | .opt GminSteps=0 |
Adaptive Source Stepping | .opt SrcSteps=0 |
Pseudo Transient | .opt pTranTau=0 |