Computation Fluid Dynamics

Size: px
Start display at page:

Download "Computation Fluid Dynamics"

Transcription

1 Computation Fluid Dynamics CFD I Jitesh Gajjar Maths Dept Manchester University Computation Fluid Dynamics p.1/189

2 Garbage In, Garbage Out We will begin with a discussion of errors. Useful to understand different types of errors which can arise when doing numerical computation. Roundoff errors Computation Fluid Dynamics p.2/189

3 Garbage In, Garbage Out We will begin with a discussion of errors. Useful to understand different types of errors which can arise when doing numerical computation. Roundoff errors Errors in modelling Computation Fluid Dynamics p.2/189

4 Garbage In, Garbage Out We will begin with a discussion of errors. Useful to understand different types of errors which can arise when doing numerical computation. Roundoff errors Errors in modelling Programming errors, ie bugs Computation Fluid Dynamics p.2/189

5 Garbage In, Garbage Out We will begin with a discussion of errors. Useful to understand different types of errors which can arise when doing numerical computation. Roundoff errors Errors in modelling Programming errors, ie bugs Truncation, discretization errors. Computation Fluid Dynamics p.2/189

6 Garbage In, Garbage Out We will begin with a discussion of errors. Useful to understand different types of errors which can arise when doing numerical computation. Roundoff errors Errors in modelling Programming errors, ie bugs Truncation, discretization errors. Computation Fluid Dynamics p.2/189

7 Measures of error Need some way to quantify errors. 2 useful measures. Computation Fluid Dynamics p.3/189

8 Measures of error Need some way to quantify errors. 2 useful measures. Absolute error If φ is an approximation to a quantity φ then the Absolute error is defined by φ φ Computation Fluid Dynamics p.4/189

9 Measures of error Need some way to quantify errors. 2 useful measures. Absolute error If φ is an approximation to a quantity φ then the Absolute error is defined by φ φ Relative error The Relative error is defined by φ φ, φ 0 φ Computation Fluid Dynamics p.4/189

10 Roundoff errors These arise when a computer is used for doing numerical computation. Computation Fluid Dynamics p.5/189

11 Roundoff errors These arise when a computer is used for doing numerical computation. Example Inexact representation of numbers eg, π, 2. Computation Fluid Dynamics p.5/189

12 Roundoff errors These arise when a computer is used for doing numerical computation. Example Inexact representation of numbers eg, π, 2. Rounding and chopping errors. Remember the way certain quantities are computed is under your control. Computation Fluid Dynamics p.5/189

13 Errors in modelling Example: Replacing full N-S equations with Euler equations. Neglect of viscous terms means no matter how accurate the numerical solution, viscous effects will not be captured where important. Computation Fluid Dynamics p.6/189

14 Programming errors, ie bugs These are all too familiar! Computation Fluid Dynamics p.7/189

15 Programming errors, ie bugs These are all too familiar! The computer is only doing what you ask it to do. Computation Fluid Dynamics p.7/189

16 Programming errors, ie bugs These are all too familiar! The computer is only doing what you ask it to do. Even NASA has made blunders. Computation Fluid Dynamics p.7/189

17 Subtle errors Suppose φ = O(10 8 ), φ = O(10 8 ) then something like diff = MAX(ABS(phi-phistar)) tol= 1.e-6 IF(diff < tol) EXIT in numerical codes will be wrong usage. The condition is always satisfied even though relative error is O(1). Computation Fluid Dynamics p.8/189

18 Truncation, discretization errors. A pproximate by U xx = f(x) (u(x i+1 ) 2u(x i ) + u(x i 1 )) h 2 = f(x i ). Computation Fluid Dynamics p.9/189

19 Truncation, discretization errors. A pproximate by U xx = f(x) (u(x i+1 ) 2u(x i ) + u(x i 1 )) h 2 = f(x i ). This gives rise to a truncation error ie Computation Fluid Dynamics p.9/189

20 Truncation, discretization errors. A pproximate by U xx = f(x) (u(x i+1 ) 2u(x i ) + u(x i 1 )) h 2 = f(x i ). This gives rise to a truncation error ie τ(x i ) = U xx (x i ) f(x i ) = h2 12 U xxxx (x i ) +... Computation Fluid Dynamics p.9/189

21 Initial value problems Here we will look at the solution of ordinary differential equations of the type, say dy dx = f(x, y), a x b, subject to an initial condition y(a) = α Computation Fluid Dynamics p.10/189

22 Example Solve dy dx = y(1 y ), 0 x, 4 subject to an initial condition y(0) = 1 Computation Fluid Dynamics p.11/189

23 Soln of ODE s The methods also generalise to systems of equations i.e. dy = F(x, Y), dx a x b, where Y = (y 1 (x), y 2 (x),..., y N (x)) T, F = (f 1 (x, Y), f 2 (x, Y),..., f N (x, Y)) T, with initial data Y(a) = α, say, where α = (α 1, α 2,..., α N ) T. Computation Fluid Dynamics p.12/189

24 Example Solve y 2xyy + y 2 = 1, y(1) = 1, y (1) = 2. The equivalent first order system is obtained with (y 1 (x), y 2 (x)) T = (y(x), y (x)) T, f 1 (x, y 1, y 2 ) = y 2 (x), f 2 (x, y 1, y 2 ) = 1 + 2xy 1 (x)y 2 (x) y1(x), 2 and initial condition (y 1 (1), y 2 (1)) T = (1, 2) T. Computation Fluid Dynamics p.13/189

25 A mathematical result. Suppose we define D to be the domain D = {(x, y) a x b, < y < } and f(x, y) is continuous on D. If f(x, y) satisfies a Lipschitz condition on D then the ODE has a unique solution for a x b. Computation Fluid Dynamics p.14/189

26 A mathematical result. Suppose we define D to be the domain D = {(x, y) a x b, < y < } and f(x, y) is continuous on D. If f(x, y) satisfies a Lipschitz condition on D then the ODE has a unique solution for a x b. Recall f(x, y) satisfies a Lipschitz condition on D means that there exists a constant L > 0 (called the Lipschitz constant) such that f(x 1, y 1 ) f(x 2, y 2 ) L y 1 y 2 whenever (x 1, y 1 ), (x 2, y 2 ) belong to D. Computation Fluid Dynamics p.14/189

27 Euler s Method This is the simplest of techniques for the numerical solution of ODE s. For simplicity define an equally spaced mesh x j = a + jh, j = 0,.., N where h = (b a)/n is called the step size. h a = x 0 x 1 x i x i+1 x N = b We can derive Euler s method as follows. Computation Fluid Dynamics p.15/189

28 Euler s Method Suppose y(x) is the unique solution to the ODE, and twice differentiable. Then by Taylor s theorem we have y(x i+1 ) = y(x i + h) = y(x i ) + y (x i )h + h2 2 y (ξ) where x i ξ x i+1. Computation Fluid Dynamics p.16/189

29 Euler s Method But from the differential equation y (x i ) = f(x i ), and y i = y(x i ). This suggests the scheme for calculating the w i. This is Euler s method w 0 = α w i+1 = w i + hf(x i, w i ), i = 1, 2,.., N 1, Computation Fluid Dynamics p.17/189

30 Truncation error for Euler s method Suppose that y i = y(x i ) is the exact solution at x = x i. Then the truncation error is defined by τ i+1 (h) = y i+1 (y i + hf(x i, y i )) h for i = 0, 1,..., N 1. = y i+1 y i h f(x i, y i ), Computation Fluid Dynamics p.18/189

31 Truncation error From the above we find that τ i+1 (h) = h 2 y (ξ i ) for some ξ i in (x i, x i+1 ). So if y (x) is bounded by a constant M in (a, b) then τ i+1 (h) h 2 M. Thus we see that the truncation error for Euler s method is O(h). Computation Fluid Dynamics p.19/189

32 In general if τ i+1 = h p we say that the method is of order h p. In principle if h decreases, we should be able to achieve greater accuracy, although in practice roundoff error limits the smallest size of h that we can take. Computation Fluid Dynamics p.20/189

33 Higher order methods, Modified Euler The modified Euler method is given by w 0 = α k 1 = hf(x i, w i ), w i+1 = w i + h 2 [f(x i, w i ) + f(x i+1, w i+1 )], i = 1, 2,.., N 1, This has truncation error O(h 2 ). Sometimes this is also called a Runge-Kutta method of order 2. Computation Fluid Dynamics p.21/189

34 Modified Euler Notice Euler s method is implicit w 0 = α k 1 = hf(x i, w i ), w i+1 = w i + h 2 [f(x i, w i ) + f(x i+1, w i+1 )], i = 1, 2,.., N 1, Computation Fluid Dynamics p.22/189

35 Modified Euler Notice Euler s method is implicit w 0 = α k 1 = hf(x i, w i ), w i+1 = w i + h 2 [f(x i, w i ) + f(x i+1, w i+1 )], i = 1, 2,.., N 1, Thus some iteration may be necessary. Computation Fluid Dynamics p.22/189

36 Runge-Kutta method of order 4 One of the most common Runge-Kutta methods of order 4 is given by w 0 = α, k 1 = hf(x i, w i ), k 2 = hf(x i + h 2, w i k 1) k 3 = hf(x i + h 2, w i k 2) k 4 = hf(x i+1, w i + k 3 ) w i+1 = w i (k 1 + 2k 2 + 2k 3 + k 4 ), for i = 0, 1,.., N 1 Computation Fluid Dynamics p.23/189

37 Systems of equations All these methods generalise to a system of first order equations. Thus for instance the RK(4) method above becomes Computation Fluid Dynamics p.24/189

38 Runge-Kutta 4th order w 0 = α, k 1 = hf(x i, w i ), k 2 = hf(x i + h 2, w i k 1) k 3 = hf(x i + h 2, w i k 2) k 4 = hf(x i+1, w i + k 3 ) w i+1 = w i (k 1 + 2k 2 + 2k 3 + k 4 ), for i = 0, 1,.., N 1 Computation Fluid Dynamics p.25/189

39 m-step multi-step method The methods discussed above are called one-step methods. Methods that use the approximate values at more than one previous mesh point are called multi-step methods. There are two distinct types worth mentioning. These are of the form Computation Fluid Dynamics p.26/189

40 Two types w i+1 = c m 1 w i + c m 2 w i c 0 w i+1 m +h[b m f(x i+1, w i+1 ) + b m 1 f(x i, w i ) b 0 f(x i+1 m, w i+1 m )] If b m = 0 so that there is no term with w i+1 on the right hand side of (*), the method is explicit. If b m 0 we have an implicit method. Computation Fluid Dynamics p.27/189

41 Adams-Bashforth 4th order method (explicit) Here we have w 0 = α, w 1 = α 1, w 2 = α 2, w 3 = α 3, where these values are obtained using other methods such as RK(4) for instance. Then for i = 3, 4,..., N 1 we use w i+1 = w i + h 24 [55f(x i, w i ) 59f(x i 1, w i 1 ) + 37f(x i 2, w i 2 ) 9f(x i 3, w i 3 )]. Computation Fluid Dynamics p.28/189

42 Boundary Value Problems - Shooting Methods Consider the differential equation d 2 y dx 2 + k dy dx + xy = 0, y(0) = 0, y(1) = 1. This is an example of a boundary value problem. Why? Conditions have to satisfied at both ends. Computation Fluid Dynamics p.29/189

