Differential Equations Solving for Impulse Response Linear systems are often described using differential equations. For example: dy d2y + 5 + 6y = f (t) dt2 dt where f(t) is the input to the system and y(t) is the output. We cannot solve for the impulse response directly so we solve for the step response and then differentiate it to get the impulse response. Differential Equation solve We know how to solve for y given a specific input f . Step response We now cover an alternative approach: differentiate Differential Equation solve Impulse response Impulse response Any input Any input convolution convolution Corresponding Output Corresponding Output 17 18 Motivation: Convolution Solving for Step Response If we know the response of a linear system to a step input, we can calculate the impulse response and hence we can find the response to any input by convolution. If we want to find the step response of dy + 5y = f (t) dt where f is the input and y is the output. It would be nice if we could put f (t) = H(t) and solve. Unfortunately we don’t know of a way to do this directly. So we Suppose we want to know how a car’s suspension responds to lots of different types of road surface. We measure how the suspension responds to a step input (or calculate the step response from a theoretical model of the system). We can then find the impulse response and use convolution to find the car’s behaviour for any road surface profile. 19 1. set f (t) = 1, and solve for just t ≥ 0 2. set the boundary condition y(0) = 0 (also ẏ(0) = 0 for second order equations) to imply that f (t) was zero for all t < 0. We thus have a complete solution because y = 0 for t < 0, and we have found y for all t ≥ 0. 20 Boundary Condition Justification Step Response Example Prove that y = 0 at t = 0 by contradiction. We know that y(t) = 0 for all t < 0. Therefore the only way for y to equal something other than zero at t = 0 is if there is a step discontinuity in y at t = 0 . Assume that y has a step of height h at t = 0 . If y has a step discontinuity at t = 0 then dy dt must have a delta function at t = 0. Step 1: set f (t) = 1, and solve for just t ≥ 0. dy + 5y = 1 dt Complimentary function: ẏ + 5y = 0 ⇒ y = Ae−5t So we have: • f (t) is a step function so |f (t)| ≤ 1 for all t. • |y| ≤ h at t = 0. 1 Particular Integral: try y = λ (a const) ⇒ y = 5 1 General Solution: y = Ae−5t + 5 • dy dt → ∞ at t = 0. Step 2: set the boundary condition y = 0 at t = 0 Which violates the original equation at t = 0. dy = f (t) − 5y dt As the RHS is finite but the LHS is infinite. Therefore y must be continuous at t = 0, and we can use the initial condition y(0) = 0. 21 1 = 0 ⇒ A = −1 y(0) = 0 ⇒ A + 5 5 −5t for t ≥ 0. So step response is y(t) = 1 5 1−e 22 Find the Impulse Response dy d2y + 13 + 12y = f (t) dt2 dt Step → Impulse Response Impulse Response g(t) integrate differentiate 1. Find the General Solution with f (t) = 1 Step Response Complimentary function is y = Ae−12t + Be−t 1 Particular integral is y = 12 1 + Ae−12t + Be−t General solution is y = 12 1 −5t Step response is y(t) = 5 1 − e for t ≥ 0. 2. Set boundary conditions y(0) = ẏ(0) = 0 to get the step response. 1 12 + A + B = 0 Impulse response g(t) is given by: −12A − B = 0 1 and B = − 1 ⇒ A = 132 11 0, t < 0 g(t) = 1 d −5t = e−5t, t ≥ 0 1−e −12t −t e 1 +e Thus Step Response is y = 12 132 − 11 dt 5 3. Differentiate the step response to get the impulse response. g(t) = 23 e−t − e−12t dy = dt 11 , (t > 0) 24 Using the Impulse Response If we have a system input composed of impulses, f (t) = 3δ(t − 1) + 4δ(t − 2) we can find the corresponding system output using superposition. More General Input Suppose our input is composed of lots of delta functions: f (t) = n y(t) = 3g(t − 1) + 4g(t − 2) = 3 e−(t−1) − e−12(t−1) 11 +4 e−(t−2) − e−12(t−2) 11 pn δ(t − qn ) Then the corresponding system output will be X y(t) = X n pn g(t − qn ) 25 26 Section 2: Summary Differential Equation ay + by + cy + d = f(t) Section 3 solve ay + by + cy + d = 1 with boundary conditions y(0) = 0 and y(0) = 0 Convolution Step response In this section we derive the convolution integral and show its use in some examples. differentiate Impulse response Any input convolution Corresponding Output 27 28 Convolution Our goal is to calculate the output, y(t) of a linear system using the input, f (t), and the impulse response of the system, g(t). An impulse at time t = 0 produces the impulse response. δ (t) k δ(t) t t An impulse delayed to time t = τ produces a delayed impulse response starting at time τ . δ(t−τ ) Linear System g(t−τ ) τ τ Linear System k g(t) t g(t) Linear System t A scaled impulse at time t = 0 produces a scaled impulse response. t An impulse that has been scaled by k and delayed to time t = τ produces an impulse response scaled by k and starting at time τ . k δ(t−τ ) Linear System τ t k g(t−τ ) τ t t 29 30 Consider the input, f (t) to be made up of a sequence of strips of width ∆τ . Each of these strips is similar to a delta function and thus leads to a system output of an appropriately scaled and delayed impulse response. δ (t−τ ) f(τ ) ∆ τ f(t) leads to response g(t−τ ) f(τ ) ∆τ y(t) = −∞ g(t − τ )f (τ )dτ • Treat t as a constant when evaluating the integral. The integration variable is τ . ∆τ t τ The response of the system, y(t) is thus the sum of these delayed, scaled impulse responses. (Provided g(t) = 0 for t < 0.) y(t) ≈ Z t X g(t − τ )f (τ )∆τ • t is time as it relates to the output of the system y(t). • τ is time as it relates to the input of the system f (τ ). All slices Let the width of the slices tend to zero. The sum turns into an integral called the convolution integral. y(t) = Z t −∞ g(t − τ )f (τ )dτ 31 32 Convolution Example 2 Convolution Example 1 For the same system (g(t) = e−5t , t ≥ 0), find the output for input Consider a system with impulse response g(t) = ( 0 ,t<0 −5t e ,t≥0 f (t) = Find the output for input f (t) = H(t) (step function). 0, t < 0 v, 0 < t < k 0, t > k f(t) v k t Using the convolution integral, the answer is given by y(t) = = Z t −∞ Z t g(t − τ )f (τ )dτ y(t) = e−5(t−τ )H(τ )dτ −∞ Z t e−5(t−τ )dτ = 0 1 −5(t−τ ) t = e 5 0 1 = 1 − e−5t 5 33 Z t g(t − τ )f (τ )dτ −∞ R t g(t − τ ) × 0 dτ, t<0 −∞ R0 −∞ Rg(t − τ ) × 0 dτ + 0t g(t − τ ) v dτ, 0<t<k = R0 −∞ Rg(t − τ ) × 0 dτ + 0k g(t − τ ) v dτ R + kt g(t − τ ) × 0 dτ, t > k 34 Case (a): t < 0 Rt −∞ g(t − τ ) × 0 dτ = 0 so y(t) = 0 for all t < 0. Convolution Example 3 Case (b): 0 < t < k y(t) = Z t 0 g(t − τ ) v dτ = = Z t 0 vh e−5(t−τ ) v dτ e−5(t−τ ) it 0 5 v = 1 − e−5t 5 For the same system (g(t) = e−5t , t ≥ 0), find the output for input f (t) = ( 0, t<0 sin(ωt), t > 0 f(t) t Case (c): t > k y(t) = Z k 0 g(t − τ ) v dτ = = = Z k 0 vh −5(t−τ ) e Using the convolution integral, the answer is given by v dτ i −5(t−τ ) k e 0 5 v 5k e − 1 e−5t 5 y(t) (a) (b) k (c) y(t) = Z t g(t − τ )f (τ )dτ −∞ R t t<0 −∞ g(t − τ ) × 0 dτ, R0 = −∞ Rg(t − τ ) × 0 dτ + 0t g(t − τ ) sin(ωτ ) dτ, 0 < t t 35 36 Convolution Summary Differential Equation ay + by + cy + d = f(t) Case (a): t < 0 Rt −∞ g(t − τ ) × 0 dτ = 0 so y(t) = 0 for all t < 0. solve ay + by + cy + d = 1 with boundary conditions y(0) = 0 and y(0) = 0 Case (b): 0 < t y(t) = = Z t 0 Z t g(t − τ ) sin(ωτ ) dτ e−5(t−τ ) sin(ωτ ) dτ 0 Z t = Im e−5(t−τ )eiωτ dτ Step response 0 t (5+iω)τ e −5t = Im e 5 + iω 0 ( ) eiωt − e−5t differentiate Impulse response: g(t) = Im 5 + iω 5 sin(ωt) − ω cos(ωt) + ωe−5t = 25 + ω 2 Any Input: f(t) convolution y(t) = 37 Z t −∞ Corresponding Output: y(t) g(t − τ ) f (τ ) dτ 38 Complete Example Find the impulse response of d2y dy + 3 + 2y = f (t) dt2 dt hence find the output when the input f (t) = H(t)e−t . 3. Differentiate the step response to get the impulse response. g(t) = dy = e−t − e−2t dt 1. Find the General Solution with f (t) = 1 4. Use the convolution integral to find the output for the required input. Complimentary function is y = Ae−t + Be−2t Particular integral is y = 1 2 The required input is f (t) = e−t , t > 0. 1 + Ae−t + Be−2t General solution is y = 2 y(t) = 2. Set boundary conditions y(0) = ẏ(0) = 0 to get the step response. 1 2+A+B =0 −A − 2B = 0 ⇒ A = −1 and B = 1 2 = = = Z t −∞ Z t Z0t 0 h g(t − τ )f (τ )dτ e−(t−τ ) − e−2(t−τ ) e−τ dτ e−t − eτ −2t dτ i τ −2t t τe − e 0 −t − 1) e + e−2t −t = (t −2t −t + e Thus Step Response is y = 1 2−e 2 39 40 Section 3: Summary Section 4 Convolution integral (memorise this): f (t) = input g(t) = impulse response y(t) = y(t) = Evaluating Convolution Integrals output Z t −∞ g(t − τ ) f (τ ) dτ Way to find the output of a linear system, described by a differential equation, for an arbitrary input: • Find general solution to equation for input = 1. • Set boundary conditions y(0) = ẏ(0) = 0 to get the step response. A way of rearranging the convolution integral is described and illustrated. The differences between convolution in time and space are discussed and the concept of causality is introduced. The section ends with an example of spatial convolution. • Differentiate to get the impulse response. • Use convolution integral together with the impulse response to find the output for any desired input. 41 42