SOLVING DIFFERENTIAL EQUATIONS Amir Asif Department of Computer Science and Engineering York University, Toronto, ON M3J1P3 ABSTRACT This article reviews a direct method for solving linear, constant-coefficient differential equations without using transforms. The method that we use, offers a general characterization of solutions that provide insight into the behaviour of the modeled system. 1. INTRODUCTION It is convenient to express the output y(t) of the continuous-time (CT) system described by a differential equation as the sum of two components: Homogeneous component y h (t) associated with the initial conditions. Particular component y p (t) associated with the input applied to the system. The homogeneous component is the output of the system when the input is set to zero. The homogeneous component, therefore, describes the manner in which the system dissipates any energy or memory of the past. The past information is specified as initial conditions to the differential equation. The particular component is the output of the system with the initial conditions set to zero. It describes the system behaviour that is forced by the input. 2. HOMOGENEOUS COMPONENT Assume that the differential equation modeling the CT system is given by N k=0 a k d k y(t) k = M k=0 b k d k x(t) k. (1) with the following initial conditions at time t = t 0 known y(t), dy(t),..., d k 1 y(t) k 1. (2) In most cases, t 0 equals 0. The highest derivative of y(t) gives the order of the differential equation. In (1), the order is N. The homogeneous component y h (t) is the output of the system when the input is zero. Hence, y h (t) is the solution to the homogeneous differential equation In order to determine y h (t), we hypothesize a solution of the form N k=0 a k d k y(t) k = 0. (3) y h (t) = Ae st, (4)
substitute in the differential equation, (1), and solve the resulting equation. We illustrate the procedure for calculating the homogeneous solution by considering an example. Example 1: Solving for the homogeneous solution. Consider a CT system modeled by the following differential equation 2 Substituting y h (t) = Ae st into the homogeneous equation, + 3 dy + 2y(t) = 2x(t). gives 2 + 3 dy + 2y(t) = 0 Ae st (s 2 + 3s + 2) = 0. Ignoring the trivial solution, i.e., assuming Ae st 0, the above equality condition gives the following quadratic equation, called the characteristic equation, in s, which has two roots at s = 1 and 2. The homogeneous solution is, therefore, given by s 2 + 3s + 2 = 0 y h (t) = A 1 e t + A 2 e 2t where A 1 and A 2 are constants determined from the initial conditions, as will be explained later. Repeated roots: The form of the homogeneous solution changes slightly when the characteristic equation has repeated roots. If a root s = a is repeated J times, then we include J distinct terms in the homogeneous solution associated with a, i.e., the homogeneous solution involves the following J functions and is given by e at, te at, t 2 e at,..., t J 1 e at () y h (t) = A 1 e at + A 2 te at + A 3 t 2 e at +... + A J t J 1 e at. (6) The procedure for calculating the homogeneous solution for differential equations with repeated roots is illustrated in example 2. Example 2: Characteristic equation with repeated roots. Consider the differential equation Its characteristic equation is given by d 3 y(t) 3 + 4 d2 y(t) 2 + dy + 2y(t) = x(t). s 3 + 4s 2 + s + 2 = 0 which has two repeated roots at s = 1 and one root at s = 2. The homogeneous solution is given by where A 1, A 2 and A 3 are constants. y h (t) = A 1 e t + A 2 te t + A 3 e 2t (7) Complex roots: Solving a characteristic equation in general may give rise to complex roots of the form, s = a + ĵ b. (8)
Input Particular Solution Constant A C Exponential Ae bt Ce bt Sinusoidal Acos(ω o t + φ) C 1 cos(ω o t) + C 2 sin(ω o t) Table 1: Particular solution corresponding to several common inputs. For differential equations with real coefficients, it can be proven that the roots occurs in conjugate pairs, i.e., if s = a + ĵ b is a root then s = a ĵ b is also a root to the same characteristic equation. For such complex roots, the homogeneous solution can be modified to the following form y h (t) = A 1 e at cos(bt) + A 2 e at sin(bt). (9) Example 3: Characteristic equation with complex roots. Assume a fourth order differential equation of the form which is represented by the following characteristic equation d 4 (t) 4 2d2 (t) 2 + 1 = 0 (10) s 4 2s 2 + 1 = 0. (11) The roots of the characteristic equation are given by s = ĵ, ĵ, ĵ, ĵ. Note that the roots are not only complex but repeated. The homogenous solution is therefore given by where A 1, A 2, A 3, and A 4 are constants. y h (t) = A 1 cos(t) + A 2 sin(t) + A 3 t cos(t) + A 4 t sin(t) (12) 3. PARTICULAR COMPONENT The particular component is denoted by y p (t) and represents the solution to the differential equation for a given input. It is usually obtained by assuming the system output has the same general form as the input. For example, if the input is x(t) = e bt, then we assume the output is of the form y p (t) = Ce bt and find the constant C so that y p (t) is a solution to the system s differential equation. Assuming an output of the same form as the input is consistent with our intuition that the output of the system be directly related to the input. The forms of the particular solutions associated with a few common input signals is given in table 1. The procedure for identifying a particular solution is illustrated in example 3. Example 4: Solving for the Particular solution. Consider the system of example 1 2 + 3 dy + 2y(t) = 2x(t). except now we are interested in calculating the particular solution of the differential equation. Assume that the input x(t) is given by x(t) = cost U(t). Using table 1, the particular solution may be assumed of the form By substitution in the differential equation, we have y p (t)(t) = C 1 cost + C 2 sin t ( C 1 cost C 2 sin t) + 3( C 1 sin t + C 2 cost) + 2(C 1 cost + C 2 sin t) = 2 cost or (C 1 + 3C 2 )cos t + ( 3C 1 + C 2 )sin t = 2 cost.
Equating the cosine and the sine terms on the left and right hand sides of the equation, we get a set of simultaneous equations given by C 1 + 3C 2 = 2 3C 1 + C 2 = 0 which has a solution at C 1 = 1/ and C 2 = 3/. Substituting for C 1 and C 2 results in the following particular solution y p (t) = 1 cost + 3 sin t. This approach for finding the particular solution is modified when the input is of the same form as one of the components of the natural response. We illustrate by an example where we also outline the modified procedure for calculating the particular solution. Example : Particular solution with input of the same form as the natural response. In example 2, assume the applied input is given by x(t) = 2e t and we are interested in finding the particular solution. Recall that the homogeneous solution for the differential equation is given by y h (t) = A 1 e t + A 2 te t + A 3 e 2t. (13) The input x(t) = 2e t is of the same form as the first two terms in the homogeneous solution. In this case, we must assume a particular solution that is independent of all terms in the natural response in order to obtain the forced response of the system. To achieve this, we multiply the form of the particular solution by the lowest power of t that will give a response component not included in the natural response. In this example, the particular solution is y p (t) = Ct 2 e t. (14) In order to evaluate the constant C, we substitute the value of y p (t) and x(t) in the system s differential equation repeated below for convenience d 3 y(t) 3 + 4 d2 y(t) 2 + dy + 2y(t) = x(t). Substituting the value of the first, second and third derivatives of the output y(t) and the input x(t), we get ( 6Ce t + 6Cte t Ct 2 e t) + 4 ( 2Ce t 4Cte t + Ct 2 e t) + ( 2Cte t Ct 2 e t) + 2Ct 2 e t = 2e t which simplifies to 2Ce t = 2e t. (1) From the above expression, it is straightforward to verify that C = 1. The particular component is, therefore, given by y p (t) = t 2 e t. (16)
4. COMPLETE RESPONSE The complete response of the system is the sum of the homogeneous component and the particular component using the specified initial conditions. Assuming the input is applied at t = 0, the procedure for evaluating the complete response is enlisted below: 1. Find the form of the homogeneous component y h (t) from the roots of the characteristic equation. 2. Find the particular solution y p (t) by assuming it of the same form as the input yet independent of all terms in the homogeneous component. 3. Determine the coefficients in the homogeneous component so that the overall response satisfies the actual initial condition specified with the differential equation. Example 6: Solve the differential equation with input x(t) given by and the initial conditions specified by 2 y(t) = y h (t) + y p (t) (17) + 3 dy + 2y(t) = 2x(t). x(t) = cost U(t) y(0) = 1 and From example 1, the homogeneous solution is given by y h (t) = dy t=0= 1. A 1 e t + A 2 e 2t and from the results in example 2, the particular solution is given by y p (t) = 1 cost + 3 sin t. Following item 3 in the listed algorithm, the complete solution is given by Substituting the initial conditions y(t) = 1 and dy y(t) = A 1 e t + A 2 e 2t + 1 cost + 3 sin t. = 1 for t = 0 in gives y(t) = and dy A 1 e t + A 2 e 2t + 1 cost + 3 sin t = A 1 e t 2A 2 e 2t 1 sin t + 3 cost A 1 + A 2 = 6 2A 1 A 2 = 2 which has the solution, A 1 = 1/ and A 2 = 4/. The complete solution to the differential equation for t 0 is therefore given by y(t) = 1 ( e t + 4e 2t + cost + 3 sint ).
. SUMMARY A direct method for solving linear, constant coefficient differential equations was presented.