# Wolfram Language™

## Find the Impulse Response of a Circuit

Find the impulse response for a circuit that is composed of a resistor and an inductor , and is driven by a time-dependent voltage . The current can be computed by solving a linear first-order differential equation .

Set up the differential operator corresponding to the left-hand side of the ODE.

In:= `voltage = L i'[t] + R i[t];`

Assume that the switch is initially open.

In:= `init = i == 0;`

Compute the impulse response for the circuit using GreenFunction.

In:= ```gf[s_, t_] = GreenFunction[{voltage, init}, i[t], {t, 0, \[Infinity]}, s]```
Out= Plot the impulse response at .

In:= ```Plot[gf[s, t] /. {s -> 1, R -> 2, L -> 4}, {t, 0, 7}, PlotTheme -> "Scientific", AxesLabel -> {"t", "i[t]"}]```
Out= Compute the response of the circuit to a step voltage.

In:= `v[t_] := HeavisideTheta[t];`
In:= `current = Integrate[gf[s, t] v[s], {s, 0, t}, Assumptions -> t > 0]`
Out= Visualize the step response.

In:= ```Plot[{current /. {R -> 2, L -> 4}, 0.5} // Evaluate, {t, 0, 6}, PlotTheme -> "Scientific"]```
Out= 