# Incorporating SPICE Initial Conditions and Interpreting the Results

July 10, 2019

When you allow a car to start rolling down a hill, its speed at the bottom of the hill depends on the location that the car started rolling, and the initial speed of the vehicle. I learned this the hard way the first time I tried to jack up my car and change a tire as a teenager. Now I know to at least put on the parking brake, or just call a tow truck.

Working with initial conditions in an important aspect of simulating any dynamic system. Initial conditions determine how the system evolves over time, and they also influence how a system behaves in space in 3D simulations. Including SPICE initial conditions allows you to examine how a system responds to different driving signals, or you can simulate the transient behavior of a system.

## What are SPICE Initial Conditions?

Any dynamic system, meaning a system that changes over time, must have some initial conditions defined. These initial conditions can then determine the evolution of the system at all later points in time. The system could be either driven or undriven, and different initial conditions will produce different behavior in both cases.

Many systems exhibit transient behavior when they are initially placed at the initial conditions. A good example is with an underdamped block connected to a spring. If the block is initially displaced from equilibrium, the spring will cause the block to move back towards equilibrium and produce an oscillation. Friction will also slow the block and eventually cause it to come to rest at equilibrium.

The same transient response occurs in an underdamped RLC circuit. When the capacitor is initially charged and there is some current flowing through the resistor and inductor, the current and voltage will gradually fall off to zero. The initial voltage across the capacitor forms the initial condition. Normally, only current and voltage are specified as initial conditions in a circuit using a SPICE-based simulator.

The current and voltage may exhibit a decaying oscillation if the damping constant in the circuit is low. Analyzing the behavior of a circuit under various initial conditions allows you to do two things. By setting some non-zero initial conditions throughout the circuit, you can analyze how damping in the circuit affects the transient response. You can also examine how the circuit responds to changes in the source. Once the source changes, the current and voltage change in response and begin to exhibit transient behavior. This can be simulated by “daisy chaining” two or more separate simulations, as discussed below.

## Daisy Chaining Simulations with Transient Analysis

In some cases, you may want to examine how a circuit suddenly responds to a change in the driving signal. As an example, you might be driving the system with a sinusoidal source, and the driver is suddenly turned off. How will the circuit respond in this case? One simple method for simulating the system is to “daisy chain” two simulations and examine the transient behavior of the system.

This process requires building a simulation where a driver is running continuously in time. This then tells you how the circuit behaves at any point in time and allows you to compare the voltage/current distribution throughout the circuit at different points in time. As soon as the driver turns off, the voltage and current at different locations in the circuit at that instant become your initial conditions in the circuit. You can immediately start a new simulation with the previous current and voltage values set as initial conditions.

Once you run the second simulation, the circuit will exhibit a transient response in the time domain as the circuit settles back towards equilibrium. If the driver was completely switched off, the current and voltage will start from the initial conditions defined in the circuit, and the current and voltage will subsequently fall back to zero during this transition.

## An Example: SPICE Initial Conditions in an RLC Series Circuit

The example below shows the behavior of a simple underdamped RLC circuit in series that is driven with a 3 V, 8 Hz sine wave. The current in the circuit is shown in the graph below, along with the voltage supplied by the sinusoidal source. At t = 0.25 s, the driver is immediately turned off, and the circuit starts to exhibit its transient response.

Transition from driven to transient response as a function of initial conditions

Note that this methodology is an alternative to using a continuously varying sinusoidal source that immediately drops to zero at some particular point in time. You could certainly perform the above analysis in a single simulation with a single waveform. However, you would have to define an arbitrary waveform that is initially sinusoidal up to some time t, and then immediately drops to zero at all times after t.

Note that if you were designing this circuit to be a first-order filter or as part of a termination network, you can iterate through different values of different components and examine how the circuit responds to different initial conditions. Note that this discussion involves multiple time domain situations as this allows you to directly visualize the transient response. However, you might like to determine the transfer function in the frequency domain as this gives you a more granular view of how the circuit responds to different driving frequencies. You can also work with the Laplace transform of an arbitrary driving function to examine the transient response.

Investigating how your circuits respond to different initial conditions is much easier when you work with a powerful simulation package like the OrCAD PSpice Simulator from Cadence. No matter the complexity of your designs, you can quickly simulate the driven and transient behavior based on your SPICE initial conditions, as well as the transition between transient and frequency domains.

###### Previous Article
Effective Integrated Circuit Simulation Within Multi-board PCB Systems

Performing integrated circuit simulation not only verifies your circuit’s functionality, but also aids in t...

###### Next Article
The Flyback Diode: Voltage Problems and Switching Solutions

Nicola Tesla helped discover answers and solutions to switching voltage changes with the help of the flybac...