Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Topic 19 Notes Jeremy Orloff 19 Variation of parameters; exponential inputs; Euler’s method 19.1 Variation of parameters As with ordinary first order linear equations we have the method of variation of parameters for solving inhomegeneous equations. Since this involves integration, matrix inverses and matrix multiplication it is our last choice. Nonetheless, sometimes it’s the only method available. In addition, the derivation of the formula is really very pretty. Suppose we have a fundamental matrix Φ(t) for the homogeneous linear equation x0 = A(t)x (H) Remember this means that Φ has columns which are solutions to (H). 19.2 Variation of parameters formula Now suppose we want to solve x0 = A(t)x + F(t). (I) The equation (I) has solution given by the variation of parameters formula Z −1 x(t) = Φ(t) · Φ(t) · F(t) dt + C . Proof. (Remember this.) We will use a form of the method of optimism to derive this formula. We know the general homogeneous solution is x = Φ · c for a constant vector c. The vector c is called a parameter. Variation of parameters is an old-fashioned way of saying let’s optimistically make it a (dependent) variable u(t). So, we try a solution of the form x(t) = Φ(t) · u(t). The function u(t) is unknown, we substitute our guess into (I) and see what u(t) needs to be: Φ0 · u + Φ · u0 = AΦ · u + F So, (don’t forget Φ0 = AΦ.) AΦ · u + Φ · u0 = AΦ · u + F ⇒ Φ · u0 = F. 1 19 Variation of parameters; exponential inputs; Euler’s method This last equation is easy to solve 0 −1 u =Φ Z · F ⇒ u(t) = Φ−1 (t) · F(t) dt + C. We take this formula for u(t) and use it in our trial solution Z −1 x(t) = Φ(t) · u(t) = Φ(t) · Φ(t) · F(t) dt + C . QED. 0 Example 19.1. Solve x = 6 5 1 2 x+ et e5t . 1 answer: Let’s introduce some notation to save typing: A = ,F= . t et 5e7t . We know the fundamental matrix from an earlier example: Φ(t) = −et e7t 7t −8t e −5e7t So, Φ−1 (t) = e 6 . et et 6 5 1 2 Calculating with the variation of parameters we get Z x = Φ(t) Φ−1 (t) · F(t) dt t Z −8t 7t e e −5e7t e = Φ(t) · 5t dt t t e e e 6 Z 1 1 − 5e4t dt = Φ(t) 6 e−6t + e−2t 1 t − 45 e4t + c1 = Φ(t) − 1 e−6t − 1 e−2t + c2 6 t 56 5t 5 2t 5 5t 1 te − 4 e − 6 e − 2 e + c1 et + 5c2 e7t = 6 −tet + 54 e5t − 16 et − 12 e5t − c1 et + c2 e7t 1 1 1 t 5t −15/4 t −5/6 t 7t 5 = te +e +e + c1 e + c2 e . −1 3/4 −1/6 −1 1 6 Notice the homogeneous solution appearing with the constants of integration. 19.2.1 Definite integral version of variation of parameters The equation (I) with initial condition xt0 = b has definite integral solution Z t −1 x(t) = Φ(t) Φ (u) · F(u) du + C where C = Φ−1 (t0 ) · b. t0 2 19 Variation of parameters; exponential inputs; Euler’s method 19.3 Exponential input theorem The above example of the variation of parameters formula should be enough to convince you that we’d like better techniques for solving inhomogeneous systems. Fortunately, for many of the systems we care about in 18.03 this is the case. The first formula we’ll look at is for exponential input. Exponential input theorem. For a constant matrix A and a constant vector k the DE x0 = Ax + eat k has a particular solution: xp = −eat (A − aI)−1 k This formaula is valid as long as A − aI is invertible, i.e. as long as a is not an eigenvalue of A. Proof. Not surprisingly we discover this formula by the method of optimism. We try a solution of the form xp (t) = eat v, where v is a constant vector. Plug the guess into the DE and solve for v: xp 0 = aeat v = eat Av + eat k ⇒ −(A − aI)v = k ⇒ v = −(A − aI)−1 k. Thus, we have found a particular solution xp (t) = eat v = −eat (A − aI)−1 k. QED 2t x 6 5 x e Example 19.2. Find a solution to = + 3e2t y 1 2 y 0 2t 1 . The exponential input answer: We rewrite the equation as x = Ax + e 3 −1 1 4 5 1 2t −1 2t theorem gives us a solution xp = −e (A − 2I) = −e 3 1 0 3 2t 0 5 1 15 = − 51 e2t = − e5 1 −4 3 −11 2t x 6 5 x 3e Example 19.3. Solve = + . y 1 2 y 5e3t 0 3 2t 3t answer: Write the input as e +e . Now you can solve the equation 0 5 for each input term and then use superposition. There are more examples in the next section. 19.4 Exponential input theorem examples Example 19.4. Find the general solution to 3 x0 = 3x − y + e2t y 0 = 4x − y − e2t 19 Variation of parameters; exponential inputs; Euler’s method 1 3 −1 2t . The expoanswer: In matrix form the equation is x = x+e −1 4 −1 nential input theorem tells us a particular solution is −3 1 1 1 2t 4 2t 2t −1 . =e = −e xp = −e (A − 2I) 5 −4 1 −1 −1 0 We’ll let you verify the calculation of the inverse. Likewise we’ll let you find the homogeneous solution needed for the general solution. Example 19.5. Find a particular solution to x0 = 3x − y + 3 y 0 = 4x − y + 2 answer: Note that we could use the exponential input theorem, where the exponent is a = 0. Instead we’ll just try a constant solution and solve for its exact value. 3 0 Try x = v. Substitution into the DE gives x = 0 = Av + . 2 −1 3 −1 3 1 1 −1 3 So, v = −A =− = . That is xp (t) = . 2 4 −1 2 6 6 Again, we’ll let you verify the calculation of the inverse. 0 1 2 x cos(t) x = + . Example 19.6. Find a particular solution to y0 2 1 y 0 answer: To use the exponential input theorem we first need to use complex replacement. The complexified equation is 1 2 0 it 1 z = z+e , where x = Re(z). 2 1 0 Now we set up the exponential input theorem −1 1 1−i 2 1 − i −2 −1 = (A − iI) = 2 1−i −2i − 4 −2 1 − i −2 1 1 1 it −1 1 it 1 − i it 1 − i = 2i+4 e . So, zp = −e (A − iI) = − −2i−4 e 0 −2 1 − i 0 −2 To find the real part of zp we work in polar coordinates. First we write the various complex numbers in polar form: √ 2i + 4 = 2 5eiφ1 , where φ1 = Arg(2i + 4) = tan.5 in the first quadrant. √ Likewise 1 − i = 2eiφ2 ; , where φ2 = −π/4 . √ iφ √ i(t+φ −φ ) 2 1 −eit 1 2e 2e 2 So zp = √ =− √ . −2 −2ei(t−φ1 ) 2 5eiφ1 2 5 Taking the real part: √ xp = Re(zp ) = 2 cos(t + φ2 − φ1 ) −2 cos(t − φ1 ) 4 19 Variation of parameters; exponential inputs; Euler’s method Here is the same calculation in rectangular coordinates. I think the arithmetic is more error prone and the answer is harder to interpret. 4 − 2i 1 − i 1 1 1−i 1 − 3i = = . −2 2i + 4 −2 20 10 −4 + 2i So, 1 1 1 − 3i cos(t) + 3 sin(t) + i(sin(t) − 3 cos(t)) = zp = (cos(t)+i sin(t)) −4 + 2i 10 10 −4 cos(t) − 2 sin(t) + i(−4 sin(t) + 2 cos(t)) Thus, 1 xp (t) = Re(zp (t)) = 10 cos(t) + 3 sin(t) . −4 cos(t) − 2 sin(t) 19.5 Euler’s method Euler’s method works without change for systems. Consider a first order system: x = F(x, t), x(t0 ) = x0 . Using stepsize h we have the same algorithm as for ordinary DE’s. m = F(xn , tn ) ⇒ xn+1 = xn + hm, tn+1 = tn + h. Again, just like for ordinary DE’s, there are other, better, algorithms for choosing m or varying h. 0 y 1 x =t , x(1) = . Example 19.7. Consider x 0 y x Let x = and use h = .5 to estimate x(2). y n 0 1 2 tn xn 1 0 1 .5 1.375 1.25 1.0 1.5 2.0 m = F(xn , tn ) 0 1 .75 1.5 5