3. Impulses¶
A step function in the forcing represents an effect that turns on and stays on. If we use a window function, the duration of the effect is limited. Now consider what happens if the window interval is \([T,T+\epsilon]\) and we let \(\epsilon\to 0\).
If the forcing amplitude remains constant in this limit, then the total effect size must also go to zero. But if we let the forcing amplitude grow to keep the area under the curve constant, we simulate a fixed effect size acting at over an infinitesimally small window, i.e., a single instant. That reasoning motivates the following definition.
Define
As \(\epsilon\to 0\), this becomes a tall, narrow spike at time \(T\). Also let \(x_\epsilon(t)\) be the solution of
Then the impulse response of the linear operator \(\mathcal{A}[x]=x'-ax\) is the function
As a shorthand, we say that the impulse response is the solution of
where \(\delta(t)\) is called an impulse or a delta function.
Note
A math pedant will never fail to remind you that \(\delta(t)\) is not a true function, but rather something called a distribution. Just nod at them and edge away slowly.
3.1. Impulse equals jump in value¶
It’s not difficult to derive a formula for the impulse response when the coefficient \(a\) in \(\opA\) is constant. The solution to the window problem \(x'-ax=\delta_\epsilon(t)\), \(x(0)=0\) is
As \(\epsilon\to 0\), we only care about what happens for \(t> \epsilon\), which gives
Using L’Hôpital’s Rule,
This result, which generalizes to the case where \(a\) depends on \(t\), is worth stating in words as well as a formula.
In a first-order linear ODE, the effect of an impulse is the same as an instantaneous increase by 1 in the value of the solution.
Note
With step forcing, we stated that \(x(t)\) is continuous while \(x'(t)\) has jumps. For impulses, it’s \(x(t)\) itself that jumps. (These observations will be modified when we look at second-order problems.)
Applying superposition, we get the following.
The solution of
where \(a(t)\) and \(f(t)\) are continuous, also satisfies
for \(t>0\).
3.2. Solution method¶
It is relatively straightforward to apply superposition to solve particular examples with impulse forcing. To solve a problem in the form
where \(T>0\) and \(a(t)\) and \(f(t)\) are continuous, we break the problem into manageable subproblems:
By linearity, then, the solution we seek is \(x=x_1+x_2+k x_3\). The problems for \(x_1\) and \(x_2\) are familiar and need no new commentary. As for \(x_3\), for \(0\le t < T\) we have \(x'-ax = 0\), \(x(0)=0\). The solution is clearly just \(x_3(t)=0\) up to time \(T\). At time \(T\) the value jumps up by 1, and then the forcing is again zero. Thus, \(x_3(t)=e^{a(t-T)}\) for \(t\ge T\). We can express \(x_3\) for all time as
If the forcing of an IVP includes additional impulses, each contributes something like (3.2) to the solution.
Example
Solve \(x'+2x=3\delta(t-1)\), with \(x(0)=-4\).
Solution
The homogeneous solution of \(x'+2x=0\), \(x(0)=-4\) is \(x_1(t)=-4e^{-2t}\). From the impulse we get
Therefore, \(x(t) = -4e^{-2t} + 3 H(t-1) e^{-2(t-1)}.\)
3.3. Numerical solution¶
The easiest way to solve these problems numerically is to solve the system first for \(t<T\) and then for \(t>T\), with the second solution having initial condition coming from the first. For the preceding example, we use:
dxdt = @(t,x) -2*x; % ODE without the delta
[t1,x1] = ode45(dxdt,[0,1],-4);
x2init = 3+x1(end); % jump from the final value for x1
[t2,x2] = ode45(dxdt,[1,5],x2init);
t = [t1;t2]; x = [x1;x2]; % stack the time and solution vectors
x_exact = -4*exp(-2*t) + 3*(t>=1).*exp(-2*(t-1));
plot(t,x,'-',t,x_exact,'o','markersize',3)
xlabel('t'), ylabel('x(t)')
legend('numerical','exact')
title('Impulse forcing')
The jump increase by 3 at \(t=1\) is the only interruption to pure exponential decay.