# Circuit Theory/Convolution Integral
## Impulse Response

So far circuits have been driven by a DC source, an AC source and an exponential source. If we can find the current of a circuit generated by a Dirac delta function or impulse voltage source δ, then the convolution integral can be used to find the current to any given voltage source!

## Example Impulse Response

The current is found by taking the derivative of the current found due to a DC voltage source! Say the goal is to find the δ current of a series LR circuit .. so that in the future the convolution integral can be used to find the current given any arbitrary source.
Choose a DC source of 1 volt (the real Vs then can scale off this).
The particular homogeneous solution (steady state) is 0. The homogeneous solution to the non-homogeneous equation has the form:
    $i(t)=Ae^{-{\frac {t}{\frac {L}{R}}}}+C$
Assume the current initially in the inductor is zero. The initial voltage is going to be 1 and is going to be across the inductor (since no current is flowing):
    $v(t)=L{di(t) \over dt}$
    $v(0)=1=L*(-{\frac {AR}{L}})$
    $A=-1/R$
If the current in the inductor is initially zero, then:
    $i(0)=0=A+C$
Which implies that:
    $C=-A=1/R$
So the response to a DC voltage source turning on at t=0 to one volt (called the unit response μ) is:
    $i_{\mu }(t)={\frac {1}{R}}(1-e^{-{\frac {t}{\frac {L}{R}}}})$
Taking the derivative of this, get the impulse (δ) current is:
    $i_{\delta }(t)={\frac {e^{-{\frac {t}{\frac {L}{R}}}}}{L}}$
Now the current due to any arbitrary V$_S$(t) can be found using the convolution integral:
    $i(t)=\int _{0}^{t}i_{\delta }(t-\tau )V_{s}(\tau )d\tau =\int _{0}^{t}f(t-\tau )g(\tau )d\tau +C_{1}$
Don't think i$_δ$ as current. It is really ${d \over dt}{\frac {current}{1volt}}$. V$_S$(τ) turns into a multiplier.

## LRC Example

Find the time domain expression for i$_o$ given that I$_s$ = cos(t + π/2)μ(t) amp.
Earlier the step response for this problem was found:
    $i_{o_{\mu }}={\frac {1}{2}}(1-e^{-t}(\cos t+\sin t))$
The impulse response is going to be the derivative of this:
    $i_{o_{\delta }}={di_{o_{\mu }} \over dt}=0+{\frac {1}{2}}e^{-t}(\cos t+\sin t)-{\frac {1}{2}}e^{-t}(-\sin t+\cos t)$
    $i_{o_{\delta }}={\frac {1}{2}}e^{-t}(\cos t+\sin t+\sin t-\cos t)=e^{-t}\sin t$
    $I_{s}=1+\cos t$
    $i_{o}(t)=\int _{0}^{t}i_{o_{\delta }}(t-\tau )I_{s}(\tau )d\tau +C_{1}$
    $i_{o}(t)=\int _{0}^{t}e^{-(t-\tau )}\sin(t-\tau )(1+\cos \tau )d\tau +C_{1}$
    $i_{o}(t)={\frac {\cos t}{5}}+{\frac {2\sin t}{5}}-{\frac {7e^{-t}\cos t}{10}}-{\frac {11e^{-t}\sin t}{10}}+{\frac {1}{2}}+C_{1}$
The Mupad code to solve the integral (substituting x for τ) is:

## Finding the integration constant

    $i_{o}(0_{+})=0={\frac {1}{5}}-{\frac {7}{10}}+{\frac {1}{2}}+C_{1}$
This implies:
    $C_{1}=0$

## TO DO

    $i(t)=\int _{0}^{t}i_{\delta }(t-\tau )V_{s}(\tau )d\tau =\int _{0}^{t}f(t-\tau )g(\tau )d\tau$
This was created with matlab, turned into a gif with ImageMagick, cropped with a photo editor and then released into the public domain.
Several others have created an alternative animation.
* The blue symbol $f(t)$ represents $i_{\delta }(t)$.
* The red symbol $g(t)$ represents the arbitrary $V_{s}(t)$.
* The current due to the V$_S$ black (on top of the yellow).
* The turn on event occurs at t = 5 seconds, not 0.
* The voltage of the source is not on indefinitely. It turns on at zero and off at 5 time constants.