# Signals and Systems/Time Domain Analysis/System Response
## Example 1

Consider the driven RLC circuit below. Determine the current in the circuit, y(t), given an input of $x(t)=8e^{-2t}$. The initial current is 0A and the initial voltage across the capacitor is 2V.

### Setting Up the Differential Equation

Recall that the voltages across inductors, resistors and capacitors are related to the current as follows:
       $v_{L}=L{\frac {di}{dt}}$
       $v_{R}=iR\,$
       $v_{C}={\frac {1}{C}}\int i\,dt$
By Kirchhoff's Voltage Law, we obtain the loop equation, replacing i with y(t):
       $x(t)=L{\frac {dy(t)}{dt}}+Ry(t)+{\frac {1}{C}}\int y(t)\,dt$
Differentiating with respect to t gives us:
       ${\dot {x}}(t)=L{\ddot {y}}(t)+R{\dot {y}}(t)+{\frac {1}{C}}y(t)$
Substituting in the values gives us our differential equation describing the system:
       ${\dot {x}}(t)={\ddot {y}}(t)+4{\dot {y}}(t)+3y(t)$
We want to put this into the following form:
       $Q(D)y(t)=P(D)x(t)\,$
[System Equation]
       $\left(D^{2}+4D+3\right)y(t)=Dx(t)\,$
Now we have our equation, we can begin to find the responses.

### Zero-input Response

Zero-input response (ZIR) is the behaviour of the circuit when the input is null. Thus the differential equation to solve is:
[Zero-Input Differential Equation]
       $\left(D^{2}+4D+3\right)y(t)=0$
What we expect to see here is the capacitor discharging its initial charge through the resistor and inductor, subject to the initial conditions. The ratio of the component values will set the damping. Let's look at this first to get an idea of the behaviour of the circuit.
The equation can also be written as:
       $\left(D^{2}+2\zeta \omega _{0}D+\omega _{0}^{2}\right)y(t)=0$,
where ζ is the damping ratio, and ω$_0$ is the resonant frequency, found in the DE as the constant term in the polynomial:
       $\omega _{0}={\sqrt {3}}\,{\mbox{rad/s}}$
We therefore can solve for ζ:
       $2\zeta \omega _{0}=4\,$
       $\zeta ={\frac {4}{2{\sqrt {3}}}}\approx 1.15$
This system is therefore over-damped, so we expect to see the current rising and decaying to zero without oscillation.

#### Initial Conditions

The initial conditions also need to be factored in before we can compute the ZIR. We know from the problem that the initial current is zero. However, the current's derivative is not explicitly given. However, the voltage across the capacitor is, so we can go back the loop voltage equation:
       $x(t)=v_{L}+v_{R}+v_{C}\,$
We know that the input is zero, and that there is 2V across the capacitor. Also, as the current is zero, the resistor also has zero current across it. Thus:
       $0=v_{L}+0+2\,$
       $v_{L}=-2\,{\mbox{V}}$
The voltage across the inductor is linked to the derivative of the current:
       $v_{L}=L{\dot {y}}_{0}(t)$
       ${\dot {y}}_{0}(t)=-2$
We now have enough initial conditions:
[Zero-Input Initial Conditions]
       $y_{0}(t)=0;\quad {\dot {y}}_{0}(t)=-2$

#### Solving the DE

The characteristic equation is:
       $\lambda ^{2}+4\lambda +3=0\,$
       $(\lambda +1)(\lambda +3)=0\,$
We have our characteristic roots:
       $\lambda _{1}=-1;\quad \lambda _{2}=-3$
The general solution is:
       $y_{0}(t)=c_{1}e^{-t}+c_{2}e^{-3t}\,$
Applying initial conditions:
       $y_{0}(0)=0=c_{1}+c_{2}\,$
       ${\dot {y}}_{0}(0)=-2=-c_{1}-3c_{2}\,$
Solving these simultaneous equations gives us:
       $c_{1}=-1;\quad c_{2}=1$
The zero-input response is now:
[Zero-Input Response]
       $y_{0}(t)=-e^{-t}+e^{-3t}\,$

### Unit-impulse Response

