This page demostrates the simulation of simple R, L, C circuits with. with a DC source.
For such a simple circuit zero state analytical solution can be found easily.
In the following discussion $R_1 // R_2 $ means that $R_1$ is in parallel with $R_2$.
Analytical Solution
The impedance of the parallel R, L in $s$ domain(Laplace transform) is: $$ Z(s) = { { R L s } \over { R + L s } }$$
The Laplace transform of the step current source is: $$ I ( s ) = { I_s \over s } $$
The voltage is: $$ V (s) = Z(s) I (s) = { { R L } \over { R + L s } } I_s = { { R} \over { s + { R \over L} } } I_s $$
The time domain solution is: $$ v(t) = R I_s exp ( - {t \over T} ) $$
where $ T = L/R $ is the time constant of the R, L circuit.
Time Step and Simulation Accuracy
At time = $0^+$, the inductor is an open circuit. The node voltage should be equal to $ R I_s $.
As we recall that the discretized equivalent circuit of an inductor is a conductance $g= { \Delta t \over 2L}$ in parallel with a history current source. Since it is a zero state solution, the history current at the start is 0, the initial volage right after time zero ($0^+$) at the node is $$ v ( 0^+) = \Bigl ( R // ( 1/g ) \Bigr) I_s = \Bigl( R // ({2L \over \Delta t } ) \Bigr) I_s $$ $$ = {{ R ( {2L \over \Delta t } ) } \over { R + ( {2L \over \Delta t } ) } } I_s = { { R } \over { 1 + { R \Delta t \over 2 L } } } I_s $$
or, $$ v ( 0^+) = { { R } \over { 1 + { \Delta t \over 2 T } } } I_s $$
Let's define the relative simulaiton error at time=$0^+$ as: $$ V_{error} (\%) = { v(0^+)- R I_s \over R I_s} 100 = - {{ 100 { (\Delta t \over 2T } ) } \over { 1 + ( {\Delta t \over 2T } ) } } $$
It can be seen clearly that the error is a function of $ {\Delta t \over 2T }$ . The smaller the ratio $ {\Delta t \over 2T }$ the smaller the error. As $ {\Delta t \over 2T }$ approaches 0, the simulation error approaches 0.
$\Delta t ( \mu S ) $ | $ {\Delta t \over 2 T} (T=0.01 S) $ | $ V_{error}$(%) |
---|---|---|
10 | 0.0005 | -0.0500 |
20 | 0.0010 | -0.0999 |
30 | 0.0015 | -0.1498 |
40 | 0.0020 | -0.1996 |
50 | 0.0025 | -0.2494 |
60 | 0.0030 | -0.2991 |
70 | 0.0035 | -0.3488 |
80 | 0.0040 | -0.3984 |
90 | 0.0045 | -0.4480 |
100 | 0.0050 | -0.4975 |
It can also be seen from simulation results (please refer to the plot for $V_{error}$ ) that as time increases the simulation error decreases. That is to say that the initial error in the simulation will diminish as time progresses instead of being magified. This indicates that the trapezoidal rule is numerially stable which is crucial to EMT simulaiton.
We will have more discussions about numerical stability later.
This is a first order circuit with one energy storage component. The analytical solution for the voltage can be found.
Applying KCL to the node yields $$ i_R(t) + i_C(t) = i_s(t) $$ $$ { v(t) \over R } + C { d v(t) \over dt} = I_s $$
It is easy to verify that the following is the solution of the above differential equation: $$ v (t)= RI_s \bigl[ 1 - exp ( - { \frac{t}{T}} ) \bigr] $$
where $ T = R C $ is the time constant of the R, C circuit.
Time Step ($\Delta t$) and Simulation Accuracy
At time = $0^+$ (the instance right after time zero), the capacitor is an short circuit. The node voltage should be equal to 0.
As we recall that the discretized equivalent circuit of an inductor is a conductance ( $g= { 2 C \over \Delta t }$ ) in parallel with a history current source. Since it is a zero state solution, the history current at the start is 0, the initial volage at the node is $$ v ( 0^+) = \bigl( R // ( 1/g ) \bigr) I_s = \bigl( R // ( {\Delta t \over 2 C } ) \bigr) I_s $$ $$ = {{ R ( {\Delta t \over 2 R C } ) } \over { 1 + ( {\Delta t \over 2 R C } ) } } I_s $$
or, $$ v ( 0^+) = \Bigl({ { R I_s } \over { 1 + { \Delta t \over 2T } } } \Bigr)\frac { \Delta t } { 2 T } $$
Since the exact solution should be $ v(0^+)=0$, the value of the above formula represets the simulation error at time=$0^+$.
Let's define the relative simulaiton error at time=$0^+$ as: $$ V_{error} (\%) = { v(0^+)- 0 \over R I_s} 100 = {{ 100 { (\Delta t \over 2T } ) } \over { 1 + ( {\Delta t \over 2T } ) } } $$ It can be seen clearly that the error is a function of $ { \Delta t \over 2 T }$ . The smaller the ratio $ {\Delta t \over 2 T }$ the smaller the error. As ${\Delta t \over 2T }$ approaches 0 the simulation error approaches 0.
$\Delta t ( \mu S ) $ | $ {\Delta t \over 2 T} (T=0.01 S)$ | $ V_{error}$(%) |
---|---|---|
10 | 0.0005 | 0.0500 |
20 | 0.0010 | 0.0999 |
30 | 0.0015 | 0.1498 |
40 | 0.0020 | 0.1996 |
50 | 0.0025 | 0.2494 |
60 | 0.0030 | 0.2991 |
70 | 0.0035 | 0.3488 |
80 | 0.0040 | 0.3984 |
90 | 0.0045 | 0.4480 |
100 | 0.0050 | 0.4975 |
This is parallel R-L-C circuit fed by an ideal step current source.
Initial Conditions
At time = $0^+$, the inductor is an open circut while the capacitor is a short circuit.
Therefore: $$ i(0^+) = 0 $$ $$ v(0^+) = L {di \over dt} \Bigl|_{t=0^+} = 0 \hspace{4em} => \hspace{2em} {di \over dt} \Bigl|_{t=0^+} = 0 $$
where $I$ is the magnitude of the step current source.
Analytical Solutions
The total conductance of the R//L//C is: $$ Y(s) = {1 \over R } + { 1 \over L s } + Cs = { LC s^2 + (L/R)s + 1 \over L s}$$
The node voltage is $$ V(s) = { I_s(s) \over Y(s) } = { Ls \over LS s^2 + (L/R)s + 1 } I_s(s) $$
The current in the inductor is $$ I_L(s) = { V(s) \over Ls } = { 1 \over LS s^2 + (L/R)s + 1 } I_s(s) $$
If we defined $\alpha$ and $\omega _0$ as: $$ \alpha = { 1\over 2 RC } \hspace{4em} \omega _0 = { 1 \over \sqrt{LC} } $$
then $$ { I_L (s) \over I_s(s) } = { \omega _0 ^ 2 \over s^2 + 2 \alpha s + \omega _0 ^2 } $$
The poles of the above transfer function are: $$ s_{1,2} = { - 2 \alpha \pm \sqrt{ (2 \alpha)^2 -4 \omega _0 ^2} \over 2 } = { - \alpha \pm \sqrt{ \alpha^2 -\omega _0 ^2} }$$
The dampling factor $\zeta$ is defined as: $$ \zeta = { \alpha \over \omega _0 } $$
There are three type of solutions based on the values of $\zeta$.
Under-damped
When $\zeta \le 1 $, the two poles are pair of conjugate complex numbers. The solution will be in the form of $$ i_L(t) =C_0 + e ^{- \alpha t} \bigl( C_1 sin( \omega _d t ) + C_2 cos ( \omega _d t) \bigr) $$
where $\omega _d = \sqrt{ \omega _0 ^2 - \alpha^2 } $.
Since oscillation will decay exponentially the solution will approach a DC value as time approaches infinity. Therefore: $$ \lim_{t\to \infty } i(t) = C_0 = I $$
Applying the intial condition $ i(0^+) = 0 $ gives us: $$ I + C_2 = 0 \hspace{4em} C_2= - I $$
The derivative of $i_L(t) $ is: $$ { di_L(t) \over dt} = -\alpha e ^{- \alpha t} \bigl( C_1 sin( \omega _d t ) - I cos ( \omega _d t) \bigr) $$ $$ \hspace{1em} + \omega _ d e ^{- \alpha t} \bigl( C_1 cos( \omega _d t ) + I sin ( \omega _d t) \bigr) $$
Applying the intial condition $ {di \over dt} \Bigl|_{t=0^+} = 0 $ gives us: $$ - \alpha(0-I) + \omega _d ( C_1 + 0) = 0 $$ or $$ \alpha I + \omega _d C_1 = 0 \hspace{4em} C_1 = - {\alpha \over \omega _ d } I $$
Therefore, $$ i_L(t) = I \Bigl( 1 - e ^{- \alpha t} \bigl( {\alpha \over \omega _ d } sin( \omega _d t ) + cos ( \omega _d t) \bigr) \Bigr) $$
or (please note that $ \omega _0^2 = \alpha ^2 + \omega _d ^ 2 $ ): $$ i_L(t) = I \Bigl( 1 - { \omega _ 0 \over \omega _ d } e ^{- \alpha t} cos ( \omega _d t + \phi ) \Bigr) $$
where $\phi = atan( { \alpha \over \omega _ d } ) $.
No Damping
When $\zeta = 0 $, the real parts in the pair of conjugate complex poles are zeros. The solution can be obtained by finding the limits as $\alpha$ approaches $0$.
Since $$ \lim_{\alpha \to 0 } e ^ { - \alpha t } =1 $$ $$ \lim_{\alpha \to 0 } \omega _d = \omega _0 $$ $$ \lim_{\alpha \to 0 } \phi = \lim_{\alpha \to 0 } atan( { \alpha \over \omega _ d } ) = 0 $$
Therefore, $$ i_L(t) = I_S \Birl ( 1 - cos ( \omega _0 t ) \Bigr) $$
In this case the current and voltages in the circuit will oscillate forever without decaying at the resonance frequency defined by the following equation: $$ f_0 = { \omega _ 0 \over 2 \pi } = { 1 \over 2 \pi \sqrt { L C } } $$
Over-damped
If $R$ is changed to 50 $\Omega$ making damping factir $\zeta \ge 1 $, the two poles will now be negative real numbers. The solution will be in the following form: $$ i_L(t) = C_0 + C_1 e ^{s_1 t} + C_2 e ^ {s_2 t} $$
Let's defined two constants $\beta$ and $\gamma$: $$ \beta = -\alpha + \sqrt { \alpha ^2 - \omega _ 0^2} \hspace{3em} \gamma = -\alpha - \sqrt { \alpha ^2 - \omega _ 0^2} $$ You can verify that the following is the solution: $$ i_L (t) = I \bigl ( 1 + { 1 \over \beta - \gamma } ( \gamma e ^ { \beta t } - \beta e ^ { \gamma t} ) \bigr ) $$ There will be no oscillation in this case.
For such a simple circuit zero state analytical solution can be found easily.
Analytical Solution
The impedance of the serial R, L in $s$ domain(Laplace transform) is: $$ Z(s) = { R + R_s + L s } $$
The Laplace transform of the step voltage source is: $$ V ( s ) = { V_s \over s } $$
where $V_s$ is the magnitude of the step voltage source and $R_s$ is the internal resistance of the source.
The current in the load resistor is: $$ I (s) = { V(s) \over Z(s) } = { 1 \over ( R + R_s + L s ) s } V_s $$ $$\hspace {1em} = \bigl( { 1 \over s } - { 1 \over s + 1/T } \bigr) { V_s \over R+R_s} $$
where $ T = {L \over R+R_s} $ is the time constant.
The time domain solution is: $$ i(t) = { 1 \over R+R_s} V_s (1- e ^ { - {t \over T} } ) $$ $$ v(t) = R i(t) = { R \over R+R_s} V_s (1- e ^ { - {t \over T} } ) $$ $$ v(\infty) = \lim_{t\to \infty } v(t) = { R \over R+R_s} V_s $$
Time Step and Simulation Accuracy
At time = $0^+$, the inductor is an open circuit. The node voltage should be equal to $ 0 $.
As we recall that the discretized equivalent circuit of an inductor is a conductance $g= { \Delta t \over 2L}$ in parallel with a history current source. Since it is a zero state solution, the history current at the start is 0, the initial volage right after time zero ($0^+$) at the node is $$ v ( 0^+) = { R \over R + R_s + ( 1/g ) } V_s $$ $$ \hspace{1em} = { R \over R + R_s + {2L \over \Delta t} } V_s $$ $$ \hspace{1em} = { { R + R_s \over R + R_s } R ( { \Delta t \over 2L} ) \over 1 + { (R+R_s)\Delta t \over 2L} } V_s $$ $$ \hspace{1em} = { R \over R + R_s } { ( { \Delta t \over 2T} ) \over 1 + { \Delta t \over 2T } } V_s $$
Let's define the relative simulaiton error at time=$0^+$ as: $$ V_{error}(\%) = { v(0^+) - 0 \over v(\infty)} 100 $$ $$ \hspace{1em} = 100 { ( { \Delta t \over 2T} ) \over 1 + { \Delta t \over 2T } } $$
It can be seen clearly that the error is a function of $ {\Delta t \over 2T }$ . The smaller the ratio $ {\Delta t \over 2T }$ the smaller the error. As $ {\Delta t \over 2T }$ approaches 0, the simulation error approaches 0.
$\Delta t ( \mu S ) $ | $ {\Delta t \over 2 T} (T=0.005 S) $ | $ V_{error}$(%) |
---|---|---|
10 | 0.0001 | 0.0100 |
20 | 0.0002 | 0.0200 |
30 | 0.0003 | 0.0300 |
40 | 0.0004 | 0.0400 |
50 | 0.0005 | 0.0500 |
60 | 0.0006 | 0.0600 |
70 | 0.0007 | 0.0700 |
80 | 0.0008 | 0.0799 |
90 | 0.0009 | 0.0899 |
100 | 0.0010 | 0.0999 |
It can also be seen from simulation results (please refer to the plot for $V_{error}$ ) that as time increases the simulation error decreases. That is to say that the initial error in the simulation will diminish as time progresses instead of being magified. This indicates that the trapezoidal rule is numerially stable which is crucial to EMT simulaiton.
We will have more discussions about numerical stability later.
For such a simple circuit zero state analytical solution can be found easily.
The initial condition is $v(0^+) = 0 $, which means that the capacitor is a short circuit.
Analytical Solution
The impedance of the serial R, C in $s$ domain(Laplace transform) is: $$ Z(s) = { R + R_s + { 1 \over C s } } $$
The Laplace transform of the step voltage source is: $$ V_s ( s ) = { V_s \over s } $$
where $V_s$ is the magnitude of the step voltage source and $R_s$ is the internal resistance of the source.
The voltage over the load resistor is: $$ V (s) = { 1/(Cs) \over Z(s) } V_s(s) = { 1 \over ( R + R_s)Cs + 1 } { V_s \over s} $$ $$\hspace {1em} = \bigl( { 1 \over s } - { 1 \over s + 1/T } \bigr) { V_s } $$
where $ T = ( R+R_s ) C $ is the time constant.
The time domain solution is: $$ v(t) = V_s (1- e ^ { - {t \over T} } ) $$ $$ v(\infty) = \lim_{t\to \infty } v(t) = V_s $$
Time Step and Simulation Accuracy
As we recall that the discretized equivalent circuit of a capactior is a conductance $g= { 2C \over \Delta t }$ in parallel with a history current source. Since it is a zero state solution, the history current at the start is 0, the initial volage right after time zero ($0^+$) at the node is $$ v ( 0^+) = { 1/g \over R + R_s + ( 1/g ) } V_s $$ $$ \hspace{1em} = { 1 \over ( R + R_s ) g + 1 } V_s $$ $$ \hspace{1em} = { 1 \over ( R + R_s ) 2C/\Delta t + 1 } V_s $$ $$ \hspace{1em} = { ( { \Delta t \over 2T} ) \over 1 + { \Delta t \over 2T } } V_s $$
Let's define the relative simulaiton error at time=$0^+$ as: $$ V_{error}(\%) = { v(0^+) - 0 \over v(\infty)} 100 $$ $$ \hspace{1em} = 100 { ( { \Delta t \over 2T} ) \over 1 + { \Delta t \over 2T } } $$
It can be seen clearly that the error is a function of $ {\Delta t \over 2T }$ . The smaller the ratio $ {\Delta t \over 2T }$ the smaller the error. As $ {\Delta t \over 2T }$ approaches 0, the simulation error approaches 0.
$\Delta t ( \mu S ) $ | $ {\Delta t \over 2 T} (T=0.01 S) $ | $ V_{error}$(%) |
---|---|---|
10 | 0.0005 | 0.0495 |
20 | 0.0010 | 0.0989 |
30 | 0.0015 | 0.1483 |
40 | 0.0020 | 0.1976 |
50 | 0.0025 | 0.2469 |
60 | 0.0030 | 0.2962 |
70 | 0.0035 | 0.3453 |
80 | 0.0040 | 0.3945 |
90 | 0.0045 | 0.4436 |
100 | 0.0050 | 0.4926 |
It can also be seen from simulation results (please refer to the plot for $V_{error}$ ) that as time increases the simulation error decreases. That is to say that the initial error in the simulation will diminish as time progresses instead of being magified. This indicates that the trapezoidal rule is numerially stable which is crucial to EMT simulaiton.
We will have more discussions about numerical stability later.
This is parallel R-L-C circuit fed by an ideal step current source.
Initial Conditions
At time = $0^+$, the inductor is an open circut while the capacitor is a short circuit.
Therefore: $$ i(0^+) = 0 $$ $$ v(0^+) = 0 $$
Since $ i(t) = C { dv(t) \over dt } $, we have $$ {dv \over dt } \bigl| _ { t = 0^+ } =0 $$
Analytical Solutions
Applying KVL, we have $$ v_R(t) + v_L(t) + v_c(t) = V $$
where $V$ is the magnitude of the step voltage source. Since R, L, C are in serial, KCL dictates that $$ i_R(t) = i_L(t) = i_c(t) = C {dv_c \over dt } $$
Therefore, $$ R i_C(t) + L { d i_c \over dt } + v_c = V $$ $$ R C {dv_c \over dt } + L C {d^2v_c \over dt^2 } + v_c = V $$ $$ {d^2v_c \over dt^2 } + { R \over L } {dv_c \over dt } + {1 \over LC }v_c = { V \over LC } $$ $$ {d^2v_c \over dt^2 } + { 2 \alpha } {dv_c \over dt } + {\omega _0^2}v_c = {\omega _0^2} $$
where $ \alpha = {R \over 2L} $ , ${ \omega _0 = {1 \over \sqrt{LC}} } $.
The characteristic polynomial for the above differential equation is $$ s^2 + 2 \alpha s + \omega _ 0 ^ 2 $$
The zeros of the characteristic polynomial are called the characteristic roots or, the natural freuencies of the circuit: $$ s_{1,2} = - \alpha \pm \sqrt{ \alpha ^2 - \omega _0 ^2 } $$
The dampling factor $\zeta$ is defined as: $$ \zeta = { \alpha \over \omega _0 } $$
There are three type of solutions based on the values of $\zeta$.
Under-damped
When $\zeta \le 1 $, the two roots are a pair of conjugate complex numbers $$ s_{1,2} = - \alpha \pm j \sqrt{ \omega _0 ^2 - \alpha ^2 } $$
. The solution will be in the form of $$ i_L(t) =C_0 + e ^{- \alpha t} \bigl( C_1 sin( \omega _d t ) + C_2 cos ( \omega _d t) \bigr) $$
where $\omega _d = \sqrt{ \omega _0 ^2 - \alpha^2 } $.
Since $ \alpha >0 $, oscillation will decay exponentially and the solution will approach a DC value as time approaches infinity. Therefore: $$ \lim_{t\to \infty } v_c (t) = C_0 = V $$
Applying the intial condition $ i(0^+) = 0 $ gives us: $$ V + C_2 = 0 \hspace{4em} C_2= - V $$
The derivative of $v_c(t) $ is: $$ { dv_c(t) \over dt} = -\alpha e ^{- \alpha t} \bigl( C_1 sin( \omega _d t ) - I cos ( \omega _d t) \bigr) $$ $$ \hspace{1em} + \omega _ d e ^{- \alpha t} \bigl( C_1 cos( \omega _d t ) + I sin ( \omega _d t) \bigr) $$
Applying the intial condition $ {dv_c \over dt} \Bigl|_{t=0^+} = 0 $ gives us: $$ - \alpha(0-V) + \omega _d ( C_1 + 0) = 0 $$ or $$ \alpha V + \omega _d C_1 = 0 \hspace{4em} C_1 = - {\alpha \over \omega _ d } V $$
Therefore, $$ v_c(t) = V \Bigl( 1 - e ^{- \alpha t} \bigl( {\alpha \over \omega _ d } sin( \omega _d t ) + cos ( \omega _d t) \bigr) \Bigr) $$
or (please note that $ \omega _0^2 = \alpha ^2 + \omega _d ^ 2 $ ): $$ v_c(t) = V \Bigl( 1 - { \omega _ 0 \over \omega _ d } e ^{- \alpha t} cos ( \omega _d t + \phi ) \Bigr) $$
where $\phi = atan( { \alpha \over \omega _ d } ) $.
No Damping
When $\zeta = 0 $, the real parts in the pair of conjugate complex poles are zeros. The solution can be obtained by finding the limits as $\alpha$ approaches $0$.
Since $$ \lim_{\alpha \to 0 } e ^ { - \alpha t } =1 $$ $$ \lim_{\alpha \to 0 } \omega _d = \omega _0 $$ $$ \lim_{\alpha \to 0 } \phi = \lim_{\alpha \to 0 } atan( { \alpha \over \omega _ d } ) = 0 $$
Therefore, $$ i_L(t) = I_S ( 1 - cos ( \omega _0 t ) \Bigr) $$
In this case the current and voltages in the circuit will oscillate forever without decaying at the resonance frequency defined by the following equation: $$ f_0 = { \omega _ 0 \over 2 \pi } = { 1 \over 2 \pi \sqrt { L C } } $$
Over-damped
If $R$ is changed to 50 $\Omega$ making damping factir $\zeta \ge 1 $, the two poles will now be negative real numbers. The solution will be in the following form: $$ i_L(t) = C_0 + C_1 e ^{s_1 t} + C_2 e ^ {s_2 t} $$
Let's defined two constants $\beta$ and $\gamma$: $$ \beta = -\alpha + \sqrt { \alpha ^2 - \omega _ 0^2} \hspace{3em} \gamma = -\alpha - \sqrt { \alpha ^2 - \omega _ 0^2} $$ You can verify that the following is the solution: $$ v_c (t) = V \bigl ( 1 + { 1 \over \beta - \gamma } ( \gamma e ^ { \beta t } - \beta e ^ { \gamma t} ) \bigr ) $$ There will be no oscillation in this case.
Move
this
DIV