1 / 165

CSE 551 Computational Methods 2018/2019 Fall Chapter 9-A Ordinary Differential Equations

CSE 551 Computational Methods 2018/2019 Fall Chapter 9-A Ordinary Differential Equations. Outline. Taylor Series Methods Runge-Kutta Methods Stability and Adaptive Runge-Kutta and Multistep Methods. References. W. Cheney, D Kincaid, Numerical Mathematics and Computing, 6ed, Chapter 10.

glaser
Download Presentation

CSE 551 Computational Methods 2018/2019 Fall Chapter 9-A Ordinary Differential Equations

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSE 551 Computational Methods 2018/2019 Fall Chapter 9-A Ordinary Differential Equations

  2. Outline Taylor Series Methods Runge-Kutta Methods Stability and Adaptive Runge-Kuttaand Multistep Methods

  3. References W. Cheney, D Kincaid, Numerical Mathematics and Computing, 6ed, Chapter 10

  4. Taylor Series Methods • Initial-Value Problem: Analytical versus Numerical Solution • Solving Differential Equations and Integration • Taylor Series Methods • Taylor Series Method of Higher Order • Types of Errors

  5. Initial-Value Problem: Analytical versus Numerical Solution An ordinary differential equation (ODE) equation - one or more derivatives of an unknown function A solution - differential equation specific function - satisfies the equation

  6. Examples t - independent variable x - dependent variable. name of the unknown function of the independent variable t: c - an arbitrary constant

  7. a DE not, in general, not determine a unique solution function accompanied by auxiliary conditions together with the DE specify the unknown function precisely.

  8. Inıtial-Value Problem initial-value problem for a first-order DE. x - function of t, (1): initial-value problem t - time and t = a - initial instant in time. determine the value of x at any time t before or after a.

  9. Examples examples of initial-value problems, with solutions: A numerical solution DE table; functional form of the solution remains unknown

  10. function f – depend on t and x If f not involve x, - second example – DE solved - indefinite integration. illustrate, C - x(5) = 17. C = 4 ln(5) − arctan(5) − 108.

  11. numerical solution DE: (a) the closed form solution may be very complicated and difficult to evaluate or (b) there is no other choice; that is, no closed-form solution can be found e.g., for the DE solution - taking the integral of the right-hand side. can be done in principle but not in practice. a function x exists dx/dt - right-hand member (3) but it is not possible to write x(t) in terms of familiar functions..

  12. Solving ODEs on a computer require a large number of steps with small step size, significant amount of roundoff error can accumulate. multiple-precision computations may be necessary on small-word-length computers.

  13. Solving Differential Equations and Integration close connection between solving DEs and integration e.g.: Integrating from t to t + h,

  14. Replacing the integral - numerical integration rules formula for solving the differential equation. Euler’s method - obtained from the left rectangle approximation The trapezoid rule

  15. Since x(t + h) appears on both sides of this equation, it is called an implicit formula. If Euler’s method x(t + h) on the right-hand side, then we obtain the Runge-Kutta formula of order 2—namely, Equation (10) in Section 10.2.

  16. Fundamental Theorem of Calculus, approximate numerical value for the integral can be computed by solving the following initial-value problem for x(b):

  17. Taylor Series Methods represent the solution of a DE locally by a few terms of its Taylor series. assume that solution function x - represented Taylor series:

  18. numerical purposes, Taylor series truncated after m+1 terms compute x(t + h) rather accurately h is small and x(t), x’(t), x’’(t), . . . , x(m)(t) - known. When terms through hmx(m)(t)/m! included in the Taylor series, the method Taylor series method of order m.

  19. Euler’s Method Pseudocode Taylor series method of order 1 - Euler’s method approximate values of the solutions to the initial-value problem: over the interval [a, b], first two terms - Taylor series (5) : the formula:

  20. can be used to step from t = a to t = b with n steps of size h = (b−a)/n. The pseudocode can be written as follows, where some prescribed values for n, a, b, and xaare used:

  21. pseudocodefor Euler’s method

  22. Example 1 Using Euler’s method, compute an approximate value for x(2) for the differential equation x’ = 1 + x2 + t3 with the initial value x(1) = −4 using 100 steps.

  23. Solution Use the pseudocode above with the initial values given and combine with the following function: The computed value is x(2) ≈ 4.23585

  24. computer program - execute Euler’s method simple problem: x(2) ≈ 7.3891. The solution, x(t) = et, points produced by Euler’s method - dots. why the dots are always below the curve?

  25. Euler’s metho curves 0

  26. some questions such as: How accurate are the answers? Are higher-order Taylor series methods ever needed? Euler’s method - not very accurate only two terms in the Taylor series (5) –used truncation error is O(h2).

  27. Taylor Series Method of Higher Order Example 1: Taylor series method of higher order. initial-value problem: functions DE differentiated several times with respect to t (chain rule):

  28. numerical values of t and x(t) known, x’(t), x’’(t), x’’’(t), and x(4)(t) first five terms - Taylor series (5) x(1) = −4, suitable starting point, n = 100 – h. approximation - x(a + h) - from (5) and (8) same process - repeated compute: x(a + 2h) form x’(a + h), x’’(a + h), . . . , x(4)(a + h).

  29. determine - interval a = 1t2 = b, and 100 steps. In each step, current value of t integer multiple of the step size h. The assignment statements that define x’, x’’, x’’’, and x(4)carrying out calculations of the derivatives according to (8)

  30. evaluation of the TS in (5) five terms. polynomial in h, nested multiplication, The computation t ← t + h may cause a small amount of roundoff error to accumulate in the value of t avoided by using t ← a + kh.

  31. two terms in TS (Euler’s method) not accurate - five terms : Euler’s Method TS Method (Order 4) x(2) ≈ 4.23585 41 x(2) ≈ 4.37120 96 correct value to more significant figures: x(2) ≈ 4.37122 1866 computations were done with more precision show that lack of precision was not a contributin factor.

  32. Types of Errors what sort of accuracy expected? Are all the digits for the variable x accurate? not! not easy to say - how many digits are reliable a coarse assessment: Since terms up to (1/24)h4x(4)(t) included, first term not included in TS: (1/120) h5x(5)(t). The error may be larger than this, but the factor h5 = (10−2)5 ≈ 10−10 affecting only the tenth decimal place.

  33. Trancation Error two types of errors At each step, if x(t) known and x(t+h) computed from the first fewterms of the Taylor series, an error occurs truncated theTaylor series truncation error - local truncation error. In the example, roughly (1/120) h5x(5)(ξ ). local truncation error of order h5 - O(h5).

  34. Accumulaed Error The second type of error accumulated effects of all local truncation errors calculated value of x(t +h) - in error x(t) is already wrong previous truncation errors another local truncation error occurs in the computation of x(t + h)

  35. Roundoff error Additional sources of errors: roundoff error not serious in any one step of the solution procedure, after hundreds or thousands of steps, accumulate and contaminate the calculated solution seriously. an error - made at a certain step carried forward into all succeeding steps

  36. Runge-Kutta Methods • Taylor Series for f(x, y) • Runge-Kutta Method of Order 2 • Runge-Kutta Method of Order 4

  37. Runge-Kutta Methods imitate the Taylor series method without analytic differentiation of the original DE. Taylor series method on the initial-value problem

  38. RK method of order 2 need to obtain x, x’ , . . . differentiating the function f . serious obstacle a method for solving (1) writing a code to evaluate f The Runge-Kutta (RK) methods. RK method of order 2 low precision RK method of order 4 - common use.

  39. Hearth of an IV Problem • heart of - initial-value problem • advancing the solution function one step at a time; • formula for x(t + h) - known quantities • x(t), x(t − h), x(t − 2h), . . . • At the beginning, only x(a) is known.

  40. Taylor Series for f(x, y) Taylor series in two variables: f and all partial derivatives evaluated at (x, y)

  41. Taylor series - truncated error term or remainder term - restore the equality: point (xb, yb) lies on the line segment joins (x, y) to (x + h, y + k) in the plane subscripts - denote partial derivatives.

  42. functions - order of subscripts immaterial; e.g. fxt= ftx. special cases:

  43. Runge-Kutta Method of Order 2 Runge-Kutta method of order 2 - a formula: two function evaluations of the special form linear combination of these - added to the value of x at t - at t +h:

  44. determine constants w1, w2, α, and β (5) as accurate as possible reproduce as many terms as possible in the TS

  45. compare (5) with (6). One way to force them to agree up through the term in h - set w1 = 1 and w2 = 0 x = f . Euler’s method - order of precision is only 1. Agreement up through the h2 term is possible by a more adroit choice of parameters. apply two-variable form TS - final term in (5). n = 2 - two-variable TS Formula (3), with t, αh, x, and βh f playing the role of x, h, y, and k, respectively:

  46. new form for (5):

  47. Equation (6) - new form by using DE (1). x’ = f , (6) implies that Agreement between (7) and (8)

  48. solution The resulting second-order Runge-Kutta method is then, from Equation (5),: equivalently,

  49. (10) - solution function at t + h – two evaluations of the function f other solutions - nonlinear System (9) possible. For example, α can be arbitrary,

More Related