43 BVP If we write this as a system of first order equations we have Y 1 = y, Y 2 = dy dx, dy 1 dx = Y 2, dy 2 dx = ky 2 xy 1. The boundary conditions give Y 1 (0) = 0, Y 1 (1) = 1. We do not know the value of Y 2 (0). Computation Fluid Dynamics p.30/189

44 BVP Suppose we guess the value of Y 2 (0) = g, say. Then we can integrate the system with the initial condition Y(0) = ( Y1 (0) Y 2 (0) ) = ( 0 g ), Computation Fluid Dynamics p.31/189

45 BVP This will give us Y(1) = Y 1(1) Y 2 (1) = β 1 β 2, Computation Fluid Dynamics p.32/189

46 BVP This will give us Y(1) = Y 1(1) Y 2 (1) = β 1 β 2, But β 1 will not necessarily satisfy the required condition Y 1 (1) = 1, So now need to iterative to try and get the correct value of g such that the required condition at x = 1 is satisfied. Computation Fluid Dynamics p.32/189

47 BVP, shooting To do this define φ(g) = Y 1 (1; g) 1, We want to find the value of g such that φ(g) = 0. This gives rise to the idea of a shooting method. Computation Fluid Dynamics p.33/189

48 Shooting Method Suppose that we have a guess g and we seek a correction dg such that φ( g + dg) = 0. By Taylor expansion we have φ( g + dg) = φ( g) + dφ dg ( g)dg + O(dg2 ). This suggests that we take dg = φ( g) φ ( g), and hence a new value for g is g + dg. Computation Fluid Dynamics p.34/189

49 Shooting- secant method Hence g n+1 = g n φ(g n) φ (g n ), Computation Fluid Dynamics p.35/189

50 Secant method Now we are required to find φ (g n ). How can we do this? One way is to estimate φ (g n ) by This gives φ (g n ) = φ(g n) φ(g n 1 ) g n g n 1. g n+1 = g n φ(g n)(g n g n 1 ) φ(g n ) φ(g n 1 ), which is known as the secant method. Computation Fluid Dynamics p.36/189

51 Shooting- Newton s method Consider again with Y(0) = (0, g) T. Now dy 1 dx = Y 2, dy 2 dx = ky 2 xy 1, φ (g n ) = Y 1 g (1; g), Thus differentiate the original system of equations and boundary conditions with respect to g. Computation Fluid Dynamics p.37/189

52 Shooting- Newton s method d dx ( Y g d dx ) ( Y g Y 2 g = k Y 2 x Y 1 g g ) x=0 = 0. 1, The system defines another initial value problem with given initial conditions. Computation Fluid Dynamics p.38/189

53 Shooting- Newton s method Note that φ (g) = Y 1 g (1; g). From the solution of the above we can extract (x = 1) and hence compute dg update g. Y 1 g This forms the basis of Newton s method combined with shooting, to solve boundary value problems. Computation Fluid Dynamics p.39/189

54 Newton- augmented system Can also use an augmented system where we define Y 1 = y, and then d dx Y 1 Y 2 Y 3 Y 4 Y 2 = dy dx, = Y 2 ky 2 xy 1 Y 4 ky 4 xy 3 Y 3 = y g = Y 1 g, Y 4 = Y 2 g,, Y(0) = Y 1 (0) Y 2 (0) Y 3 (0) Y 4 (0) = 0 g 0 1 Computation Fluid Dynamics p.40/189

55 Multiple shooting Consider d 4 y dx = 4 y3 ( dy dx )2, dy y(0) = 1, dx (0) = 0, y(1) = 2, dy (1) = 1, dx We need two starting values at x = 0 and then we will have two conditions to satisfy at x = 1. Computation Fluid Dynamics p.41/189

56 Multiple shooting Define Y 1 = y, Y 2 = y, Y 3 = y, y 4 = y, We will need to guess for Y 3 (0) = e, say, and Y 4 (0) = g. Computation Fluid Dynamics p.42/189

57 Multiple shooting φ 1 (e, g) = Y 1 (x = 1; e; g) 2, φ 2 (e, g) = Y 2 (x = 1; e; g) 1. We need to iterative on both c and g to ensure that the remaining conditions are satisfied. To find corrections, need Taylor expansion for function of two variables. Computation Fluid Dynamics p.43/189

