6.4 Impulses & the Dirac Delta ended with an integral, : the response of a linear system to any force is built from its response to a single hammer blow. A flight simulator uses exactly this when it asks how an airframe answers a gust. This lesson names the integral (a convolution), shows that the Laplace transform turns it into a plain product, and uses that to define the transfer function with its poles and zeros. The product form is why 6.2 Solving Initial Value Problems was algebra, and it is the language of the Control module. Our running system is the one from 5.6 Forced Oscillations & Resonance: , , .
Transcript
- Any input can be chopped into thin slices. The slice at time tau is a blow of strength u of tau d tau. It rings as the impulse response h, delayed by tau and scaled by the blow. A linear system adds all of these responses, and that sum is the convolution.
- Flip g about zero, slide it right by t, multiply by f and take the area. Here f is e to the minus t and g is e to the minus 2 t. The latest input meets the earliest part of g. At t equals 1 the area is 0.232544.
- The convolution theorem: the transform of f star g is F times G. Write it as a double integral over a triangle, slice the triangle the other way, and substitute sigma equals t minus tau. The swap is the sketched step. Block A: 0.232546 against 0.232544, and 0.166660 against 0.166667.
- With zero initial conditions, P of s times Y equals U, so Y equals H times U, where H is one over P of s. For our spring, h is e to the minus t over 2 times sine omega d t over m omega d, with omega d 4.974937 and one over m omega d 0.502519.
- Each pole is a mode of h. A real pole at minus a gives e to the minus a t, and a complex pair gives a decaying sine. Our poles are minus 0.5 plus or minus 4.974937 i, in the left half-plane, so the ringing dies out.
- A zero adds no mode, it reweights them. Take H equal to s plus 3 over s squared plus 2 s plus 5: the output is z prime plus 3 z. It has the same decay and frequency as e to the minus t sine 2 t, but a different phase and size.
- A system is BIBO stable when bounded inputs give bounded outputs, exactly when every pole has negative real part. A right half-plane pole makes h grow. A pole on the imaginary axis never decays, so it is not stable. A repeated one gives t to the j growth.
- How hard can a bounded input push a stable system? By the integral of absolute h: 0.638682 here, while a unit step settles at only H of 0, 0.1. The ratio is 6.387, about 6.4. The input sign of h of 10 minus t reaches y of 10 equal 0.634509, the integral up to 10.
- Drive the system with sine omega t. A stable system settles to a sine at the same frequency, scaled and shifted by H at s equals i omega. At omega 2, 5 and 10 the gain times k is 1.185114, 5, and 0.330409, with lags 0.094952, 1.570796 and 3.009041.
- On a grid, convolution is np.convolve of u and h, cut to n and scaled by dt. It counts both end terms in full; the trapezoid rule halves them. For a unit step the error is dt over 2 times h, largest at the peak 0.4313: 4.31, 2.16 and 1.08 times 10 to the minus 3.
- Against solve i v p, the plain errors are 4.23, 2.14 and 1.07 times 10 to the minus 3, ratios 1.98 and 1.99: first order. Halved end terms give 1.45 times 10 to the minus 4, 3.63 times 10 to the minus 5 and 9.08 times 10 to the minus 6, ratios 4.00: second order.
- A preview of block diagrams. Series blocks multiply: H2 times H1. In a feedback loop Y equals H times U minus G Y, so Y over U is H over 1 plus H G. The closed-loop poles are the roots of 1 plus H G, not of H, so feedback moves the poles.
- To sum up. A convolution stacks delayed, scaled impulse responses, and the transform turns it into a product. The transfer function one over P of s has poles that give the modes and the stability, and on the imaginary axis it is the frequency response. Next: systems of ODEs.
Convolution: a stack of delayed blows
Chop the input into thin slices of width . The slice at time is a blow of strength , which rings as at later time : the impulse response, scaled by the blow and delayed by . A linear system adds these responses (the “repeated blows” of the last lesson, with a continuum of blows):
That is the definition of the convolution . It is the same integral as the Green’s function formula of 5.5 Variation of Parameters, which there came from a different derivation: for constant coefficients the kernel depends only on the elapsed time . We cut it at because inputs start at , and at because for negative argument (a blow cannot ring before it lands, causality).
Flip and slide. To evaluate , flip about to get , slide it right by to get , multiply by pointwise and take the signed area. The flip is the whole mystery: the latest input gets the earliest part of , because the blow that just landed has barely begun to ring, while an old one is deep into its decay. In the sim, drag : the shaded product is the integrand, and its signed area is the dot on the output curve.
Two things follow at once. Commutativity: substitute and the integral becomes , so (a full proof, one line). Input and system may swap roles. And, in the numerics below, the discrete version is exactly a loop you have written: .
The convolution theorem
The step from integral to algebra is
Proof sketch. Write the transform of the convolution as a double integral over the triangle :
The right side is the same triangle sliced the other way (fix , let run from upward). In the inner integral put : it becomes . What remains is . The algebra and the substitution are fully proved. The swap of the order of integration is the sketched step: it is justified (Fubini) when and are piecewise continuous and of exponential order and is large enough that both integrals converge absolutely, a standard fact quoted here from memory, not proved.
Example. , . Then , and its transform . At the value is . Block A of the lab computes it with the discrete sum, then takes the Laplace integral of the numerical at and compares it with .
Impulse response and transfer function
For with and zero initial conditions, the transform is , so
Two descriptions of one fact. In time, ; in the -domain, ; the convolution theorem links them, and shows is the output when the input is a delta. Zero initial conditions matter: initial data adds the zero-input part from 6.2 Solving Initial Value Problems, which the transfer function does not describe. For our system , so with and .
Poles and zeros. A rational has poles where and zeros where . Each pole gives a mode in : a real pole at gives , a complex pair at gives , as in the pole plot of 6.2 Solving Initial Value Problems. Our poles are . A zero does not add a mode. It reweights them. Try in the sim (“with a zero”): with , so , where is the output of the zero-free system. The zero asks the output to include the velocity of , and has the same decay and frequency as with a different phase and size.
Stability from the poles
Call a system BIBO stable (bounded input, bounded output) if every bounded gives a bounded . Since , the condition is sufficient. It is also necessary (choose , which makes the integrand exactly; the mechanism is in block B, and the “only if” step is stated here, not proved in general). For a rational in lowest terms the integral is finite exactly when every pole has negative real part: each mode with is integrable and each with is not. The honest cases:
- Pole in the right half-plane (real part ): grows exponentially, the system is unstable. In the sim, has .
- Simple pole on the imaginary axis: neither grows nor decays. The system is not BIBO stable, even though many inputs give bounded outputs. Push with , at its own frequency, and the output at is with an envelope growing like (resonance, from 5.6 Forced Oscillations & Resonance); the sim shows it.
- Repeated pole on the axis: even worse, growth. is a double integrator; a bounded step makes a parabola.
- Left half-plane: everything decays, the system is BIBO stable. How much a bounded input can excite it is the number : for our spring it is , while a unit step settles at only , so the worst-case input beats the step by about .
One caveat, from memory: if a pole cancels a zero in , the transfer function hides that mode, but the mode can still be excited by initial data. “Lowest terms” in the statement above is doing real work, and it is one reason the state-space view of the next module matters.
The frequency response
Take . The transform of the output has poles of and the poles of . For a stable system the modes fade, and the response left at long times is a sine at the same frequency, scaled and shifted by evaluated at :
Mechanism: a sine is a combination of , and the response of a linear system to is (put it into the convolution: ), so the complex number is the gain and phase. For :
The forced-oscillations lesson scales gain by the static deflection, so its gain is . At : , , and , which is the first row of that lesson’s table (gain , lag at ). At : , gain , lag . Block B simulates the ODE and fits the tail of the run, and the sim’s sine mode reads the same numbers off the live run. So along the imaginary axis is the amplitude and phase curves of that lesson. Control design in the frequency domain (Bode plots, from memory) plots exactly these two functions.
Block diagrams, a preview
The product form means that connecting systems means multiplying. Two blocks in series give (their impulse responses convolve). In a feedback loop, the plant is driven by the input minus a fraction of its own output: , so and
The derivation is one line of algebra; what it means for poles is the Control module’s subject (13.1 Feedback & Block Diagrams and 13.2 Transfer Functions & Time Response). The closed-loop poles are the roots of , not of : feedback moves the poles, which is how an unstable airframe is stabilised.
Sliding a kernel across an input
The four panels are the flipped-and-slid product, the output it builds, the pole-zero map (green when every pole is in the left half-plane) and with its step response. The readout compares the convolution with an independent RK4 solution of the same ODE. For the spring with a step input at the area is against from RK4, a gap of , and the step response heads for . In sine mode on the spring at the live measurement agrees with the formula to six places and shows the gain and lag above. Switch to the pulse input: the gap grows to about , because a jump in costs a first-order error in both methods, a hint of what block C measures.
A grid cannot be convolved naively
In code, and become arrays sampled every and the integral is np.convolve(u, h)[:n] * dt, the loop above with the loop hidden. This is cheap to write and has two honest costs.
Accuracy. np.convolve computes , a Riemann sum that counts both end terms in full, where the trapezoid rule halves them. The extra half-terms are , and for our system. So the error is first order in when and second order when . For the unit step, and the leading error is , largest where peaks at : a prediction of , and at . Block C measures the maximum error over against solve_ivp at tight tolerance: , , , observed ratios and . Halve the end terms and the same run gives , , , ratios and . For , where , plain np.convolve already gives , , (ratios , ), the same as the corrected sum. At the plain step-input value is against , off by with .
Cost. Direct convolution of two arrays of length costs operations. From memory: the FFT turns convolution into pointwise multiplication (the discrete cousin of ) and costs , which pays off for long signals; scipy.signal.fftconvolve does this. For a few thousand samples the direct form is fine.
Computing it
Block A prints against (the difference is the discretisation), against for the transform check, and a commutativity gap at rounding level.
Block B prints gain , , and lags , , both ways (the row is the last row of the forced-oscillations table), then , ratio to , and for the input , the mechanism behind the necessity claim.
Block C prints the table above, including the plain step-input against the ODE’s and .
Now do it yourself: the convolution is a four-line function, the error is a measurement.
Concept checks
Problems
Find directly and by the convolution theorem, and evaluate it at .
Show worked solution
Directly, . By the theorem, , which inverts to the same thing. At it is (a hand value; the sim’s “lag” system, driven by a step, shows twice this, , at ).
For with rest initial conditions, find , and the poles, then say whether it is BIBO stable and what a unit step settles to.
Show worked solution
, so . The poles are and , both in the left half-plane, so the system is BIBO stable (and ). A unit step settles to , the final value of .
For driven by , find the steady-state amplitude and the phase lag. Check against the sim’s “first-order lag” with the sine input at .
Show worked solution
. The amplitude is and , so the output is : lag rad, a cycle. The sim reads and lag the same way and measures them from the live run. Mechanism: at the real and imaginary parts of are equal, which is a angle and a factor in magnitude.
A plant is unstable. Put it in a loop with as in . Find the closed-loop pole, the range of that stabilises it, and the pole for .
Show worked solution
, with pole . It lies in the left half-plane when . For the pole is at . Feedback with a gain just shifts this pole, it does not change its type: this is the simplest stabilisation, and why an unstable airframe can be flown with a controller (see 13.1 Feedback & Block Diagrams).
Module recap: what Laplace gave us
The Laplace module turns calculus into algebra. 6.1 The Laplace Transform defined and its derivative rule, 6.2 Solving Initial Value Problems made an IVP into with poles that predict the response, 6.3 Step Functions & Discontinuous Forcing and 6.4 Impulses & the Dirac Delta covered switched and instantaneous forcing, and this lesson showed that composition is multiplication: . The poles of tell you the modes, the stability, and, along the imaginary axis, the frequency response. The next module, 7.1 Systems & State Space, leaves the single-equation view: the poles you found here are eigenvalues of a matrix, and the matrix view works for systems far too large for partial fractions.
Key Takeaways
- The convolution sums delayed, scaled copies of one function; flip , slide it, and take the area of the product. It commutes (substitute ).
- For a linear time-invariant system, , where is the impulse response. This is the Green’s function of variation of parameters for constant coefficients.
- is proved by swapping the order of integration over the triangle and substituting ; the swap itself needs exponential order and absolute convergence (quoted from memory).
- The transfer function is for zero initial conditions, and . Poles give modes; zeros reweight them.
- BIBO stability means , i.e. all poles strictly in the left half-plane. Poles on the axis (simple or repeated) are not BIBO stable, and a pole-zero cancellation can hide an unstable mode.
- is the frequency response: gain and lag , which reproduce the forced-oscillation numbers ( and at ).
- Series blocks multiply; a feedback loop gives and moves the poles.
- On a grid,
np.convolve(u, h)[:n] * dtapproximates the integral. Its error is first order when (observed ratios and ) and second order once the end terms are halved (ratios ); the direct sum is , an FFT is (from memory).