Documentation /  Analog Insydes /  Tutorial /  Time-Domain Analysis of Nonlinear Dynamic Circuits /

NDAESolve OptionsTransientPlot Options

2.7.5 Transient Analysis with Initial Conditions

Circuits with Initial Conditions

The handling of initial conditions was rather complicated with version 1 of Analog Insydes. Therefore, the netlist format was extended to treat initial conditions of dynamic circuit elements such as capacitors or inductors. This is done by specifying the setting InitialCondition -> value in the option field of the particular netlist entry (see Section 3.1.4).

Consider the RLC circuit shown in Figure 7.4. The initial voltage across the capacitor C1 at is given as . Assume that the following numerical values are given for the circuit elements: , , , and .

Figure 7.4: Oscillator circuit with initial condition

We start with writing a circuit netlist which includes the initial condition of the capacitor C1.

In[22]:= oscillator =
Netlist[
{L1, {0, 1}, Symbolic -> L1, Value -> 1.*10^-5},
{C1, {1, 2}, Symbolic -> C1, Value -> 3.*10^-7,
InitialCondition -> 0.002},
{R1, {2, 0}, Symbolic -> R1, Value -> 1.}
]

Out[24]=

Following, we distinguish two alternatives for considering initial conditions of dynamic circuit elements.

Initial Conditions for some Dynamic Elements

With the option setting InitialConditions -> Automatic the function CircuitEquations can be instructed to use initial conditions for those elements for which such a condition has been specified in the netlist entry. All others are then computed consistently by NDAESolve. For our example, we set up a system of modified nodal equations from the circuit configuration at the time .

In[23]:= oscillatorMNA1 = CircuitEquations[oscillator,
AnalysisMode -> Transient, ElementValues -> Symbolic,
InitialConditions -> Automatic];
DisplayForm[oscillatorMNA1]

Out[26]//DisplayForm=

Note that the initial condition for the capacitor C1 is given by the node voltage difference and is included in the set of time-domain equations. Applying NDAESolve yields the following DC operating-point values for the node voltages and the initial inductor current I$L1:

In[24]:= NDAESolve[oscillatorMNA1, {t, 0.}]

Out[27]=

For the DC analysis the inductor was replaced by a short circuit, therefore V$1 is zero. I$L1 has the same numerical value as V$2 because the resistor has the unit value . Now, we compute the transient response:

In[25]:= transient1 = NDAESolve[oscillatorMNA1, {t, 0., 10^-4}]

Out[28]=

Finally, we plot the transient waveform of the output current (given by the inductor current I$L1) in the simulated time interval.

In[26]:= TransientPlot[transient1, {I$L1[t]}, {t, 0., 10^-4},
PlotRange -> All]

Out[29]=

Initial Conditions for all Dynamic Elements

Alternatively, the function CircuitEquations can be instructed to use initial conditions for all dynamic elements by applying the option setting InitialConditions -> All. Initial conditions which are not explicitly specified in the netlist are then assumed to be zero. For our example, we again set up a system of modified nodal equations from the circuit configuration at the time .

In[27]:= oscillatorMNA2 = CircuitEquations[oscillator,
AnalysisMode -> Transient, ElementValues -> Symbolic,
InitialConditions -> All];
DisplayForm[oscillatorMNA2]

Out[31]//DisplayForm=

Note that this time the time-domain equations contain not only the initial condition for the capacitor C1 (given by the node voltage difference ) but also an initial condition for the inductor current I$L1[0]. Now, we compute the DC operating point and the transient response by applying NDAESolve.

In[28]:= NDAESolve[oscillatorMNA2, {t, 0.}]

Out[32]=

In[29]:= transient2 = NDAESolve[oscillatorMNA2, {t, 0., 10^-4}]

Out[33]=

Finally, we plot the output current.

In[30]:= TransientPlot[transient2, {I$L1[t]}, {t, 0., 10^-4},
PlotRange -> All]

Out[34]=

Please note the different transient waveforms dependent on the usage of initial conditions.

NDAESolve OptionsTransientPlot Options