58 Multiple shooting To obtain the corrections to guessed values ẽ, g we have φ 1 (ẽ + de, g + dg) = 0 = φ 1 (ẽ, g) + de φ 1 e (ẽ, g) + dg φ 1 g (ẽ, φ 2 (ẽ + de, g + dg) = 0 = φ 2 (ẽ, g) + de φ 2 e (ẽ, g) + dg φ 2 g (ẽ, Computation Fluid Dynamics p.44/189

59 Multiple shooting Multidimensional case Vector of guesses g. We can find the corrections dg as dg = J 1 ( g)φ( g), and φ is the vector of con- where J is the Jacobian φ i g k ditions. Computation Fluid Dynamics p.45/189

60 Richardson Extrapolation Suppose that we use a method with truncation error of O(h m ) to compute an approximation w i. We can use Richardson extrapolation to get an approximation with greater accuracy. Computation Fluid Dynamics p.46/189

61 Richardson extrapolation Suppose w (1) i is approximation with step size h and w (2) i with step size 2h. Then we can write and w (1) i = y i + Eh m + E 1 h m , w (2) i = y i + E(2h) m + E 1 (2h) m Computation Fluid Dynamics p.47/189

62 Richardson extrapolation Then we can eliminate the E term to get Thus 2 m w (1) i w (2) i = (2 m 1)y i + O(h m+1 ). wi = 2m w (1) i w (2) i 2 m 1 is a more accurate approximationto the solution than w (1) i or w (2) i. Computation Fluid Dynamics p.48/189

63 Richardson extrapolation Then we can eliminate the E term to get Thus 2 m w (1) i w (2) i = (2 m 1)y i + O(h m+1 ). wi = 2m w (1) i w (2) i 2 m 1 is a more accurate approximationto the solution than w (1) i or w (2) i. For a 4th order Runge-Kutta method the above gives wi = 16w(1) i w (2) i. 15 Computation Fluid Dynamics p.48/189

64 Solution of BVP using finitedifferences Boundary value problems can also be tackled directly using finite-differences or some other technique such as spectral approximation. We will look at one specific example with finite-differences. Consider d 2 y dx = (32 + 2x3 y dy ), 1 x 3, dx y(1) = 17, y(3) = The exact solution is y(x) = x 2 + (16/x). Computation Fluid Dynamics p.49/189

65 Solution of BVP using finitedifferences Define a uniform grid (x 0, x 1,..., x N ) with N + 1 points. Grid spacing h = (x N x 0 )/N, x j = x 0 + jh, for (j = 0, 1,.., N). Computation Fluid Dynamics p.50/189

66 Solution of BVP using finitedifferences Approximate y at each of the nodes x = x i by w i The derivatives of y in the ode are approximated in finite-difference form as ( ) dy = w i+1 w i 1 + O(h 2 ), dx x=x i 2h ( d 2 ) y dx 2 x=x i = w i+1 2w i + w i 1 h 2 + O(h 2 ). Computation Fluid Dynamics p.51/189

67 Solution of BVP using finitedifferences These can be derived by making use of a Taylor expansion about the point x = x i. Thus for example y(x i+1 ) = y(x i ) + h dy dx (x i) + h2 2 y(x i 1 ) = y(x i ) h dy dx (x i) + h2 2 d 2 y dx (x i) + h3 2 6 d 2 y dx (x i) h3 2 6 d 3 y dx 3 (x i) + h4 24 d 3 y dx 3 (x i) + h4 24 d d d d By adding and subtracting and replacing y(x i ) by w i we obtain previous approximation. Computation Fluid Dynamics p.52/189

68 Solution of BVP using finitedifferences Next replace y and its derivatives in ode by the above approximations to get ( ) w i+1 2w i + w i 1 = 4 + x3 i h 2 4 w wi+1 w i 1 i, 16h for (i = 1, 2,...N 1) and w 0 = 17, w N = The above equations are a set of nonlinear difference equations. We have N + 1 equations for N + 1 unknowns w 0,..., w N. Computation Fluid Dynamics p.53/189

69 Solution of BVP using finitedifferences The nonlinear term above can now be tackled in many different ways. Thus for example we can replace it by ( (k) w w (k 1) i+1 ) w(k) i 1 i, 16h or w (k) i ( ) (k 1) w i+1 w (k 1) i 1 16h, Computation Fluid Dynamics p.54/189

70 Newton linearization Suppose that we have a guess for the solutions w i = W i. We seek corrections δw i such that the w i = W i + δw i satisfies the system. = W i + δw i into equations and lin- Substituting w i earizing gives Computation Fluid Dynamics p.55/189

71 BVP FD methods and δw i+1 2δw i + δw i 1 = F h 2 i ( ) ( ) Wi+1 W i 1 δwi+1 δw i 1 δw i W i, 16h 16h for (i = 1, 2,...N 1) δw 0 = F 0, δw N = F N. Computation Fluid Dynamics p.56/189

72 BVP, FD methods The techniques described above lead to the solution of a tridiagonal systems of linear equations of the form α i w i 1 + β i w i + γ i w i+1 = δ i, i = 0, 1,.., N, where the α i, β i, γ i are coefficients obtainable from the difference equation. Computation Fluid Dynamics p.57/189

73 BVP, FD methods For example, we have α i = 1 h 2 W i 16h, β i = 2 h 2 + W i+1 W i 1 16h, γ i = 1 h 2 + W i 16h, δ i = F i, i = 1, 2,.., N 1, and β 0 = 1, γ 0 = 0, δ 0 = F 0, α N = 0, β N = 1, δ N = F N. Computation Fluid Dynamics p.58/189

74 Thomas s tridiagonal algorithm This version of a tridiagonal solver is based on Gaussian elimination. First we create zeros below the diagonal and then once we have a triangular matrix, we solve for the w i using back substitution. Thus the algorithm takes the form Computation Fluid Dynamics p.59/189

75 Thomas s tridiagonal algorithm β j = β j γ j 1α j β j 1 j = 1, 2, 3,..., N, δ j = δ j δ j 1α j β j 1, j = 1, 2, 3,..., N, w N = δ N β N, w j = (δ j γ j w j+1 ) β j, j = N 1,..., 1, 0. Computation Fluid Dynamics p.60/189

76 Stability In practice most initial value integrators should work reasonably well on standard problems. However certain types of problems (stiff problems) can cause difficulty and care needs to be exercised in the choice of the method. Computation Fluid Dynamics p.61/189

77 Stability -Consistency A method is said to be consistent if the local truncation error tends to zero as the step size 0, i.e lim max h 0 i τ i (h) = 0. Computation Fluid Dynamics p.62/189

78 Stability -Convergence A method is said to be convergent with respect to the equation it approximates if lim max h 0 i w i y(x i ) = 0, where y(x) is the exact solution and w i an approximation produced by the method. Computation Fluid Dynamics p.63/189

79 Stability, Theorem It can be proven that if the difference method is consistent with the differential equation, then the method is stable if and only if the method is convergent. Computation Fluid Dynamics p.64/189

80 Stability of m-step methods If we consider an m-step method w 0 = α 0, w 1 = α 1,..., w m 1 = α m 1, w i+1 = a m 1 w i + a m 2 w i a 0 w i+1 m +h[f (x i, w i+1, w i,..., w i+1 m )] Computation Fluid Dynamics p.65/189

81 Stability of m-step methods If we consider an m-step method w 0 = α 0, w 1 = α 1,..., w m 1 = α m 1, w i+1 = a m 1 w i + a m 2 w i a 0 w i+1 m +h[ F (x i, w i+1, w i,..., w i+1 m )] Then ignoring the F term the homogenous part is just a difference equation. Computation Fluid Dynamics p.65/189

82 Stability of m-step method The stability is thus connected with the the roots of the characteristic polynomial Why? λ m a m 1 λ m 1... a 1 λ a 0 = 0. Computation Fluid Dynamics p.66/189

83 Stability of m-step method Consider the ODE with f(x, y) = 0. dy dx = f(x, y), a x b, y(a) = α This has the solution y(x) = α. The difference equation has to produce the same solution, ie w n = α. Computation Fluid Dynamics p.67/189

84 Stability of m-step method Next consider w i+1 = a m 1 w i + a m 2 w i a 0 w i+1 m. Computation Fluid Dynamics p.68/189

85 Stability of m-step method Next consider w i+1 = a m 1 w i + a m 2 w i a 0 w i+1 m. If we look for solutions of the form w n = λ n then this gives the characteristic polynomial equation Computation Fluid Dynamics p.68/189

86 Stability of m-step method Next consider w i+1 = a m 1 w i + a m 2 w i a 0 w i+1 m. If we look for solutions of the form w n = λ n then this gives the characteristic polynomial equation λ m a m 1 λ m 1... a 1 λ a 0 = 0. Computation Fluid Dynamics p.68/189

87 Stability of m-step method Suppose λ 1,...λ m are distinct roots of characteristic polynomial. Then we can write Computation Fluid Dynamics p.69/189

88 Stability of m-step method Suppose λ 1,...λ m are distinct roots of characteristic polynomial. Then we can write m w n = c i λ m i. i=1 Computation Fluid Dynamics p.69/189

89 Stability of m-step method Suppose λ 1,...λ m are distinct roots of characteristic polynomial. Then we can write m w n = c i λ m i. i=1 Since w n = α is a solution, the difference equation gives α a m 1 α... a 0 α = 0, or α(1 a m 1... a 0 ) = 0. Computation Fluid Dynamics p.69/189

90 Stability of m-step method Thus w n = α + m c i λ n i. i=2 Computation Fluid Dynamics p.70/189

91 Stability of m-step method Thus w n = α + m i=2 c i λ n i. In the absence of round-off error all the c i would be zero. Computation Fluid Dynamics p.70/189

92 Stability of m-step method Thus w n = α + m i=2 c i λ n i. In the absence of round-off error all the c i would be zero. If λ i 1 then the error due to roundoff will not grow. Hence the method is stable if λ i 1. Computation Fluid Dynamics p.70/189

93 Stability of m-step method Is it enough just to have stability as defined above? Computation Fluid Dynamics p.71/189

94 Stability of m-step method Is it enough just to have stability as defined above? Consider the solution of dy dx = 30y, y(0) = 1/3. Computation Fluid Dynamics p.71/189

95 Satbility of m-step method The RK(4) method, although stable, has difficulty in computing the accurate solution of this problem. This means that we need something more than just the idea of stability defined above. Computation Fluid Dynamics p.72/189

96 Absolute stability Consider dy dx = ky, y(0) = α, k < 0. The exact solution of this is y(x) = αe kx. Computation Fluid Dynamics p.73/189

97 Absolute stability Consider dy dx = ky, y(0) = α, k < 0. The exact solution of this is y(x) = αe kx. If we take our one-step method and apply it to this equation we obtain w i+1 = Q(hk)w i. Computation Fluid Dynamics p.73/189

98 Absolute Stability Similarly a multi-step of the type used earlier, when applied to the test equation gives w i+1 = a m 1 w i + a m 2 w i a 0 w i+1 m +h[b m kw i+1 + b m 1 kw i b 0 kw i+1 m ]. Computation Fluid Dynamics p.74/189

99 Absolute Stability Thus if we seek solutions of the form w i = z i this will give rise to the characteristic polynomial equation where Q(z, hk) = 0, Computation Fluid Dynamics p.75/189

100 Absolute Stability Thus if we seek solutions of the form w i = z i this will give rise to the characteristic polynomial equation where Q(z, hk) = 0, Q(z, hk) = (1 hkb m )z m (a m 1 + hkb m 1 )z m 1... (a 0 + hkb 0 ). Computation Fluid Dynamics p.75/189

101 Absolute Stability The region R of absolute stability for a one-step method is defined as the region in the complex plane R= {hk C, Q(hk) < 1}. Computation Fluid Dynamics p.76/189

102 Absolute Stability The region R of absolute stability for a one-step method is defined as the region in the complex plane R= {hk C, Q(hk) < 1}. For a multi-step method R = {hk C, β j < 1}, where β j is a root of Q(z, hk) = 0. Computation Fluid Dynamics p.76/189

103 Absolute Stability A numerical method is A-stable if R contains the entire left half plane. Computation Fluid Dynamics p.77/189

104 Consider the modified Euler method w 0 = α k 1 = hf(x i, w i ), w i+1 = w i + h 2 [f(x i, w i ) + f(x i+1, w i+1 )], This is an A-stable method. Computation Fluid Dynamics p.78/189

105 Numerical Solution of PDes Computation Fluid Dynamics p.79/189

106 Classification of PDE s Partial differential equations can be classified as being of type elliptic, parabolic or hyperbolic. In some cases equations can be of mixed type. Consider A 2 φ x 2 + B 2 φ x y + C 2 φ y 2 + D φ x + E φ y + F φ + G = 0, where, in general, A, B, C, D, E, F, and G are functions of the independent variables x and y and of the dependent variables φ. Computation Fluid Dynamics p.80/189

107 PDE s Classification The equation is said to be elliptic if B 2 4AC < 0, Computation Fluid Dynamics p.81/189

108 PDE s Classification The equation is said to be elliptic if B 2 4AC < 0, parabolic if B 2 4AC = 0, or Computation Fluid Dynamics p.81/189

109 PDE s Classification The equation is said to be elliptic if B 2 4AC < 0, parabolic if B 2 4AC = 0, or hyperbolic if B 2 4AC > 0. Computation Fluid Dynamics p.81/189

110 PDE s Classification The equation is said to be elliptic if B 2 4AC < 0, parabolic if B 2 4AC = 0, or hyperbolic if B 2 4AC > 0. Computation Fluid Dynamics p.81/189

111 Classification An example of an elliptic equation is Poisson s equation 2 φ x + 2 φ = f(x, y). 2 y2 Computation Fluid Dynamics p.82/189

112 Classification The heat equation φ t = φ k 2 x 2 is of parabolic type, and the wave equation is a hyperbolic pde. 2 φ x 2 2 φ y 2 = 0 Computation Fluid Dynamics p.83/189

113 Classification An example of a mixed type equation is the transonic small disturbance equation given by (K φ x ) 2 φ x φ y 2 = 0. Computation Fluid Dynamics p.84/189

114 Classification 2 Consider a system of first order partial differential equations. Unknowns U = (u 1, u 2,..., u n ) T Independent variables x = (x 1, x 2,..., x m ) T. Computation Fluid Dynamics p.85/189

115 Classification 2 Suppose that the equations can be written in quasi-linear form m k=1 A k U x k = Q where the A k are (n n) matrices and Q is an (n 1) column vector, and both can depend on x k and U but not on the derivatives of U. Computation Fluid Dynamics p.86/189

116 Classification 2 If we seek plane wave solutions of the homogeneous part of the above pde in the form U = U o e ix.s, where s = (s 1, s 2,.., s m ) T, then i [ m k=1 A k s k ] U = 0. Computation Fluid Dynamics p.87/189

117 Classification 2 This will have a non-trivial solution only if the characteristic equation det m k=1 A k s k = 0, Computation Fluid Dynamics p.88/189

118 Classification 2 The system is hyperbolic if n real characteristics exist. Computation Fluid Dynamics p.89/189

119 Classification 2 The system is hyperbolic if n real characteristics exist. If all the characteristics are complex, the system is elliptic. Computation Fluid Dynamics p.89/189

120 Classification 2 The system is hyperbolic if n real characteristics exist. If all the characteristics are complex, the system is elliptic. If some are real and some complex, the system is of mixed type. Computation Fluid Dynamics p.89/189

121 Classification 2 The system is hyperbolic if n real characteristics exist. If all the characteristics are complex, the system is elliptic. If some are real and some complex, the system is of mixed type. If the system is of rank less than n, then we have a parabolic system. Computation Fluid Dynamics p.89/189

122 Classification 2 The system is hyperbolic if n real characteristics exist. If all the characteristics are complex, the system is elliptic. If some are real and some complex, the system is of mixed type. If the system is of rank less than n, then we have a parabolic system. Computation Fluid Dynamics p.89/189

123 Consistency, convergence and Lax equivalence theorem Consistent A discrete approximation to a partial differential equation is said to be consistent if in the limit of the stepsize(s) going to zero, the original pde system is recovered, ie the truncation error approaches zero. Computation Fluid Dynamics p.90/189

124 Consistency, convergence and Lax equivalence theorem Stability If we define the error to be the difference between the computed solutions and the exact solution of the discrete approximation, then the scheme is stable if the error remains uniformly bounded for successive iterations. Computation Fluid Dynamics p.91/189

125 Consistency, convergence and Lax equivalence theorem Convergence A scheme is stable if the solution of the discrete equations approaches the solution of the pde in the limit that the step-sizes approach zero. Lax s Equivalence Theorem For a well posed initial-value problem and a consistent discretization, stability is the necessary and sufficient condition for convergence. Computation Fluid Dynamics p.92/189

126 Difference formulae Suppose that we have a grid of points with equal mesh spacing x in the x direction and equal spacing y in the y direction. Thus we can define points x i, y j by x i = x 0 + i x, y j = y 0 + j y. Computation Fluid Dynamics p.93/189

127 Difference formulae Suppose that we are trying to approximate a derivative of a function φ(x, y) at the points x i, y j. Denote the approximate value of φ(x, y) at the point x i, y j by w i,j say. Computation Fluid Dynamics p.94/189

128 Central Differences The first and second derivatives in x or y may be approximated as before by ( 2 ) φ = w i+1,j 2w i,j + w i 1,j + O(( x 2 ( x ) 2 x ) 2 ), ij ( 2 ) φ = w i,j+1 2w i,j + w i,j 1 + O(( y 2 ij ( y ) 2 y ) 2 ), ( ) φ = w i+1,j w i 1,j + O(( x ) 2 ), x ij 2 x ( ) φ = w i,j+1 w i,j 1 + O(( y ) 2 ). y 2 y ij Computation Fluid Dynamics p.95/189

129 Central Differences The approximations listed above are centered at the points (x i, y j ), and are called central-difference approximations. i 1, j i, j i + 1, j Computation Fluid Dynamics p.96/189

130 One-sided approximations We can also construct one-sided approximations to derivatives. Thus for example a second-order forward approximation to φ x at the point (x i, y j ) is given by ( ) φ x ij = 3w i,j + 4w i+1,j w i+2,j 2 x. Computation Fluid Dynamics p.97/189

131 Weights for central differences Node Points Order of i 2 i 1 i i + 1 i + 2 Accuracy 1st derivative ( x ) ( x ) nd derivative ( x ) ( x ) Computation Fluid Dynamics p.98/189

132 Weights for one-sided differences Computation Fluid Dynamics p.99/ Node Points Order of i i + 1 i + 2 i + 3 i + 4 Accuracy 1st derivative ( x ) -1 1 ( x ) ( x ) ( x ) nd derivative ( x ) ( x )

133 Mixed derivatives For finding suitable discrete approximations for mixed derivatives use a multidimensional Taylor expansion. Thus for example second order approximations to 2 φ/ x y at the point i, j are given 2 φ x y = w i+1,j+1 w i 1,j+1 + w i 1,j 1 w i+1,j 1 4 x y +O(( x ) 2, ( In stencil form we can express this as x y Computation Fluid Dynamics p.100/189

134 Mixed derivatives Alternatively, 2 φ x y = w i+1,j+1 w i+1,j w i,j+1 + w i 1,j 1 w i 1,j w i,j 1 + 2w i,j 2 x y + or 1 2 x y Computation Fluid Dynamics p.101/189

135 Central, one-sided differences Consider the approximation ( ) φ = w i+1,j w i,j. x x ij By Taylor expansion we see that this gives rise to a truncation error of O( x ). In addition this approximation is centered at the point x i+ 1 2,j. i, j i + 1, j Computation Fluid Dynamics p.102/189

136 Solution of elliptic pde s A prototype elliptic pde is Poisson s equation given by 2 φ x + 2 φ = f(x, y), 2 y2 where f(x, y) is a known/given function. The equation has to be solved in a domain D Computation Fluid Dynamics p.103/189

137 Boundary Conditions Boundary conditions are given on the boundary δd of D. Computation Fluid Dynamics p.104/189

138 Boundary Conditions These can be of three types: Dirichlet φ = g(x, y) on δd. Computation Fluid Dynamics p.105/189

139 Boundary Conditions These can be of three types: Dirichlet Neumann φ = g(x, y) on δd. φ n = g(x, y) on δd. Computation Fluid Dynamics p.105/189

140 Boundary Conditions These can be of three types: Dirichlet Neumann φ = g(x, y) on δd. φ n = g(x, y) on δd. Robin/Mixed B(φ, φ ) = 0 on δd. n Robin boundary conditions involve a linear combination of φ and its normal derivative on the boundary. Mixed boundary conditions involve different conditions for one part of the boundary, and another type for other parts of the boundary. Computation Fluid Dynamics p.105/189

141 Solution of model problem Let us consider a model problem with 2 φ x + 2 φ = f(x, y), 0 < x, y < 1 2 y2 φ = 0 on δd. Here the domain D is the square region 0 < x < 1 and 0 < y < 1. Computation Fluid Dynamics p.106/189

142 Solution of model problem Construct a finite difference mesh with points (x i, y j ), say where x i = i x, i = 0, 1,..., N, y j = j y, j = 0, 1,... where x = 1/N, and y = 1/M are the step sizes in the x and y directions. Computation Fluid Dynamics p.107/189

143 Solution of model problem Next replace the derivatives in Poisson equation by the discrete approximations to get w i+1,j 2w i,j + w i 1,j ( x ) 2 + w i,j+1 2w i,j + w i,j 1 ( y ) 2 = f i,j, and 1 i N 1, 1 j M 1 w i,j = 0, if i = 1, N, 1 j M, w i,j = 0, if j = 1, M, 1 i N. Computation Fluid Dynamics p.108/189

144 Solution of model problem Thus we have (N 1) (M 1) unknown values w i,j to find at the interior points of the domain. Computation Fluid Dynamics p.109/189

145 If we write w i = (w i,1, w i,2,..., w i,m 1 ) T and f i = (f i,1, f i,2,..., f i,m 1 ) T we can write the above system of equations in matrix form as Computation Fluid Dynamics p.110/189

146 Solution of model problem B I I B I I B I I B w 1 w 2 w 3 w N 1 = ( x ) 2 f 1 f 2 f 3 f N 1 Computation Fluid Dynamics p.111/189

147 Solution of model problem In the above I is the (M 1) (M 1) identity matrix and with b = 2( B = b c c b c 0 c b c... c b 3, ( x ) ( y ) 2), c = 1. Computation Fluid Dynamics p.112/189

148 Solution of model problem Let us write the linear system as Aw = f What we observe is that the matrix A is very sparse. The matrix A is very large. For instance with N = M = 101 the linear system is of size and we have 10 4 unknowns to find. Computation Fluid Dynamics p.113/189

149 Solution of linear system The linear system can be solved using Direct Methods These are not efficient if A is large. Also very expensive, and require large storage. Computation Fluid Dynamics p.114/189

150 Solution of linear system The linear system can be solved using Direct Methods These are not efficient if A is large. Also very expensive, and require large storage. Iterative Methods The method of choice for most applications. Computation Fluid Dynamics p.114/189

151 Iterative methods Point relaxation. Jacobi, Gauss-Seidel, SOR Computation Fluid Dynamics p.115/189

152 Iterative methods Point relaxation. Jacobi, Gauss-Seidel, SOR Line Relaxation Computation Fluid Dynamics p.115/189

153 Iterative methods Point relaxation. Jacobi, Gauss-Seidel, SOR Line Relaxation Conjugate gradient and PCG methods Computation Fluid Dynamics p.115/189

154 Iterative methods Point relaxation. Jacobi, Gauss-Seidel, SOR Line Relaxation Conjugate gradient and PCG methods Minimal residual methods Computation Fluid Dynamics p.115/189

155 Iterative methods Point relaxation. Jacobi, Gauss-Seidel, SOR Line Relaxation Conjugate gradient and PCG methods Minimal residual methods Multigrid Computation Fluid Dynamics p.115/189

156 Iterative methods Point relaxation. Jacobi, Gauss-Seidel, SOR Line Relaxation Conjugate gradient and PCG methods Minimal residual methods Multigrid Fast Direct Methods (FFT) Computation Fluid Dynamics p.115/189

157 Iterative methods- Jacobi method Rewrite the discrete equations w i+1,j 2w i,j + w i 1,j ( x ) 2 + w i,j+1 2w i,j + w i,j 1 ( y ) 2 = f i,j, as 1 i N 1, 1 j M 1 Computation Fluid Dynamics p.116/189

158 Iterative methods- Jacobi method Rewrite the discrete equations w i+1,j 2w i,j + w i 1,j ( x ) 2 + w i,j+1 2w i,j + w i,j 1 ( y ) 2 = f i,j, 1 i N 1, 1 j M 1 as w i,j = 1 2(1 + β 2 ) ( wi+1,j + w i 1,j + β 2 (w i,j+1 + w i,j 1 ) ( x ) 2 with β = x / y. Computation Fluid Dynamics p.116/189

159 Iterative methods- Jacobi method This suggests the iterative scheme w new i,j = 1 2(1 + β 2 ) ( ) w old i+1,j + wi 1,j old + β 2 (wi,j+1 old + wi,j 1 old ( x ) 2 Computation Fluid Dynamics p.117/189

160 Iterative methods- Jacobi method What are suitable convergence criteria? Computation Fluid Dynamics p.118/189

161 Iterative methods- Jacobi method What are suitable convergence criteria? Suppose we write the linear system as Av = f where v is the exact solution of the linear system. If w is an approximate solution, the error e is defined by e = v w. Thus Ae = A(v w) = f Aw. Computation Fluid Dynamics p.118/189

162 Iterative methods- Jacobi method Continue iterating until residual is small enough. The residual is defined by which can be computed. r = f Aw Computation Fluid Dynamics p.119/189

163 Iterative methods- Jacobi method Continue iterating until residual is small enough. The residual is defined by r = f Aw which can be computed. For the Jacobi scheme the residual is given by r i,j = ( x ) 2 f i,j +2(1+β 2 )w i,j (w i+1,j +w i 1,j +β 2 (w i,j+1 +w i,j 1 Computation Fluid Dynamics p.119/189

164 Iterative methods- Jacobi method Therefore a suitable stopping condition might be r i,j < ɛ 1, or ri,j 2 < ɛ 2. max i,j i,j Computation Fluid Dynamics p.120/189

165 Gauss-Siedel iteration This is given by w new i,j = 1 2(1 + β 2 ) ( ) w old i+1,j + wi 1,j new + β 2 (wi,j+1 old + wi,j 1 new ( x ) 2 where the new values overwrite existing values. Computation Fluid Dynamics p.121/189

166 Relaxation and the SOR method Instead of updating the new values as indicated above, it is better to use relaxation. Here we compute w i,j = (1 ω)w old i,j + ωw i,j, where ω is called the relaxation factor, and w i,j denotes the value as computed by the Jacobi, or Gauss-Seidel scheme. ω = 1 reduces to the Jacobi or Gauss-Seidel scheme. The Gauss-Seidel scheme with ω 1 is called the method of successive overrelaxation or SOR scheme. Computation Fluid Dynamics p.122/189

167 Line relaxation The Jacobi, Gauss-Seidel and SOR schemes are called point relaxation methods. On the other hand we may compute a whole line of new values at a time, leading to the line-relaxation methods. Computation Fluid Dynamics p.123/189

168 Line Relaxation For instance suppose we write the equations as w new i+1,j 2(1+β 2 )wi,j new +wi 1,j new = β 2 (w i,j+1 +wi,j 1))+( old x ) 2 f i,j, then starting from j = 1 we may compute the values w i,j, for i = 1,..., N 1 in one go. To solve for a line we need a tridiagonal solver. Computation Fluid Dynamics p.124/189

169 Convergence properties of basic iteration schemes Consider the linear system Ax = b (-32) where A = (a i,j ) is an n n matrix, and x, b are n 1 column vectors. Computation Fluid Dynamics p.125/189

170 Convergence properties Suppose we write the matrix A in the form A = D L U where D, L, U are the diagonal matrix, lower and upper triangular parts of A, ie D = a 1,1 0 0 a 2, a 3, , a n,n Computation Fluid Dynamics p.126/189

171 Convergence properties L = a 2,1 0 0 a 3,1 a 3, a n,1 a n,2 a n,n , U = a 1,2 a 1,3... a 1,n 0 0 a 2,3... a 2,n a 3,4.. a 3,n.. 0 a n 1,n Computation Fluid Dynamics p.127/189

172 Convergence properties Then can be written as Ax = b Dx = (L + U)x + b. Computation Fluid Dynamics p.128/189

173 Convergence properties The Jacobi iteration is then defined as x (k+1) = D 1 (L + U)x (k) + D 1 b. Computation Fluid Dynamics p.129/189

174 Convergence properties The Jacobi iteration is then defined as x (k+1) = D 1 (L + U)x (k) + D 1 b. The Gauss-Seidel iteration is defined by (D L)x (k+1) = Ux (k) + b, or x (k+1) = (D L) 1 Ux (k) + (D L) 1 b. Computation Fluid Dynamics p.129/189

175 Convergence properties In general an iteration scheme may be written as x (k+1) = Px (k) + Pb where P is called the iteration matrix. Computation Fluid Dynamics p.130/189

176 Convergence properties In general an iteration scheme may be written as x (k+1) = Px (k) + Pb where P is called the iteration matrix. For the Jacobi scheme scheme we have P = P J = D 1 (L + U) Computation Fluid Dynamics p.130/189

177 Convergence properties In general an iteration scheme may be written as x (k+1) = Px (k) + Pb where P is called the iteration matrix. For the Jacobi scheme scheme we have P = P J = D 1 (L + U) For the Gauss-Seidel scheme P = P G = (D L) 1 U. Computation Fluid Dynamics p.130/189

178 Convergence properties The exact solution to the linear system satisfies x = Px + Pb. Computation Fluid Dynamics p.131/189

179 Convergence properties The exact solution to the linear system satisfies x = Px + Pb. Define the error at the kth iteration by e (k) = x x (k) then the error satisfies the equation Computation Fluid Dynamics p.131/189

180 Convergence properties The exact solution to the linear system satisfies x = Px + Pb. Define the error at the kth iteration by e (k) = x x (k) then the error satisfies the equation e (k+1) = Pe (k) = P 2 e (k 1) = P k+1 e (0). Computation Fluid Dynamics p.131/189

181 Convergence properties In order that the error diminishes as k we must have P k 0 as k, Computation Fluid Dynamics p.132/189

182 Convergence properties In order that the error diminishes as k we must have P k 0 as k, Since we see that we require P k = P k P < 1. Computation Fluid Dynamics p.132/189

183 Convergence properties From linear algebra P < 1 is equivalent to the requirement that ρ(p) = max i λ i < 1 where λ i are the eigenvalues of the matrix P. ρ(p) is called the spectral radius of P. Computation Fluid Dynamics p.133/189

184 Convergence properties Note also that for large k e (k+1) = ρ e (k). Computation Fluid Dynamics p.134/189

185 Convergence properties Note also that for large k e (k+1) = ρ e (k). How many iterations does it takes to reduce the initial error by a factor ɛ? Computation Fluid Dynamics p.134/189

186 Convergence properties Note also that for large k e (k+1) = ρ e (k). How many iterations does it takes to reduce the initial error by a factor ɛ? We need q iterations where q is the smallest value for which ρ q < ɛ giving q q d = ln ɛ ln ρ. Computation Fluid Dynamics p.134/189

187 Convergence properties Thus iteration matrices where the spectral radius is close to 1 will converge slowly. For the model problem it can be shown that for Jacobi iteration ρ = ρ(p J ) = 1 ( cos π 2 N + cos π ), M and for Gauss-Seidel ρ = ρ(p G ) = [ρ(p J )] 2. Computation Fluid Dynamics p.135/189

188 Convergence properties If we take N = M and N >> 1 then for Jacobi iteration we have q d = 2 ln ɛ ln(1 π2 2N ) = 2N ln ɛ. π2 2 Computation Fluid Dynamics p.136/189

189 Convergence properties If we take N = M and N >> 1 then for Jacobi iteration we have q d = 2 ln ɛ ln(1 π2 2N ) = 2N ln ɛ. π2 2 Gauss-Seidel converges twice as fast as Jacobi. Computation Fluid Dynamics p.136/189

190 Convergence properties For point SOR the spectral radius depends on the relaxation factor ω, but for the model problem with optimum values and N = M it can be shown that giving ρ = 1 sin π N 1 + sin π N q d = N 2π ln ɛ. Computation Fluid Dynamics p.137/189

191 Convergence properties For line SOR, and it can be shown that using optimum values ρ = ( 1 sin π 2N 1 + sin π 2N ) 2, q d = N 2 2π ln ɛ. Computation Fluid Dynamics p.138/189

192 Parabolic Equations In this section we will look at the solution of parabolic partial differential equations. The techniques introduced earlier apply equally to parabolic pdes. Computation Fluid Dynamics p.139/189

193 Parabolic Equations One of the simplest parabolic pde is the diffusion equation which in one space dimensions is u t = κ 2 u x 2. Computation Fluid Dynamics p.140/189

194 Parabolic Equations One of the simplest parabolic pde is the diffusion equation which in one space dimensions is u t = κ 2 u x 2. For two or more space dimensions we have u t = κ 2 u. In the above κ is some given constant. Computation Fluid Dynamics p.140/189

195 Parabolic Equations Another familiar set of parabolic pdes is the boundary layer equations u x + v y = 0, u t + uu x + vu y = p x + u yy, 0 = p y. Computation Fluid Dynamics p.141/189

196 Parabolic Equations With a parabolic pde we expect, in addition to boundary conditions, an initial condition at say, t = 0. Computation Fluid Dynamics p.142/189

197 Parabolic Equations Let us consider u t = u κ 2 x 2. in the region a x b. Computation Fluid Dynamics p.143/189

198 Parabolic Equations Let us consider u t = u κ 2 x 2. in the region a x b. Take a uniform mesh in x with x j = a + j x, j = 0, 1,.., N and x = (b a)/n. Computation Fluid Dynamics p.143/189

199 Parabolic Equations Let us consider u t = u κ 2 x 2. in the region a x b. Take a uniform mesh in x with x j = a + j x, j = 0, 1,.., N and x = (b a)/n. For the differencing in time we assume a constant step size t so that t = t k = k t Computation Fluid Dynamics p.143/189

200 1st order central difference approximation We may approximate our equation by [ wj k+1 wj k w k j+1 2wj k = κ + ] wk j 1. t 2 x Computation Fluid Dynamics p.144/189

201 1st order central difference approximation We may approximate our equation by [ wj k+1 wj k w k j+1 2wj k = κ + ] wk j 1. t 2 x Here wj k denotes an approximation to the exact solution u(x, t) of the pde at x = x j, t = t k. Computation Fluid Dynamics p.144/189

202 1st order central difference approximation We may approximate our equation by [ wj k+1 wj k w k j+1 2wj k = κ + ] wk j 1. t 2 x Here wj k denotes an approximation to the exact solution u(x, t) of the pde at x = x j, t = t k. The above scheme is first order in time O( t ) and second order in space O( x ) 2. Computation Fluid Dynamics p.144/189

203 1st order central difference approximation We may approximate our equation by [ wj k+1 wj k w k j+1 2wj k = κ + ] wk j 1. t 2 x Here wj k denotes an approximation to the exact solution u(x, t) of the pde at x = x j, t = t k. The above scheme is first order in time O( t ) and second order in space O( x ) 2. The scheme is explicit because the unknowns at level k + 1 can be computed directly. Computation Fluid Dynamics p.144/189

204 Parabolic pde Let us assume that we are given a suitable initial condition, and boundary conditions of the form u(a, t) = f(t), u(b, t) = g(t). Notice that there is a time lag before the effect of the boundary data is felt on the solution. Computation Fluid Dynamics p.145/189

205 Parabolic pde As we will see later this scheme is conditionally stable for β 1/2 where β = κ t. 2 x Note that β is sometimes called the Peclet or diffusion number. Computation Fluid Dynamics p.146/189

206 Fully implicit, first order A better approximation is one which makes use of an implicit scheme. Then we have Computation Fluid Dynamics p.147/189

207 Fully implicit, first order A better approximation is one which makes use of an implicit scheme. Then we have [ wj k+1 wj k w k+1 j+1 = κ ] 2wk+1 j + wj 1 k+1. t 2 x Computation Fluid Dynamics p.147/189

208 Fully implicit, first order A better approximation is one which makes use of an implicit scheme. Then we have w j k + 1 t wj k = κ k + 1 wj+1 2wj k+1 2 x + w k + 1 j 1 The unknowns at level k + 1 are coupled together and we have a set of implicit equations to solve. Computation Fluid Dynamics p.147/189

209 Fully implicit, first order Rearrange to get βwj 1 k+1 (1+2β)wk+1 j +βwj 1 k+1 = wk j, 1 j N Approximation of the boundary conditions gives w k+1 0 = f(t k+1 ), w k+1 N = g(t k+1). Computation Fluid Dynamics p.148/189

210 Fully implicit, first order The discrete equations are of tridiagonal form and thus easily solved. Computation Fluid Dynamics p.149/189

211 Fully implicit, first order The discrete equations are of tridiagonal form and thus easily solved. The scheme is unconditionally stable. Computation Fluid Dynamics p.149/189

212 Fully implicit, first order The discrete equations are of tridiagonal form and thus easily solved. The scheme is unconditionally stable. The accuracy of the above fully implicit scheme is only first order in time. We can try and improve on this with a second order scheme. Computation Fluid Dynamics p.149/189

213 Richardson method Consider w k+1 j w k 1 j 2 t = κ [ w k j+1 2w k j + wk j 1 2 x ]. Computation Fluid Dynamics p.150/189

214 Richardson method Consider w k+1 j w k 1 j 2 t = κ [ w k j+1 2w k j + wk j 1 2 x ]. This uses three time levels and has accuracy O( 2 t, 2 x). Computation Fluid Dynamics p.150/189

215 Richardson method Consider w k+1 j w k 1 j 2 t = κ [ w k j+1 2w k j + wk j 1 2 x ]. This uses three time levels and has accuracy O( 2 t, 2 x). The scheme was devised by a meteorologist and is unconditionally unstable! Computation Fluid Dynamics p.150/189

216 Du-Fort Frankel This uses the approximation w k+1 j w k 1 j 2 t = κ [ w k j+1 w k+1 j w k 1 j 2 x + w k j 1 ]. Computation Fluid Dynamics p.151/189

217 Du-Fort Frankel This uses the approximation w k+1 j w k 1 j 2 t = κ [ w k j+1 w k+1 j w k 1 j 2 x + w k j 1 ]. This has truncation error O( 2 t, 2 x, ( 4 t explicit scheme. 2 x )), and is an Computation Fluid Dynamics p.151/189

218 Du-Fort Frankel This uses the approximation w k+1 j w k 1 j 2 t = κ [ w k j+1 w k+1 j w k 1 j 2 x + w k j 1 ]. This has truncation error O( 2 t, 2 x, ( 4 t explicit scheme. 2 x )), and is an The scheme is unconditionally stable, but is inconsistent if t 0, x 0 but with t / x remaining fixed. Computation Fluid Dynamics p.151/189

219 Crank-Nicolson A popular scheme is the Crank-Nicolson scheme given by w k+1 j w k j t = κ 2 " w k+1 j+1 2wk+1 j + w k+1 j 1 2 x + wk j+1 2wk j + wk j 1 2 x #. Computation Fluid Dynamics p.152/189

220 Crank-Nicolson A popular scheme is the Crank-Nicolson scheme given by w k+1 j w k j t = κ 2 " w k+1 j+1 2wk+1 j + w k+1 j 1 2 x + wk j+1 2wk j + wk j 1 2 x #. This is second order accurate O( 2 t, 2 x) and is unconditionally stable. (Taking very large time steps can however cause problems). As can be seen it is also an implicit scheme. Computation Fluid Dynamics p.152/189

NUMERICAL METHODS FOR ENGINEERING APPLICATION

NUMERICAL METHODS FOR ENGINEERING APPLICATION NUMERICAL METHODS FOR ENGINEERING APPLICATION Second Edition JOEL H. FERZIGER A Wiley-Interscience Publication JOHN WILEY & SONS, INC. New York / Chichester / Weinheim / Brisbane / Singapore / Toronto

More information

Chapter Two: Numerical Methods for Elliptic PDEs. 1 Finite Difference Methods for Elliptic PDEs

Chapter Two: Numerical Methods for Elliptic PDEs. 1 Finite Difference Methods for Elliptic PDEs Chapter Two: Numerical Methods for Elliptic PDEs Finite Difference Methods for Elliptic PDEs.. Finite difference scheme. We consider a simple example u := subject to Dirichlet boundary conditions ( ) u

More information

AIMS Exercise Set # 1

AIMS Exercise Set # 1 AIMS Exercise Set #. Determine the form of the single precision floating point arithmetic used in the computers at AIMS. What is the largest number that can be accurately represented? What is the smallest

More information

Numerical Solution Techniques in Mechanical and Aerospace Engineering

Numerical Solution Techniques in Mechanical and Aerospace Engineering Numerical Solution Techniques in Mechanical and Aerospace Engineering Chunlei Liang LECTURE 3 Solvers of linear algebraic equations 3.1. Outline of Lecture Finite-difference method for a 2D elliptic PDE

More information

BOUNDARY VALUE PROBLEMS

BOUNDARY VALUE PROBLEMS BOUNDARY VALUE PROBLEMS School of Mathematics Semester 1 2008 OUTLINE 1 REVIEW 2 BOUNDARY VALUE PROBLEMS 3 NEWTONS SHOOTING METHOD 4 SUMMARY OUTLINE 1 REVIEW 2 BOUNDARY VALUE PROBLEMS 3 NEWTONS SHOOTING

More information

Index. higher order methods, 52 nonlinear, 36 with variable coefficients, 34 Burgers equation, 234 BVP, see boundary value problems

Index. higher order methods, 52 nonlinear, 36 with variable coefficients, 34 Burgers equation, 234 BVP, see boundary value problems Index A-conjugate directions, 83 A-stability, 171 A( )-stability, 171 absolute error, 243 absolute stability, 149 for systems of equations, 154 absorbing boundary conditions, 228 Adams Bashforth methods,

More information

Finite Differences for Differential Equations 28 PART II. Finite Difference Methods for Differential Equations

Finite Differences for Differential Equations 28 PART II. Finite Difference Methods for Differential Equations Finite Differences for Differential Equations 28 PART II Finite Difference Methods for Differential Equations Finite Differences for Differential Equations 29 BOUNDARY VALUE PROBLEMS (I) Solving a TWO

More information

Finite Difference Methods for Boundary Value Problems

Finite Difference Methods for Boundary Value Problems Finite Difference Methods for Boundary Value Problems October 2, 2013 () Finite Differences October 2, 2013 1 / 52 Goals Learn steps to approximate BVPs using the Finite Difference Method Start with two-point

More information

Partial Differential Equations

Partial Differential Equations Partial Differential Equations Introduction Deng Li Discretization Methods Chunfang Chen, Danny Thorne, Adam Zornes CS521 Feb.,7, 2006 What do You Stand For? A PDE is a Partial Differential Equation This

More information

2.29 Numerical Fluid Mechanics Spring 2015 Lecture 9

2.29 Numerical Fluid Mechanics Spring 2015 Lecture 9 Spring 2015 Lecture 9 REVIEW Lecture 8: Direct Methods for solving (linear) algebraic equations Gauss Elimination LU decomposition/factorization Error Analysis for Linear Systems and Condition Numbers

More information

SOLVING ELLIPTIC PDES

SOLVING ELLIPTIC PDES university-logo SOLVING ELLIPTIC PDES School of Mathematics Semester 1 2008 OUTLINE 1 REVIEW 2 POISSON S EQUATION Equation and Boundary Conditions Solving the Model Problem 3 THE LINEAR ALGEBRA PROBLEM

More information

KINGS COLLEGE OF ENGINEERING DEPARTMENT OF MATHEMATICS ACADEMIC YEAR / EVEN SEMESTER QUESTION BANK

KINGS COLLEGE OF ENGINEERING DEPARTMENT OF MATHEMATICS ACADEMIC YEAR / EVEN SEMESTER QUESTION BANK KINGS COLLEGE OF ENGINEERING MA5-NUMERICAL METHODS DEPARTMENT OF MATHEMATICS ACADEMIC YEAR 00-0 / EVEN SEMESTER QUESTION BANK SUBJECT NAME: NUMERICAL METHODS YEAR/SEM: II / IV UNIT - I SOLUTION OF EQUATIONS

More information

Fourth Order RK-Method

Fourth Order RK-Method Fourth Order RK-Method The most commonly used method is Runge-Kutta fourth order method. The fourth order RK-method is y i+1 = y i + 1 6 (k 1 + 2k 2 + 2k 3 + k 4 ), Ordinary Differential Equations (ODE)

More information

Preface. 2 Linear Equations and Eigenvalue Problem 22

Preface. 2 Linear Equations and Eigenvalue Problem 22 Contents Preface xv 1 Errors in Computation 1 1.1 Introduction 1 1.2 Floating Point Representation of Number 1 1.3 Binary Numbers 2 1.3.1 Binary number representation in computer 3 1.4 Significant Digits

More information

ME Computational Fluid Mechanics Lecture 5

ME Computational Fluid Mechanics Lecture 5 ME - 733 Computational Fluid Mechanics Lecture 5 Dr./ Ahmed Nagib Elmekawy Dec. 20, 2018 Elliptic PDEs: Finite Difference Formulation Using central difference formulation, the so called five-point formula

More information

Review Higher Order methods Multistep methods Summary HIGHER ORDER METHODS. P.V. Johnson. School of Mathematics. Semester

Review Higher Order methods Multistep methods Summary HIGHER ORDER METHODS. P.V. Johnson. School of Mathematics. Semester HIGHER ORDER METHODS School of Mathematics Semester 1 2008 OUTLINE 1 REVIEW 2 HIGHER ORDER METHODS 3 MULTISTEP METHODS 4 SUMMARY OUTLINE 1 REVIEW 2 HIGHER ORDER METHODS 3 MULTISTEP METHODS 4 SUMMARY OUTLINE

More information

Finite Difference Method for PDE. Y V S S Sanyasiraju Professor, Department of Mathematics IIT Madras, Chennai 36

Finite Difference Method for PDE. Y V S S Sanyasiraju Professor, Department of Mathematics IIT Madras, Chennai 36 Finite Difference Method for PDE Y V S S Sanyasiraju Professor, Department of Mathematics IIT Madras, Chennai 36 1 Classification of the Partial Differential Equations Consider a scalar second order partial

More information

Numerical Solution of partial differential equations

Numerical Solution of partial differential equations G. D. SMITH Brunei University Numerical Solution of partial differential equations FINITE DIFFERENCE METHODS THIRD EDITION CLARENDON PRESS OXFORD Contents NOTATION 1. INTRODUCTION AND FINITE-DIFFERENCE

More information

x x2 2 + x3 3 x4 3. Use the divided-difference method to find a polynomial of least degree that fits the values shown: (b)

x x2 2 + x3 3 x4 3. Use the divided-difference method to find a polynomial of least degree that fits the values shown: (b) Numerical Methods - PROBLEMS. The Taylor series, about the origin, for log( + x) is x x2 2 + x3 3 x4 4 + Find an upper bound on the magnitude of the truncation error on the interval x.5 when log( + x)

More information

Lecture 9 Approximations of Laplace s Equation, Finite Element Method. Mathématiques appliquées (MATH0504-1) B. Dewals, C.

Lecture 9 Approximations of Laplace s Equation, Finite Element Method. Mathématiques appliquées (MATH0504-1) B. Dewals, C. Lecture 9 Approximations of Laplace s Equation, Finite Element Method Mathématiques appliquées (MATH54-1) B. Dewals, C. Geuzaine V1.2 23/11/218 1 Learning objectives of this lecture Apply the finite difference

More information

Numerical Solutions to Partial Differential Equations

Numerical Solutions to Partial Differential Equations Numerical Solutions to Partial Differential Equations Zhiping Li LMAM and School of Mathematical Sciences Peking University A Model Problem and Its Difference Approximations 1-D Initial Boundary Value

More information

Numerical Solutions to Partial Differential Equations

Numerical Solutions to Partial Differential Equations Numerical Solutions to Partial Differential Equations Zhiping Li LMAM and School of Mathematical Sciences Peking University The Implicit Schemes for the Model Problem The Crank-Nicolson scheme and θ-scheme

More information

Kasetsart University Workshop. Multigrid methods: An introduction

Kasetsart University Workshop. Multigrid methods: An introduction Kasetsart University Workshop Multigrid methods: An introduction Dr. Anand Pardhanani Mathematics Department Earlham College Richmond, Indiana USA pardhan@earlham.edu A copy of these slides is available

More information

Applied Numerical Analysis

Applied Numerical Analysis Applied Numerical Analysis Using MATLAB Second Edition Laurene V. Fausett Texas A&M University-Commerce PEARSON Prentice Hall Upper Saddle River, NJ 07458 Contents Preface xi 1 Foundations 1 1.1 Introductory

More information

6. Iterative Methods for Linear Systems. The stepwise approach to the solution...

6. Iterative Methods for Linear Systems. The stepwise approach to the solution... 6 Iterative Methods for Linear Systems The stepwise approach to the solution Miriam Mehl: 6 Iterative Methods for Linear Systems The stepwise approach to the solution, January 18, 2013 1 61 Large Sparse

More information

Chapter 11 ORDINARY DIFFERENTIAL EQUATIONS

Chapter 11 ORDINARY DIFFERENTIAL EQUATIONS Chapter 11 ORDINARY DIFFERENTIAL EQUATIONS The general form of a first order differential equations is = f(x, y) with initial condition y(a) = y a We seek the solution y = y(x) for x > a This is shown

More information

JACOBI S ITERATION METHOD

JACOBI S ITERATION METHOD ITERATION METHODS These are methods which compute a sequence of progressively accurate iterates to approximate the solution of Ax = b. We need such methods for solving many large linear systems. Sometimes

More information

x n+1 = x n f(x n) f (x n ), n 0.

x n+1 = x n f(x n) f (x n ), n 0. 1. Nonlinear Equations Given scalar equation, f(x) = 0, (a) Describe I) Newtons Method, II) Secant Method for approximating the solution. (b) State sufficient conditions for Newton and Secant to converge.

More information

ECE539 - Advanced Theory of Semiconductors and Semiconductor Devices. Numerical Methods and Simulation / Umberto Ravaioli

ECE539 - Advanced Theory of Semiconductors and Semiconductor Devices. Numerical Methods and Simulation / Umberto Ravaioli ECE539 - Advanced Theory of Semiconductors and Semiconductor Devices 1 General concepts Numerical Methods and Simulation / Umberto Ravaioli Introduction to the Numerical Solution of Partial Differential

More information

Introduction to Boundary Value Problems

Introduction to Boundary Value Problems Chapter 5 Introduction to Boundary Value Problems When we studied IVPs we saw that we were given the initial value of a function and a differential equation which governed its behavior for subsequent times.

More information

Finite difference method for elliptic problems: I

Finite difference method for elliptic problems: I Finite difference method for elliptic problems: I Praveen. C praveen@math.tifrbng.res.in Tata Institute of Fundamental Research Center for Applicable Mathematics Bangalore 560065 http://math.tifrbng.res.in/~praveen

More information

Scientific Computing: An Introductory Survey

Scientific Computing: An Introductory Survey Scientific Computing: An Introductory Survey Chapter 11 Partial Differential Equations Prof. Michael T. Heath Department of Computer Science University of Illinois at Urbana-Champaign Copyright c 2002.

More information

An Introduction to Numerical Methods for Differential Equations. Janet Peterson

An Introduction to Numerical Methods for Differential Equations. Janet Peterson An Introduction to Numerical Methods for Differential Equations Janet Peterson Fall 2015 2 Chapter 1 Introduction Differential equations arise in many disciplines such as engineering, mathematics, sciences

More information

INTRODUCTION TO PDEs

INTRODUCTION TO PDEs INTRODUCTION TO PDEs In this course we are interested in the numerical approximation of PDEs using finite difference methods (FDM). We will use some simple prototype boundary value problems (BVP) and initial

More information

The family of Runge Kutta methods with two intermediate evaluations is defined by

The family of Runge Kutta methods with two intermediate evaluations is defined by AM 205: lecture 13 Last time: Numerical solution of ordinary differential equations Today: Additional ODE methods, boundary value problems Thursday s lecture will be given by Thomas Fai Assignment 3 will

More information

An Overly Simplified and Brief Review of Differential Equation Solution Methods. 1. Some Common Exact Solution Methods for Differential Equations

An Overly Simplified and Brief Review of Differential Equation Solution Methods. 1. Some Common Exact Solution Methods for Differential Equations An Overly Simplified and Brief Review of Differential Equation Solution Methods We will be dealing with initial or boundary value problems. A typical initial value problem has the form y y 0 y(0) 1 A typical

More information

Lecture 18 Classical Iterative Methods

Lecture 18 Classical Iterative Methods Lecture 18 Classical Iterative Methods MIT 18.335J / 6.337J Introduction to Numerical Methods Per-Olof Persson November 14, 2006 1 Iterative Methods for Linear Systems Direct methods for solving Ax = b,

More information

PDE Solvers for Fluid Flow

PDE Solvers for Fluid Flow PDE Solvers for Fluid Flow issues and algorithms for the Streaming Supercomputer Eran Guendelman February 5, 2002 Topics Equations for incompressible fluid flow 3 model PDEs: Hyperbolic, Elliptic, Parabolic

More information

Review for Exam 2 Ben Wang and Mark Styczynski

Review for Exam 2 Ben Wang and Mark Styczynski Review for Exam Ben Wang and Mark Styczynski This is a rough approximation of what we went over in the review session. This is actually more detailed in portions than what we went over. Also, please note

More information

Elliptic Problems / Multigrid. PHY 604: Computational Methods for Physics and Astrophysics II

Elliptic Problems / Multigrid. PHY 604: Computational Methods for Physics and Astrophysics II Elliptic Problems / Multigrid Summary of Hyperbolic PDEs We looked at a simple linear and a nonlinear scalar hyperbolic PDE There is a speed associated with the change of the solution Explicit methods

More information

Math 411 Preliminaries

Math 411 Preliminaries Math 411 Preliminaries Provide a list of preliminary vocabulary and concepts Preliminary Basic Netwon's method, Taylor series expansion (for single and multiple variables), Eigenvalue, Eigenvector, Vector

More information

NUMERICAL SOLUTION OF ODE IVPs. Overview

NUMERICAL SOLUTION OF ODE IVPs. Overview NUMERICAL SOLUTION OF ODE IVPs 1 Quick review of direction fields Overview 2 A reminder about and 3 Important test: Is the ODE initial value problem? 4 Fundamental concepts: Euler s Method 5 Fundamental

More information

8. Introduction to Computational Fluid Dynamics

8. Introduction to Computational Fluid Dynamics 8. Introduction to Computational Fluid Dynamics We have been using the idea of distributions of singularities on surfaces to study the aerodynamics of airfoils and wings. This approach was very powerful,

More information

you expect to encounter difficulties when trying to solve A x = b? 4. A composite quadrature rule has error associated with it in the following form

you expect to encounter difficulties when trying to solve A x = b? 4. A composite quadrature rule has error associated with it in the following form Qualifying exam for numerical analysis (Spring 2017) Show your work for full credit. If you are unable to solve some part, attempt the subsequent parts. 1. Consider the following finite difference: f (0)

More information

Multi-Factor Finite Differences

Multi-Factor Finite Differences February 17, 2017 Aims and outline Finite differences for more than one direction The θ-method, explicit, implicit, Crank-Nicolson Iterative solution of discretised equations Alternating directions implicit

More information

Ordinary Differential Equations

Ordinary Differential Equations Ordinary Differential Equations We call Ordinary Differential Equation (ODE) of nth order in the variable x, a relation of the kind: where L is an operator. If it is a linear operator, we call the equation

More information

Chapter 7 Iterative Techniques in Matrix Algebra

Chapter 7 Iterative Techniques in Matrix Algebra Chapter 7 Iterative Techniques in Matrix Algebra Per-Olof Persson persson@berkeley.edu Department of Mathematics University of California, Berkeley Math 128B Numerical Analysis Vector Norms Definition

More information

(f(x) P 3 (x)) dx. (a) The Lagrange formula for the error is given by

(f(x) P 3 (x)) dx. (a) The Lagrange formula for the error is given by 1. QUESTION (a) Given a nth degree Taylor polynomial P n (x) of a function f(x), expanded about x = x 0, write down the Lagrange formula for the truncation error, carefully defining all its elements. How

More information

Applied Mathematics 205. Unit III: Numerical Calculus. Lecturer: Dr. David Knezevic

Applied Mathematics 205. Unit III: Numerical Calculus. Lecturer: Dr. David Knezevic Applied Mathematics 205 Unit III: Numerical Calculus Lecturer: Dr. David Knezevic Unit III: Numerical Calculus Chapter III.3: Boundary Value Problems and PDEs 2 / 96 ODE Boundary Value Problems 3 / 96

More information

The method of lines (MOL) for the diffusion equation

The method of lines (MOL) for the diffusion equation Chapter 1 The method of lines (MOL) for the diffusion equation The method of lines refers to an approximation of one or more partial differential equations with ordinary differential equations in just

More information

Lecture 42 Determining Internal Node Values

Lecture 42 Determining Internal Node Values Lecture 42 Determining Internal Node Values As seen in the previous section, a finite element solution of a boundary value problem boils down to finding the best values of the constants {C j } n, which

More information

Numerical Solutions to Partial Differential Equations

Numerical Solutions to Partial Differential Equations Numerical Solutions to Partial Differential Equations Zhiping Li LMAM and School of Mathematical Sciences Peking University Numerical Methods for Partial Differential Equations Finite Difference Methods

More information

The Conjugate Gradient Method

The Conjugate Gradient Method The Conjugate Gradient Method Classical Iterations We have a problem, We assume that the matrix comes from a discretization of a PDE. The best and most popular model problem is, The matrix will be as large

More information

Initial value problems for ordinary differential equations

Initial value problems for ordinary differential equations Initial value problems for ordinary differential equations Xiaojing Ye, Math & Stat, Georgia State University Spring 2019 Numerical Analysis II Xiaojing Ye, Math & Stat, Georgia State University 1 IVP

More information

FDM for parabolic equations

FDM for parabolic equations FDM for parabolic equations Consider the heat equation where Well-posed problem Existence & Uniqueness Mass & Energy decreasing FDM for parabolic equations CNFD Crank-Nicolson + 2 nd order finite difference

More information

Additive Manufacturing Module 8

Additive Manufacturing Module 8 Additive Manufacturing Module 8 Spring 2015 Wenchao Zhou zhouw@uark.edu (479) 575-7250 The Department of Mechanical Engineering University of Arkansas, Fayetteville 1 Evaluating design https://www.youtube.com/watch?v=p

More information

Basic Aspects of Discretization

Basic Aspects of Discretization Basic Aspects of Discretization Solution Methods Singularity Methods Panel method and VLM Simple, very powerful, can be used on PC Nonlinear flow effects were excluded Direct numerical Methods (Field Methods)

More information

Ordinary Differential Equations

Ordinary Differential Equations Ordinary Differential Equations Professor Dr. E F Toro Laboratory of Applied Mathematics University of Trento, Italy eleuterio.toro@unitn.it http://www.ing.unitn.it/toro September 19, 2014 1 / 55 Motivation

More information

Selected HW Solutions

Selected HW Solutions Selected HW Solutions HW1 1 & See web page notes Derivative Approximations. For example: df f i+1 f i 1 = dx h i 1 f i + hf i + h h f i + h3 6 f i + f i + h 6 f i + 3 a realmax 17 1.7014 10 38 b realmin

More information

Lab 1: Iterative Methods for Solving Linear Systems

Lab 1: Iterative Methods for Solving Linear Systems Lab 1: Iterative Methods for Solving Linear Systems January 22, 2017 Introduction Many real world applications require the solution to very large and sparse linear systems where direct methods such as

More information

Finite difference methods for the diffusion equation

Finite difference methods for the diffusion equation Finite difference methods for the diffusion equation D150, Tillämpade numeriska metoder II Olof Runborg May 0, 003 These notes summarize a part of the material in Chapter 13 of Iserles. They are based

More information

Partial differential equations

Partial differential equations Partial differential equations Many problems in science involve the evolution of quantities not only in time but also in space (this is the most common situation)! We will call partial differential equation

More information

Numerical Methods for Engineers and Scientists

Numerical Methods for Engineers and Scientists Numerical Methods for Engineers and Scientists Second Edition Revised and Expanded Joe D. Hoffman Department of Mechanical Engineering Purdue University West Lafayette, Indiana m MARCEL D E К К E R MARCEL

More information

Bindel, Fall 2016 Matrix Computations (CS 6210) Notes for

Bindel, Fall 2016 Matrix Computations (CS 6210) Notes for 1 Iteration basics Notes for 2016-11-07 An iterative solver for Ax = b is produces a sequence of approximations x (k) x. We always stop after finitely many steps, based on some convergence criterion, e.g.

More information

COURSE Iterative methods for solving linear systems

COURSE Iterative methods for solving linear systems COURSE 0 4.3. Iterative methods for solving linear systems Because of round-off errors, direct methods become less efficient than iterative methods for large systems (>00 000 variables). An iterative scheme

More information

Classical iterative methods for linear systems

Classical iterative methods for linear systems Classical iterative methods for linear systems Ed Bueler MATH 615 Numerical Analysis of Differential Equations 27 February 1 March, 2017 Ed Bueler (MATH 615 NADEs) Classical iterative methods for linear

More information

NUMERICAL MATHEMATICS AND COMPUTING

NUMERICAL MATHEMATICS AND COMPUTING NUMERICAL MATHEMATICS AND COMPUTING Fourth Edition Ward Cheney David Kincaid The University of Texas at Austin 9 Brooks/Cole Publishing Company I(T)P An International Thomson Publishing Company Pacific

More information

Notes for CS542G (Iterative Solvers for Linear Systems)

Notes for CS542G (Iterative Solvers for Linear Systems) Notes for CS542G (Iterative Solvers for Linear Systems) Robert Bridson November 20, 2007 1 The Basics We re now looking at efficient ways to solve the linear system of equations Ax = b where in this course,

More information

Applied Math for Engineers

Applied Math for Engineers Applied Math for Engineers Ming Zhong Lecture 15 March 28, 2018 Ming Zhong (JHU) AMS Spring 2018 1 / 28 Recap Table of Contents 1 Recap 2 Numerical ODEs: Single Step Methods 3 Multistep Methods 4 Method

More information

Math 1080: Numerical Linear Algebra Chapter 4, Iterative Methods

Math 1080: Numerical Linear Algebra Chapter 4, Iterative Methods Math 1080: Numerical Linear Algebra Chapter 4, Iterative Methods M. M. Sussman sussmanm@math.pitt.edu Office Hours: MW 1:45PM-2:45PM, Thack 622 March 2015 1 / 70 Topics Introduction to Iterative Methods

More information

Introduction. Math 1080: Numerical Linear Algebra Chapter 4, Iterative Methods. Example: First Order Richardson. Strategy

Introduction. Math 1080: Numerical Linear Algebra Chapter 4, Iterative Methods. Example: First Order Richardson. Strategy Introduction Math 1080: Numerical Linear Algebra Chapter 4, Iterative Methods M. M. Sussman sussmanm@math.pitt.edu Office Hours: MW 1:45PM-2:45PM, Thack 622 Solve system Ax = b by repeatedly computing

More information

Chapter 5 HIGH ACCURACY CUBIC SPLINE APPROXIMATION FOR TWO DIMENSIONAL QUASI-LINEAR ELLIPTIC BOUNDARY VALUE PROBLEMS

Chapter 5 HIGH ACCURACY CUBIC SPLINE APPROXIMATION FOR TWO DIMENSIONAL QUASI-LINEAR ELLIPTIC BOUNDARY VALUE PROBLEMS Chapter 5 HIGH ACCURACY CUBIC SPLINE APPROXIMATION FOR TWO DIMENSIONAL QUASI-LINEAR ELLIPTIC BOUNDARY VALUE PROBLEMS 5.1 Introduction When a physical system depends on more than one variable a general

More information

Chapter 8. Numerical Solution of Ordinary Differential Equations. Module No. 1. Runge-Kutta Methods

Chapter 8. Numerical Solution of Ordinary Differential Equations. Module No. 1. Runge-Kutta Methods Numerical Analysis by Dr. Anita Pal Assistant Professor Department of Mathematics National Institute of Technology Durgapur Durgapur-71309 email: anita.buie@gmail.com 1 . Chapter 8 Numerical Solution of

More information

Notes on Numerical Analysis

Notes on Numerical Analysis Notes on Numerical Analysis Alejandro Cantarero This set of notes covers topics that most commonly show up on the Numerical Analysis qualifying exam in the Mathematics department at UCLA. Each section

More information

Ordinary Differential Equations: Initial Value problems (IVP)

Ordinary Differential Equations: Initial Value problems (IVP) Chapter Ordinary Differential Equations: Initial Value problems (IVP) Many engineering applications can be modeled as differential equations (DE) In this book, our emphasis is about how to use computer

More information

NUMERICAL METHODS. lor CHEMICAL ENGINEERS. Using Excel', VBA, and MATLAB* VICTOR J. LAW. CRC Press. Taylor & Francis Group

NUMERICAL METHODS. lor CHEMICAL ENGINEERS. Using Excel', VBA, and MATLAB* VICTOR J. LAW. CRC Press. Taylor & Francis Group NUMERICAL METHODS lor CHEMICAL ENGINEERS Using Excel', VBA, and MATLAB* VICTOR J. LAW CRC Press Taylor & Francis Group Boca Raton London New York CRC Press is an imprint of the Taylor & Francis Croup,

More information

Numerical Analysis of Differential Equations Numerical Solution of Elliptic Boundary Value

Numerical Analysis of Differential Equations Numerical Solution of Elliptic Boundary Value Numerical Analysis of Differential Equations 188 5 Numerical Solution of Elliptic Boundary Value Problems 5 Numerical Solution of Elliptic Boundary Value Problems TU Bergakademie Freiberg, SS 2012 Numerical

More information

Butcher tableau Can summarize an s + 1 stage Runge Kutta method using a triangular grid of coefficients

Butcher tableau Can summarize an s + 1 stage Runge Kutta method using a triangular grid of coefficients AM 205: lecture 13 Last time: ODE convergence and stability, Runge Kutta methods Today: the Butcher tableau, multi-step methods, boundary value problems Butcher tableau Can summarize an s + 1 stage Runge

More information

1. Nonlinear Equations. This lecture note excerpted parts from Michael Heath and Max Gunzburger. f(x) = 0

1. Nonlinear Equations. This lecture note excerpted parts from Michael Heath and Max Gunzburger. f(x) = 0 Numerical Analysis 1 1. Nonlinear Equations This lecture note excerpted parts from Michael Heath and Max Gunzburger. Given function f, we seek value x for which where f : D R n R n is nonlinear. f(x) =

More information

Department of Mathematics California State University, Los Angeles Master s Degree Comprehensive Examination in. NUMERICAL ANALYSIS Spring 2015

Department of Mathematics California State University, Los Angeles Master s Degree Comprehensive Examination in. NUMERICAL ANALYSIS Spring 2015 Department of Mathematics California State University, Los Angeles Master s Degree Comprehensive Examination in NUMERICAL ANALYSIS Spring 2015 Instructions: Do exactly two problems from Part A AND two

More information

Scientific Computing: An Introductory Survey

Scientific Computing: An Introductory Survey Scientific Computing: An Introductory Survey Chapter 11 Partial Differential Equations Prof. Michael T. Heath Department of Computer Science University of Illinois at Urbana-Champaign Copyright c 2002.

More information

Time stepping methods

Time stepping methods Time stepping methods ATHENS course: Introduction into Finite Elements Delft Institute of Applied Mathematics, TU Delft Matthias Möller (m.moller@tudelft.nl) 19 November 2014 M. Möller (DIAM@TUDelft) Time

More information

PowerPoints organized by Dr. Michael R. Gustafson II, Duke University

PowerPoints organized by Dr. Michael R. Gustafson II, Duke University Part 6 Chapter 20 Initial-Value Problems PowerPoints organized by Dr. Michael R. Gustafson II, Duke University All images copyright The McGraw-Hill Companies, Inc. Permission required for reproduction

More information

Integration of Ordinary Differential Equations

Integration of Ordinary Differential Equations Integration of Ordinary Differential Equations Com S 477/577 Nov 7, 00 1 Introduction The solution of differential equations is an important problem that arises in a host of areas. Many differential equations

More information

CS 450 Numerical Analysis. Chapter 9: Initial Value Problems for Ordinary Differential Equations

CS 450 Numerical Analysis. Chapter 9: Initial Value Problems for Ordinary Differential Equations Lecture slides based on the textbook Scientific Computing: An Introductory Survey by Michael T. Heath, copyright c 2018 by the Society for Industrial and Applied Mathematics. http://www.siam.org/books/cl80

More information

Chapter 5. Formulation of FEM for Unsteady Problems

Chapter 5. Formulation of FEM for Unsteady Problems Chapter 5 Formulation of FEM for Unsteady Problems Two alternatives for formulating time dependent problems are called coupled space-time formulation and semi-discrete formulation. The first one treats

More information

Introduction of Partial Differential Equations and Boundary Value Problems

Introduction of Partial Differential Equations and Boundary Value Problems Introduction of Partial Differential Equations and Boundary Value Problems 2009 Outline Definition Classification Where PDEs come from? Well-posed problem, solutions Initial Conditions and Boundary Conditions

More information

PowerPoints organized by Dr. Michael R. Gustafson II, Duke University

PowerPoints organized by Dr. Michael R. Gustafson II, Duke University Part 5 Chapter 21 Numerical Differentiation PowerPoints organized by Dr. Michael R. Gustafson II, Duke University 1 All images copyright The McGraw-Hill Companies, Inc. Permission required for reproduction

More information

ECE257 Numerical Methods and Scientific Computing. Ordinary Differential Equations

ECE257 Numerical Methods and Scientific Computing. Ordinary Differential Equations ECE257 Numerical Methods and Scientific Computing Ordinary Differential Equations Today s s class: Stiffness Multistep Methods Stiff Equations Stiffness occurs in a problem where two or more independent

More information

Chapter 3 Second Order Linear Equations

Chapter 3 Second Order Linear Equations Partial Differential Equations (Math 3303) A Ë@ Õæ Aë áöß @. X. @ 2015-2014 ú GA JË@ É Ë@ Chapter 3 Second Order Linear Equations Second-order partial differential equations for an known function u(x,

More information

Scientific Computing: An Introductory Survey

Scientific Computing: An Introductory Survey Scientific Computing: An Introductory Survey Chapter 9 Initial Value Problems for Ordinary Differential Equations Prof. Michael T. Heath Department of Computer Science University of Illinois at Urbana-Champaign

More information

STABILITY FOR PARABOLIC SOLVERS

STABILITY FOR PARABOLIC SOLVERS Review STABILITY FOR PARABOLIC SOLVERS School of Mathematics Semester 1 2008 OUTLINE Review 1 REVIEW 2 STABILITY: EXPLICIT METHOD Explicit Method as a Matrix Equation Growing Errors Stability Constraint

More information

Lecture 4: Numerical solution of ordinary differential equations

Lecture 4: Numerical solution of ordinary differential equations Lecture 4: Numerical solution of ordinary differential equations Department of Mathematics, ETH Zürich General explicit one-step method: Consistency; Stability; Convergence. High-order methods: Taylor

More information

Lecture 10: Finite Differences for ODEs & Nonlinear Equations

Lecture 10: Finite Differences for ODEs & Nonlinear Equations Lecture 10: Finite Differences for ODEs & Nonlinear Equations J.K. Ryan@tudelft.nl WI3097TU Delft Institute of Applied Mathematics Delft University of Technology 21 November 2012 () Finite Differences

More information

SOLUTION OF EQUATION AND EIGENVALUE PROBLEMS PART A( 2 MARKS)

SOLUTION OF EQUATION AND EIGENVALUE PROBLEMS PART A( 2 MARKS) CHENDU COLLEGE OF ENGINEERING AND TECHNOLOGY (Approved by AICTE New Delhi, Affiliated to Anna University Chennai. Zamin Endathur Village, Madurntakam Taluk, Kancheepuram Dist.-603311.) MA6459 - NUMERICAL

More information

Numerical Analysis of Differential Equations Numerical Solution of Parabolic Equations

Numerical Analysis of Differential Equations Numerical Solution of Parabolic Equations Numerical Analysis of Differential Equations 215 6 Numerical Solution of Parabolic Equations 6 Numerical Solution of Parabolic Equations TU Bergakademie Freiberg, SS 2012 Numerical Analysis of Differential

More information

Ordinary Differential Equations

Ordinary Differential Equations Chapter 13 Ordinary Differential Equations We motivated the problem of interpolation in Chapter 11 by transitioning from analzying to finding functions. That is, in problems like interpolation and regression,

More information

Iterative Methods for Linear Systems

Iterative Methods for Linear Systems Iterative Methods for Linear Systems 1. Introduction: Direct solvers versus iterative solvers In many applications we have to solve a linear system Ax = b with A R n n and b R n given. If n is large the

More information

An Efficient Algorithm Based on Quadratic Spline Collocation and Finite Difference Methods for Parabolic Partial Differential Equations.

An Efficient Algorithm Based on Quadratic Spline Collocation and Finite Difference Methods for Parabolic Partial Differential Equations. An Efficient Algorithm Based on Quadratic Spline Collocation and Finite Difference Methods for Parabolic Partial Differential Equations by Tong Chen A thesis submitted in conformity with the requirements

More information

Numerical Solutions to Partial Differential Equations

Numerical Solutions to Partial Differential Equations Numerical Solutions to Partial Differential Equations Zhiping Li LMAM and School of Mathematical Sciences Peking University Discretization of Boundary Conditions Discretization of Boundary Conditions On

More information