Skip to content

Simulation: Transient Analysis

as5322 edited this page Aug 3, 2023 · 9 revisions

Overview

Text - limitations of current algorithm

Circuits without Capacitors or Inductors

When dealing with circuits that are comprised of resistors, diodes, operational amplifiers, and voltage/current sources only, the simulation process is relatively straightforward. It involves performing a DC Analysis at multiple time points, resulting in a time-domain simulation. The algorithm employed follows these steps:

  1. The values of sine wave voltage sources are computed for each time point.
  2. Modified nodal analysis is executed to analyse the circuit’s behaviour at each specific time.

Iterating through these calculations allows the simulation to accurately capture the circuit’s response over time.

Circuits with one Capacitor or Inductor

When we simulate first-order components, we require a distinct algorithm which differs from the one used for circuits without reactive components. These circuits require additional specification specific calculations. The algorithms for simulating the first order circuits are outlined in the Imperial College First Year ADC module and are summarized below:

• Output is always steady-state + transient, where:

  • Steady-state: same frequency as the input; new amplitude and phase offset are determined using frequency response
  • Transient is always of the form $Ae^{-\frac{t}{\tau}}$.

$\tau$ is equal to $R_{th}$ ∗ C or $\frac{L}{R_{th}}$ where $R_{th}$ is the Thevenin resistance seen by C or L

• To find A we solve: $\delta$ output = HF gain ∗ $\delta$ input $\rightarrow$ $y_{ss}(0^+)$ + A = HF ∗ x($0^+$), as x($0^−$) and y($0^−$) are force-set to 0

(I) Finding the Thevenin Resistance

According to the Thevenin Theorem: Any two-terminal network consisting of resistors, fixed voltage/current sources and linear dependent sources is externally equivalent to a circuit consisting of a resistor in series with a fixed voltage source.

A Thevenin equivalent circuit has a straight-line characteristic with the equation V = $R_{th}$I + $V_{th}$ .Given that an implementation of nodal analysis already exists (MNA), the algorithm here finds two points in the Thevenin equivalent circuit, from which it will obtain the Thevenin resistance $R_{th}$ by finding the slope of the line. This is done by substituting the relevant component with a current source I, and obtaining the results for two different current values, $I_1$ = 1A and $I_2$ = 2A. Performing MNA on these two circuits will produce two different voltage values, $V_1$ and $V_2$. Then the Thevenin resistance is equal to:

$R_{th} = \frac{V_2 - V_1}{I_2 - I_1} = V_2 - V_1$, since $I_2 - I_1 = 1$

(II) Finding the Steady-State

For the purposes of time simulation, we store the steady state as a voltage source, which is then use to find values at different points. There are two cases:

  1. MNA for DC/Step input sources - for this $y_{ss}$ is a Voltage Source with DC value equal to the voltage of the output node calculated by MNA.
  2. AC analysis for sinusoidal inputs - $y_{ss}$ is set as a sinusoidal voltage source with the same frequency as the input source and new amplitude A' = AC Analysis.Map * A and a new phase offset = ACAnalysis.Phase + PO

(III) Finding the High Frequency (HF) Gain

As f $\rightarrow \infty$ , the impedance of a capacitor becomes approximately zero, while for a inductor tends to infinity. To make sure we accurately represent this the capacitor / inductor is transformed into a 0-current, 0-voltag source.

Then we perform MNA again and the HF gain is $\frac{V (output node)}{V (input node)}$

(IV) Finding the Amplitude (A) of the transient

Using the variables above, we can sub into the formula: A = HF * $x(0^+)$ - $y_{ss}(0^+)$

(V) Finding the timesteps

ADDIE does not allow the students to set their own start/end times and timesteps. Instead it uses a timestep which is dependent on the input source and explained bellow

Input Source Type Start time End time TimeStep
Sinusoidal of frequency f 0.0 $\frac{5}{f}$ $\frac{1}{40 * f}$
DC/Step with time constant τ 0.0 $10*\tau$ $\frac{\tau}{20}$

Visualisation of Results

Combining all the information obtained above, the transientAnalysis function returns three lists of length 200: one containing the samples of $y_{ss}$, one for $y_{tr}$, and the timesteps used (dts). The graph displays in total 4 signals against time: x (input signal), y (output signal), $y_{ss}$ and $y_{tr}$. Both x and y are calculated in the graph function, as y is simply $y_{ss}$ + $y_{tr}$, and x can be derived directly from the circuit.