Control Statements for Setting Initial Conditions

In this Topic Hide

As outlined in , initial conditions are required to be supplied in the device statements. However, an .INIT statement can be used to override the initial conditions supplied in the device statements. .INIT statements are allowed to be placed within the scope of definition of a subcircuit and more than one .INIT statement can appear within the same scope of definition.

Linear and PWL Capacitors

The .INIT statement can be used to override the initial voltage of a linear capacitor or a PWL capacitor. For example,

.INIT V(C11)=0 V(!C23)=12.0

means that the initial voltage of linear capacitor C11 is set to 0 V while the initial voltage of PWL capacitor !C23 is set to 12 V. C11 and !C23 must be in the same scope of definition as the .INIT statement. Notice that more than one initial condition setting can be supplied in the same .INIT statement. Each initial condition setting is in the form of a parameter assignment as outlined in . Whatever initial voltages were specified for C11 and !C23 in the device statements, they are superseded by 0 V and 12 V, respectively.

Linear and PWL Inductors

The .INIT statement can be used to override the initial current of a linear inductor or a PWL inductor. For example,

.INIT I(L12)=0 I(!L22)= -2m

means that the initial current of linear inductor L12 is set to 0 A whereas the initial current of PWL inductor !L22 is set to -2 milliamperes.

Setting of Initial States for S and Q Switches

The .INIT statement can be used to override the initial states of simple switches and simple transistor switches:

.INIT Q1=OPEN SA=CLOSE

means that the initial state of the Q switch Q1 is set to OPEN whereas the initial state of the S switch SA is set to CLOSE.

Setting of Initial Segment for PWL Resistors

The .INIT statement can be used to override the initial segment of operation for PWL resistors:

.INIT !R100=3

means that the initial segment of operation for the PWL resistor !R100 is set to the 3rd segment of this device.

Setting of Initial State for Simple Logic Gates

The .INIT statement can be used to override the initial state of a simple logic gate. For example,

.INIT !D9=0 !D8=1

means that the initial output state for logic gate !D9 is set to logic 0 whereas the initial output state for logic gate !D8 is set to logic 1.

Initial Conditions for Devices in a Subcircuit

Since initial conditions are either specified in the device statements or through the .INIT statements discussed so far, two subcircuit instantiations referencing the same subcircuit definition naturally have identical initial conditions. Let us examine the statements in example 6.1 (a). The capacitor, originally named CA in subcircuit "SUB1", has an initial branch voltage of 1 V in the subcircuit instantiation of both X1 and X2.

In some situation, it is desirable to be able to set the initial condition of a device in a subcircuit to different values for different subcircuit instantiations. SIMPLIS allows the initial conditions for devices in a child subcircuit be overridden with an .INIT statement in the parent circuit. The extra .INIT statement shown in example 6.1 (b) means that the initial voltage on capacitor CA in subcircuit "SUB1" for the instantiations X1 and X2 should be 5 V and 2 V, respectively.

The capability to override device initial conditions can be extended to lower levels of subcircuits. For example, the expression

.INIT X123.X456.!D9=1

means that the logic gate !D9 in the subcircuit referred to as X456 in a subcircuit referred to as X123 in the current circuit is set to have an initial output state of logic 1. The .INIT statement in an ancestor circuit always overrides any initial condition specified in a subcircuit. For example, if

.INIT I(L12)=0

appears within the scope of definition of a subcircuit referred to as X123 in the main circuit and

.INIT I(X123.L12)=1

appears within the scope of definition for the main circuit, the initial current for this inductor is set to 1 A, not 0 A.

Example 6.1a

X1 1 2 SUB1
X2 9 8 SUB1
.SUBCKT SUB1 101 102
RA 101 103 1K
CA 103 102 1U IC=1
.ENDS SUB1\\

Example 6.1b

X1 1 2 SUB1
X2 9 8 SUB1
.SUBCKT SUB1 101 102
RA 101 103 1K
CA 103 102 1U IC=1
.ENDS SUB1
.INIT V(X2.CA)=2 V(X1.CA)=5\\