To find the unit input response, h(t), we consider the same differential equation as for the zero-input case above, but we consider the circuit with all values (current and voltage) at zero. To do this, we specify the following initial conditions, to find a sum of the characteristic modes of the system, y$_n$(t).
[Unit-Impulse Initial Conditions]
       $y_{0}(t)=0;\quad {\dot {y}}_{0}(t)=1\,$
The general solution is the same as before:
The general solution is:
       $y_{n}(t)=c_{1}e^{-t}+c_{2}e^{-3t}\,$
However, solving for the coefficients yields a different specific solution:
       $c_{1}={\frac {1}{2}};\quad c_{2}=-{\frac {1}{2}}$
       $y_{n}(t)={\frac {1}{2}}e^{-t}-{\frac {1}{2}}e^{-3t}$
Now, recall that the original DE describing the circuit had a differential operator, P(D) on the right-hand side, acting on the input. Because we are now applying an input, we must take this into account. This is done by applying it to y$_n$(t). In this case, it is a single derivative. The result of this is the unit-impulse response.
       $h(t)=P(D)y_{n}(t)\,$
       $h(t)=(D)y_{n}(t)\,$
[Unit-Impulse Response]
       $h(t)=-{\frac {1}{2}}e^{-t}+{\frac {3}{2}}e^{-3t}$
Note that this is non-zero at t=0, which appears to contradict our conditions. However, as the unit impulse lasts for an infinitesimal period, the circuit must suddenly "jump" to a different total energy instantly, or else it couldn't ever be excited by an impulse. In real life, a finite-duration signal will cause the circuit to ramp up rather than jump.

### Zero-state Response

The zero-state response, y$_s$(t) is the response of the initially relaxed circuit to the input x(t). This is found by the convolution of the unit-impulse response and the input:
       $y_{s}(t)=h(t)*x(t)\,$
By the definition of convolution:
       $y_{s}(t)=\int _{0}^{t}h(\tau )x(t-\tau )\,d\tau$
       $y_{s}(t)=\int _{0}^{t}\left(-{\frac {1}{2}}e^{-\tau }+{\frac {3}{2}}e^{-3\tau }\right)\left(8e^{-2(t-\tau )}\right)\,d\tau$
Multiplying through:
       $y_{s}(t)=\int _{0}^{t}\left(-4e^{-\tau }e^{-2(t-\tau )}+12e^{-3\tau }e^{-2(t-\tau )}\right)\,d\tau$
       $y_{s}(t)=\int _{0}^{t}\left(-4e^{-\tau }e^{2\tau }e^{-2t)}+12e^{-3\tau }e^{2\tau }e^{-2t)}\right)\,d\tau$
Because the integral is with respect to τ, we can bring out the t term:
       $y_{s}(t)=e^{-2t}\int _{0}^{t}\left(-4e^{-\tau }e^{2\tau }+12e^{-3\tau }e^{2\tau }\right)\,d\tau$
       $y_{s}(t)=e^{-2t}\int _{0}^{t}\left(-4e^{\tau }+12e^{-\tau }\right)\,d\tau$
       $y_{s}(t)=e^{-2t}\left[-4e^{\tau }-12e^{-\tau }\right]_{0}^{t}$
       $y_{s}(t)=e^{-2t}\left(-4e^{t}-12e^{-t}+4+12\right)$
Finally, multiplying out and combining exponentials gives us the zero-state response:
[Zero-State Response]
       $y_{s}(t)=-4e^{-t}+16e^{-2t}-12e^{-3t}\,$
Note that the current is now zero at t=0 again. For any realistic signal, this will happen, due to the inductor disallowing steps in current.

### Total Response

The total response is given by the sum of the zero-input and zero-state components:
       $y_{t}(t)=y_{0}(t)+h(t)*x(t)\,$
       $y_{t}(t)=-e^{-t}+e^{-3t}-4e^{-t}+16e^{-2t}-12e^{-3t}\,$
[Total Response]
       $y_{t}(t)=-5e^{-t}+16e^{-2t}-11e^{-3t}\,$
We can plot the zero-input, zero-state, unit-impulse and total responses together: