Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 40 Numerical Analysis. Chapter 7 Ordinary Differential Equations.

Similar presentations


Presentation on theme: "Lecture 40 Numerical Analysis. Chapter 7 Ordinary Differential Equations."— Presentation transcript:

1 Lecture 40 Numerical Analysis

2 Chapter 7 Ordinary Differential Equations

3 Introduction Taylor Series Euler Method Runge-Kutta Method Predictor Corrector Method

4 RUNGA- KUTTA METHODS

5 We considered the IVP We also defined and took the weighted average of k 1 and k 2 and added to y n to get y n+1

6 We obtained Implying

7 We considered two cases, Case I We choose W 2 = 1/3, then W 1 = 2/3 and

8 Case II: We considered W 2 = ½, then W 1 = ½ and Then

9 The fourth-order R-K method was described as

10 where

11 PREDICTOR – CORRECTOR METHOD

12 Milne’s Method It is a multi-step method where we assume that the solution to the given IVP is known at the past four equally spaced point t 0, t 1, t 2 and t 3.

13 Alternatively, it can also be written as This is known as Milne’s predictor formula.

14 Similarly, integrating the original over the interval t 0 to t 2 or s = 0 to 2 and repeating the above steps, we get which is known as Milne’s predictor formula.

15 In general, Milne’s predictor- corrector pair can be written as

16 Adam-Moulton Method It is another predictor- corrector method, where we use the fact that the solution to the given initial value problem is known at past four equally spaced points t n, t n-1, t n-2, t n-3.

17 The task is to compute the value of y at t n+1. Let us consider the differential equation

18 Integrating between the limits t n to t n+1, we have That is,

19 To carry out integration, we proceed as follows. We employ Newton’s backward interpolation formula, so that

20 After substitution, we obtain

21 Now by changing the variable of integration (from t to s), the limits of integration also changes (from 0 to 1), and thus the above expression becomes

22 Actual integration reduces the above expression to Now substituting the differences such as

23 Equation simplifies to Alternatively, it can be written as This is known as Adam’s predictor formula.

24 The truncation error is To obtain corrector formula, we use Newton’s backward interpolation formula about f n+1 instead of f n.

25 We obtain Carrying out the integration and repeating the steps, we get the corrector formula as

26 Here, the truncation error is The truncation error in Adam’s predictor is approximately thirteen times more than that in the corrector, but with opposite sign.

27 In general, Adam-Moulton predictor-corrector pair can be written as

28 Example Using Adam-Moulton predictor-corrector method, find the solution of the initial value problem at t = 1.0, taking h = 0.2. Compare it with the analytical solution.

29 Solution In order to use Adam’s P-C method, we require the solution of the given differential equation at the past four equally spaced points, for which we use R-K method of 4 th order which is self starting.

30 Thus taking t 0 =0, y 0 = 1, h = 0.2, we compute k 1 = 0.2, k 2 = 0.218, k 3 = 0.2198, k 4 = 0.23596, and get

31 Taking t 1 = 0.2, y 1 = 1.21859, h = 0.2, we compute k 1 = 0.23571, k 2 = 0.2492, k 3 = 0.25064, k 4 = 0.26184, and get

32 Now, we take t 2 = 0.4, y 2 = 1.46813, h = 0.2, and compute k 1 = 0.2616, k 2 = 0.2697, k 3 = 0.2706, k 4 = 0.2757 to get

33 Thus, we have at our disposal

34 Now, we use Adam’s P-C pair to calculate y (0.8) and y (1.0) as follows: Thus (1)

35 From the given differential equation, we have Therefore, Therefore,

36 Hence, from Eq. (1), we get Now to obtain the corrector value of y at t = 0.8, we use (2)

37 But, Therefore, Proceeding similarly, we get (3)

38 Noting that we calculate we calculate Now, the corrector formula for computing y 5 is given by (4)

39 But, Thus, finally we get (5)

40 The analytical solution can be seen in the following steps. After finding integrating factor and solving, we get

41 Integrating, we get That is, Now using the initial condition, y(0) = 1, we get c = – 1.

42 Therefore, the analytical solution is given by from which, we get

43 Convergence and Stability Considerations

44 The numerical solution of a differential equation can be shown to converge to its exact solution, if the step size h is very small.

45 The numerical solution of a differential equation is said to be stable if the error do not grow exponentially as we compute from one step to another.

46 Stability consideration are very important in finding the numerical solutions of the differential equations either by single-step methods or by using multi- step methods.

47 However, theoretical analysis of stability and convergence of R -K methods and P –C methods are highly involved and obtain numerically stable solution using 4 th order R – K method to the simple problem y’ = Ay gives us stability condition as -2.78<Ah

48 In practice, to get numerically stable solutions to similar problems, we choose the value of h much smaller than the value given by the above condition and also check for consistency of the result.

49 Another topic of interest which is not considered, namely the stiff system of differential equations that arises in many chemical engineering systems, such as chemical reactors, where the rate constants for the reactions involved are widely different.

50 Most of the realistic stiff DE do not have analytical solutions and therefore only numerical solutions can be obtained.

51 However, to get numerically stable solutions, a very small step size h is required, to use either R-K methods or P – C methods. More computer time is required

52 Lecture 40 Numerical Analysis


Download ppt "Lecture 40 Numerical Analysis. Chapter 7 Ordinary Differential Equations."

Similar presentations


Ads by Google