SPICELib.analyses

Types of analyses supported by SPICELib

SPICELib.analyses.OP SPICELib.analyses.AC SPICELib.analyses.TRAN

Information



Performing Circuit Analyses



Analysis types supported by SPICELib are shown in Table 1. Each analysis type is described in the corresponding class documentation.


Table 1. SPICELib analyses summary.
Package Model Analysis type
analyses OP Bias point calculation.
analyses AC AC sweep.
analyses TRAN Transient (time) analysis.


Global parameters


The value of two global parameters has to be defined (see Table 2).

Table 2. Global parameters.
TimeScale It is intended for providing an (rough) approximate value of the circuit time-constant.
LogResults It determines the amount of information to be logged during the bias point calculation and the AC small-signal analysis.


Log of analysis results


SPICELib logs the analysis results to the dslog.txt file (using Dymola's LogVariable function). Two parameters control this information log (see Table 3 and 4).

Table 3. Parameters controlling the results log.
LogResults Global parameter.
HIDDEN_COMPONENT Device-dependent parameter


Table 4. LogResults values producing the variable log as a function of HIDDEN_COMPONENT value.
HIDDEN_COMPONENT = false HIDDEN_COMPONENT = true
Voltage at resistor pines 0, 1, 2 2
Current through independent voltage sources 0, 1, 2 2
Total power dissipation 0, 1, 2 2
Voltage drop at resistors 1, 2 2
Current through resistors 1, 2 2
Power dissipation at each independent voltage source 1, 2 2


The complex AC small-signal voltages and currents are logged in Cartesian and polar coordinates. In addition, the polar magnitude is also expressed in decibels (defined as 20*log10( )).

Setting the Stop Time


SPICELib analysis models force the simulation end when they have completed their operations. Large simulation times should be selected in the modeling environment experiment definition (for example, "Simulation/Setup/Stop time" in Dymola) to avoid interfering with analysis execution.

NameDescription
OP  
AC  
TRAN  


SPICELib.analyses.OP SPICELib.analyses.OP

Information



OP - Bias point calculation



To calculate the DC response of an analog circuit, SPICELib removes time from the circuit. This is done by treating all capacitors as open circuits, all inductors as shorts, and using only the DC values of voltage and current sources.

The bias point is calculated for any analysis. However, additional information is reported when the Bias Point analysis is made. The following information is reported to the dslog.txt file: Bias point calculation is the most problematic step from the numerical point of view. The nonlinear equations which describe the circuit's static behavior must be solved. SPICELib provides four alterative algorithms for solving the circuit static model (see Table 1). The SOLVE_STATIC parameter determines which of the four algorithms to use.

Table 1. Algorithms for solving the circuit static model.
SOLVE_STATIC=0 Static model iteration
The solution of the circuit static model is left in hands of the modeling environment (for instance, Dymola).
SPICELib has two symbols to provide an initial guess for Newton-Raphson algorithm: NODESET1 and NODESET2.
SOLVE_STATIC=1 Static model ramping
The static value of the independent sources is ramped by SPICELib from zero up to their target values. The clamping voltages of the IC symbols and the capacitor IC property are also adequately ramped. The value of the parameter TIME_SCALE determines the time length of the ramping.
SOLVE_STATIC=2 GMIN stepping
GMIN stepping attemps to find a solution for the static model (with power supplies at 100%) by starting with a large value of GMIN, initially 1e10 times the nominal value. If a solution is found at this setting, SPICELib reduces GMIN by a factor of 10 and tries again. This continues until either GMIN is back to the nominal value, or a repeating cycle fails to converge.
SOLVE_STATIC=3 Dynamic model ramping
The initial condition to iterate the static model is obtained by simulating the large-signal model. A transient analysis is performed: all sources are ramped up from zero to the desired initial value and this value is held for some time to allow the circuit to stabilise. Then, the voltage values calculated from this transient analysis are used as initial conditions for solving the static model.


Note:
The algorithms static model iteration, static model ramping, and GMIN stepping are supported by PSpice. PSpice first tries to solve the static model of the circuit using the Newton-Raphson algorithm. If a solution is not found and GMIN stepping is enabled, then GMIN algorithm is applied. If it also fails or it is not enabled, then "static model ramping" is applied.
The algorithm dynamic model ramping is proposed in "Cellier F.E. (1991): Continuous System Modeling. Springer-Verlag".

Parameters

NameDefaultDescription
TimeScale Time scale [s]
LogResults Log variables mode
Gmin1e-12Conductance in parallel with the pn-junction [S]
replaceable model Circuit NULL 
SOLVE_STATIC0OP calculation algorithm: 0, 1, 2 or 3

Modelica definition

model OP 
  extends src.ANALYSES.OP;
  
end OP;

SPICELib.analyses.AC SPICELib.analyses.AC

Information



AC sweep - Frequency response of the circuit


AC sweep is a frequency response analysis. SPICELib calculates the small-signal response of the circuit to a combination of inputs by transforming it around the bias point and treating it as a linear circuit. The best way to use AC sweep analysis is to set the source magnitude to one. This way, the measured output equals the gain, relative to the input source, at that output.

Setting up an AC analysis

To run an AC sweep analysis, you need to place and connect one or more independent sources and then set the AC magnitude and phase for each source. Each independent source in your circuit contains its own AC specification for magnitude and phase.

The parameters defining the frequency sweep are shown in Table 1.

Table 1. Parameters.
TYPE_AC_SWEEP It defines the frequency sweep type:
  • TYPE_AC_SWEEP=0 - Linear.
  • TYPE_AC_SWEEP=1 - Logarithmically by decades.
POINTS_NUMBER Number of sweep points:
  • TYPE_AC_SWEEP=0 - Total number of points.
  • TYPE_AC_SWEEP=1 - Total number of points per decade.
START_FREQUENCY Starting frequency for the sweep.
END_FREQUENCY Ending frequency for the sweep.

Parameters

NameDefaultDescription
TimeScale Time scale [s]
LogResults Log variables mode
Gmin1e-12Conductance in parallel with the pn-junction [S]
replaceable model Circuit NULL 
SOLVE_STATIC0OP calculation algorithm: 0, 1, 2 or 3
TYPE_AC_SWEEP 0: LIN; 1: DEC
POINTS_NUMBER LIN: total. DEC: points/decade
START_FREQUENCY [Hz]
END_FREQUENCY [Hz]

Modelica definition

model AC 
  extends src.ANALYSES.AC;
  
  
end AC;

SPICELib.analyses.TRAN SPICELib.analyses.TRAN

Information



TRAN - Transient analysis


The Transient response analysis causes the response of the circuit to be calculated from TIME=0 to a specified time (see the note below). During a transient analysis, any or all of the independent sources may have time-varying values.

The parameters defining the transient analysis are shown in Table 1.

Table 1.
Parameters
TSTOP Length of the transient simulation.
SKIPBP SKIPBP=false
The transient analysis does its own calculation of a bias point to start with, using the same technique as described for Bias Point. This is necessary because the initial values of the sources can be different from their DC values.
Two equivalent procedures are provided to specify the analysis initial conditions: the IC symbols and the IC property.

SKIPBP=true
The bias point calculation is skipped and the simulation proceeds directly with transient analysis at TIME=0. The large-signal circuit state is initialised to the IC-property corresponding values. Devices with IC property defined start with the specified voltage or current value; however, all other such devices have an initial voltage or current of zero. IC symbols are ignored.


Simulation time during transient analysis

When the transient simulation is started, the value of Modelica variable time is different from zero. For this reason, a variable is defined to measure the transient simulation time: TIME.

Parameters

NameDefaultDescription
TimeScale Time scale [s]
LogResults Log variables mode
Gmin1e-12Conductance in parallel with the pn-junction [S]
replaceable model Circuit NULL 
SOLVE_STATIC0OP calculation algorithm: 0, 1, 2 or 3
TSTOP Transient simulation end time [s]
SKIPBPfalseSkip initial transient solution

Modelica definition

model TRAN 
  extends src.ANALYSES.TRAN;
  
  
end TRAN;

HTML-documentation generated by Dymola Tue Oct 14 18:26:23 2003 .