Understanding Partial Differential Equations (PDEs) in Numerical Methods

Slide Note
Embed
Share

Explore the world of Partial Differential Equations (PDEs) in the context of numerical methods. Learn about PDE classification, linear and nonlinear PDEs, notation, representing solutions, and applications like the heat equation. Dive into examples and concepts to enhance your understanding.


Uploaded on Oct 05, 2024 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

E N D

Presentation Transcript


  1. CISE301: Numerical Methods Topic 9 Partial Differential Equations (PDEs) Lectures 37-39 KFUPM Read 29.1-29.2 & 30.1-30.4 CISE301_Topic9 KFUPM 1

  2. Lecture 37 Partial Differential Equations Partial Differential Equations (PDEs). What is a PDE? Examples of Important PDEs. Classification of PDEs. CISE301_Topic9 KFUPM 2

  3. Partial Differential Equations A partial differential equation (PDE) is an equation that involves an unknown function and its partial derivatives. Examples : 2 ( x , ) ( , ) u x t u x t = 2 t PDE involves two or more independen t variable s (in the example and x independen are t t variable s) CISE301_Topic9 KFUPM 3

  4. Notation 2 ( x , ) u x t = u xx u 2 2 ( , t ) x t = u xt x = Order of the PDE order of the highest order derivative . CISE301_Topic9 KFUPM 4

  5. Linear PDE Classification a PDE is linear if it is linear in the unknown function and its derivatives Example of linear PDE: 2 1 3 4 2 3 4 0 Examples of Nonlinear PDE + + + + + = cos(2 ) 0 u u u u u t xx xt u tt u x + = xx t x ( ) 2 + + = 2 3 0 u u u xx xt tt = u + +2 + 2 3 0 = u u u u u u xx xt t + 2 3 0 xx xt t t CISE301_Topic9 KFUPM 5

  6. Representing the Solution of a PDE (Two Independent Variables) Three main ways to represent the solution T=5.2 ( , ) T 1t x 1 t1 T=3.5 x1 Three dimensional plot of the function T(x,t) The axis represent the independent variables. The value of the function is displayed at grid points Different curves are used for different values of one of the independent variable CISE301_Topic9 KFUPM 6

  7. Heat Equation Different curve is used for each value of t ice ice Temperature Temperature at different x at t=0 x Thin metal rod insulated everywhere except at the edges. At t =0 the rod is placed in ice 2 ( x , ) ( , ) T x t T x t Position x = 0 2 t Temperature at different x at t=h = = , 0 ( T ) , 1 ( T ) 0 T t t = ( ) 0 , x sin( ) x CISE301_Topic9 KFUPM 7

  8. Heat Equation Temperature T(x,t) Time t ice ice ( , ) T 1t x 1 x 2 ( x , ) ( , ) T x t T x t = 0 t1 2 t = = , 0 ( T ) , 1 ( T ) 0 T t t x1 Position x = ( ) 0 , x sin( ) x CISE301_Topic9 KFUPM 8

  9. Linear Second Order PDEs Classification a second order linear PDE (2-independent variables) A u B u C u D + + + = 0, xx xy yy where , , and are functions of and is a function of , , , D x y u u A B C x y , and u x y 2 is classfied based on ( B B B 4 Para Hyperbolic Elliptic ) as follows: bolic B AC = 2 4 4 4 0 0 0 AC AC AC 2 2 CISE301_Topic9 KFUPM 9

  10. Linear Second Order PDE Examples (Classification) 2 ( , ) ( , ) T x 2 t T x t = Heat Equation 0 k x t = = = = 2 , , 0 0 4 0 A k B C B AC Heat Equation Parabolic __________ __________ __________ is ________ 2 2 ( , ) ( , ) u x 2 t u x 2 t = Wave Equation 0 x 2 t = = = , 1 , 0 1 4 0 A B C B AC Wave Equation is Hyperbolic CISE301_Topic9 KFUPM 10

  11. Classification of PDEs Linear Second order PDEs are important sets of equations that are used to model many systems in many different fields of science and engineering. Classification is important because: Each category relates to specific engineering problems. Different approaches are used to solve these categories. CISE301_Topic9 KFUPM 11

  12. Examples of PDEs PDEs are used to model many systems in many different fields of science and engineering. Important Examples: Wave Equation Heat Equation Laplace Equation Biharmonic Equation CISE301_Topic9 KFUPM 12

  13. Heat Equation 2 2 2 ( , , , ) ( , , , ) ( , , , ) ( , , , ) u x y 2 z t u x y 2 z t u x y 2 z t u x y z t + + = t x y z The function u(x,y,z,t)is used to represent the temperature at time t in a physical body at a point with coordinates (x,y,z) . CISE301_Topic9 KFUPM 13

  14. Simpler Heat Equation 2 ( , ) ( , ) u x 2 t u x t = t x x u(x,t)is used to represent the temperature at time t at the point x of the thin rod. CISE301_Topic9 KFUPM 14

  15. Wave Equation 2 2 2 2 ( , x , , ) ( , y , , ) ( , z , , ) ( , t , , ) u x y z t u x y z t u x y z t u x y z t + + = 2 2 2 2 The function u(x,y,z,t) is used to represent the displacement at time t of a particle whose position at rest is (x,y,z) . Used to model movement of 3D elastic body. CISE301_Topic9 KFUPM 15

  16. Laplace Equation 2 2 2 ( , x , , ) ( , y , , ) ( , z , , ) u x y z t u x y z t u x y z t + + = 0 2 2 2 Used to describe the steady state distribution of heat in a body. Also used to describe the steady state distribution of electrical charge in a body. CISE301_Topic9 KFUPM 16

  17. Biharmonic Equation 4 4 4 ( , 4 , ) ( 2 , , 2 ) ( , 4 , ) u x y t u x y t u x y t + + = 2 0 x x y y Used in the study of elastic stress. CISE301_Topic9 KFUPM 17

  18. Boundary Conditions for PDEs To uniquely specify a solution to the PDE, a set of boundary conditions are needed. Both regular and irregular boundaries are possible. ) , ( : Equation Heat 2 x = t 2 ( , ) u x t u x t = 0 t region of interest , 0 ( u ) 0 u t = , 1 ( u ) 0 t x = 1 ( ) 0 , x sin( ) x CISE301_Topic9 KFUPM 18

  19. The Solution Methods for PDEs Analytic solutions are possible for simple and special (idealized) cases only. To make use of the nature of the equations, different methods are used to solve different classes of PDEs. The methods discussed here are based on the finite difference technique. CISE301_Topic9 KFUPM 19

  20. Lecture 38 Parabolic Equations Parabolic Equations Heat Conduction Equation Explicit Method Implicit Method Cranks Nicolson Method CISE301_Topic9 KFUPM 20

  21. Parabolic Equations a second order linear PDE (2-independent variables , ) 0, xx xy yy A u B u C u D A B C D x y u u x y + + + = where , , and are functions of and is a function of , , , x y , and u x y = 2 is p arabolic if 4 0 B AC CISE301_Topic9 KFUPM 21

  22. Parabolic Problems 2 ( x , ) ( , ) T x t T x t = Heat Equation : 0 2 t = = x , 0 ( T ) , 1 ( T ) 0 T t t = ( ) 0 , x sin( ) ice ice x = 2 Parabolic * problem ( 4 ) 0 B AC * Boundary conditions needed are uniquely to specify solution. a CISE301_Topic9 KFUPM 22

  23. First Order Partial Derivative Finite Difference Forward Difference Method Backward Difference Method Central Difference Method T T T T T T T T T + + , 1 , 1 , 1 , , , 1 i j i j i j i j i j i j = = = , 2 x x x x x x CISE301_Topic9 KFUPM 23

  24. Finite Difference Methods Replace the derivatives by finite difference formula [ is function of and ] Central Difference Formulas : ( , ) 2 2 ( , ) ( ) 2 ( , ) i j i j T T T T x t t ( ) Forward Difference Formula: ( , ) ( , ) , x x t T x t T T x T x t + 1, 1, i j i j x + T T T 2 T x t x + 1, , 1, i j i j x i j 2 2 + 2 + , 1 , , 1 i j 2 2 t T T T T T x t T x t + + 1, , , 1 , i j i j i j i j t CISE301_Topic9 KFUPM 24

  25. Finite Difference Methods New Notation Central Difference Formulas : Superscript for t-axis and Subscript for x-axis Til-1 = Ti, l-1 = T(x, t t) l + l ( , ) T T T x t 1 2 1 i i ( x x 2 ( + 2 2 l + l l , ) T T T T x 2 t 1 1 i i i ) x x 2 + + 2 1 1 2 l l l ( , ) T T T T x 2 t i i i ( ) t t : Forward Difference Formula + 1 l + l l l ( , ) ( , ) T T T T T x t T x t 1 , i i i i x x t t CISE301_Topic9 KFUPM 25

  26. Solution of the PDEs 2 ( , ) T x t x ( , ) T x t t = HeatEquation 0 2 t = = (0, ) (1, ) 0 T t T t = ( ,0) T x sin( ) x x Solution means: Determine the value of ( , ) at the grid points. T x t CISE301_Topic9 KFUPM 26

  27. Solution of the Heat Equation Two solutions to the Parabolic Equation (Heat Equation) will be presented: 1. Explicit Method Simple, Stability Problems. 2. Crank-Nicolson Method (Implicit Method) Involves the solution of a Tridiagonal system of equations, Stable. CISE301_Topic9 KFUPM 27

  28. 1. Explicit Method Centeral DD 2 ( , ) u x t x h t + ( , ) u x t t u x t h = 0 Forward DD 2 , ) 2 ( , ) + u x h t + ( ( , ) ( , u x t ) ( , ) u x t u x k = 2 k k h ( ) ( = ) + , ) 2 ( , ) h t + u x h t + ( ( , ) ( , u x t ) ( , ) u x t u x u x t k 2 k h = Define 2 + = + , ) (1 2 ) ( , ) h t + + x h ( , u x ) ( ( , ) t t k u x u x t u CISE301_Topic9 KFUPM 28

  29. 1. Explicit Method How Do We Compute? + = + , ) (1 2 ) ( , ) t h + + x h ( , u x me ) ( ( , ) t t n k u x u x t u a s u(x,t+k) u(x-h,t) u(x,t) u(x+h,t) CISE301_Topic9 KFUPM 29

  30. 1. Explicit Method How Do We Compute? + = + , ) (1 2 ) ( , ) t h + + x h ( , u x me ) ( ( , ) t t n k u x u x t u a s CISE301_Topic9 KFUPM 30

  31. 1. Explicit Method + + ( , ( , u x ) can be computed directly using: ) ( , ) (1 2 ) ( , ) u t h x = + + u x t t k k + x h ( , ) t u x t u ( ) Can be unstab i.e., errors are magnified . le 2 h To guarantee stabil , (1 2 ) ity 0 . or k 2 This makes it s l w o . CISE301_Topic9 KFUPM 31

  32. 2. Crank-Nicolson Method 2 ( , ) u x t x h t + ( , ) u x t t u x t h = 0 2 , ) 2 ( , ) + u x h t ( ( , ) ( , ) u x t ( , u x t k ) u x k = 2 k h ( ) ( = ) + , ) 2 ( , ) h t + u x h t ( ( , ) ( , ) u x t ( , u x t ) u x u x t k 2 2 h k = = = + , 2 Define s r s x h + + ( , u x ) ( , ) t ( , ) x ( , ) h s t k u r u t u x t CISE301_Topic9 KFUPM 32

  33. 2. Crank-Nicolson Method How Do We Compute? = + + ( , u x me ns a ) ( , ) t h ( , ) x ( , ) t h s t k u x r u t u x u(x-h,t) u(x,t) u(x+h,t) u(x,t - k) CISE301_Topic9 KFUPM 33

  34. 2. Crank-Nicolson Method The equation: ( , can be expressed as a Tridiagonal system of equations: 1 1 1 1 1 1 u r = + + x h ) ( , ) h ( , ) x ( , ) t s u x t k u x t r u t u u u u b b b b r 1 1 r 2 2 = r 3 3 4 4 CISE301_Topic9 KFUPM 34

  35. 2. Crank-Nicolson Method The method involves solving a Tridiagonal system of linear equations. The method is stable (No magnification of error). We can use larger , (compared to the Explicit Method). h k CISE301_Topic9 KFUPM 35

  36. Examples Explicit method to solve Parabolic PDEs. Cranks-Nicholson Method. CISE301_Topic9 KFUPM 36

  37. Heat Equation 2 ( x , ) ( , ) u x t u x t = 0 2 t = = x , 0 ( u ) , 1 ( u ) 0 u t t = ( ) 0 , x sin( ) ice ice x = 2 Parabolic * problem ( 4 ) 0 B AC * Auxiliary conditions needed are uniquely to specify solution. a CISE301_Topic9 KFUPM 37

  38. Example 1 (Explicit Method) Solve the PDE: u(x,t) x u t u x = 2 u(x,t) t t = 0 2 = = (0, ) ( ,0) (1, ) sin( 0 ) u x = = 0.25, 0.25 to find ( , ) for [0,1], [0,1] Use h k u t x x t k h = = 4 2 CISE301_Topic9 KFUPM 38

  39. Example 1 (Cont.) 2 ( x , ) ( , ) u x t u x t = 0 2 t + + + ( , ) 2 ( h , ) ( , ) ( , ) ( , ) u x h t u x t u x h t u x t k u x t = 0 2 k ( x ) + ( u ) + + + + = 16 u ( t , = ) 2 ( , ) ( , ) 4 ( x , ) ( , ) 0 u x + h t u x + t u x h t u x t k u x t ( , ) 4 ( , ) 7 ( , ) 4 ( , ) k u x h t u x t h t CISE301_Topic9 KFUPM 39

  40. Example 1 + = + + ( , ) 4 ( , ) 7 ( , ) 4 ( , ) u x t k u x h t u x t u x h t 0 0 t=1.0 0 0 t=0.75 t=0.5 0 0 t=0.25 0 0 0 0 t=0 Sin(0.25 ) Sin(0. 5 ) Sin(0.75 ) x=0.0 x=1.0 x=0.25 x=0.5 x=0.75 CISE301_Topic9 KFUPM 40

  41. Example 1 = + . 0 ( u 25 . 0 , 25 ) 4 ) 0 , 5 (. 7 (. 25 ) 0 , 4 + ) 0 , 0 ( = u u u = 9497 . 0 4 sin( ) 2 / 7 sin( ) 4 / 0 0 0 t=1.0 0 0 t=0.75 t=0.5 0 0 t=0.25 0 0 0 0 t=0 Sin(0.25 ) Sin(0. 5 ) Sin(0.75 ) x=0.0 x=1.0 x=0.25 x=0.5 x=0.75 CISE301_Topic9 KFUPM 41

  42. Example 1 = + . 0 , 5 . 0 ( u 25 ) 4 . 0 ( u 75 ) 0 , 7 ) 0 , 5 . 0 ( u 4 + . 0 ( u 25 ) 0 , = = 1716 . 0 4 sin( 3 ) 4 / 7 sin( ) 2 / 4 sin( ) 4 / 0 0 t=1.0 0 0 t=0.75 t=0.5 0 0 t=0.25 0 0 0 0 t=0 Sin(0.25 ) Sin(0. 5 ) Sin(0.75 ) x=0.0 x=1.0 x=0.25 x=0.5 x=0.75 CISE301_Topic9 KFUPM 42

  43. Remarks on Example 1 The obtained results are probably because: 1 2 no t accurate = 7 For accurate results: 1 2 One needs to select 0 5 0.0312 k = Let 0.02 5 k CISE301_Topic9 KFUPM 43

  44. Example 1 + 4 . 0 = + 2 . 0 + 4 . 0 + ( , ) ( , ) ( , ) ( , ) u x t k u x h t u x t u x h t 0 0 t=0.10 0 0 t=0.075 t=0.05 0 0 t=0.025 0 0 0 0 t=0 Sin(0.25 ) Sin(0. 5 ) Sin(0.75 ) x=0.0 x=1.0 x=0.25 x=0.5 x=0.75 CISE301_Topic9 KFUPM 44

  45. Example 1 025 . 0 , 25 . 0 ( u 4 . 0 = 2 . 0 + + ) ) 0 , 5 . 0 ( . 0 ( 25 ) 0 , + 4 . 0 = ) 0 , 0 ( u u u 4 . 0 = 2 . + sin( ) 2 / sin( ) 4 / 0 0.5414 0 0 t=0.10 0 0 t=0.075 t=0.05 0 0 t=0.025 0 0 0 0 t=0 Sin(0.25 ) Sin(0. 5 ) Sin(0.75 ) x=0.0 x=1.0 x=0.25 x=0.5 x=0.75 CISE301_Topic9 KFUPM 45

  46. Example 1 4 . 0 = 2 . 0 + 4 . 0 + . 0 , 5 . 0 ( u 025 ) . 0 ( u 75 ) 0 , ) 0 , 5 . 0 ( . 0 ( u 25 ) 0 , u 4 . 0 = 2 . + 4 . 0 + = sin( 3 ) 4 / sin( ) 2 / sin( ) 4 / 0.7657 0 0 t=0.10 0 0 t=0.075 t=0.05 0 0 t=0.025 0 0 0 0 t=0 Sin(0.25 ) Sin(0. 5 ) Sin(0.75 ) x=0.0 x=1.0 x=0.25 x=0.5 x=0.75 CISE301_Topic9 KFUPM 46

  47. Example 2 (Crank-Nicolson Method) Solve the PDE: u(x,t) x u t u x = 2 u(x,t) t t = 0 2 = = (0, ) ( ,0) (1, ) sin( 0 ) u x Solve using Crank-Nicolson method 0.25, Use h k = = 0.25 to find ( , ) for [0,1], [0,1] u t x x t CISE301_Topic9 KFUPM 47

  48. Example 2 Crank-Nicolson Method 2 ( , ) u x t x h t + ( , ) u x t t u x t h u x t = 0 2 , ) 2 ( , ) + u x h t ( ( , ) ( , ) u x t ( , u x t k u x t ) u x k = 2 ( ) ( ) + + u x h t = 16 ( , ) 2 ( , ) h t ( , ) 4 ( , ) ( , u x t ) 0 u x k 2 h k k = = = + = 0.25, 2 2.25 Define s r s = u x h t + + 0. 25 ( , u x t ) ( , ) 2.2 5 ( , ) ( u x t , ) x h t CISE301_Topic9 KFUPM 48

  49. Example 2 = + 0.25 (0.25,0) 0.25sin(0.25 ) 0 2.25 (0,0.25) 2.25 (0.25,0.25) u u = + (0.5,0.25) u u u u 1 2 0 0 t=1.0 0 0 t=0.75 t=0.5 0 0 u1 u2 u3 t=0.25 0 0 0 0 t=0 Sin(0.25 ) Sin(0. 5 ) Sin(0.75 ) x=0.0 x=1.0 x=0.25 x=0.5 x=0.75 CISE301_Topic9 KFUPM 49

  50. Example 2 = + 0.25 (0.5,0) 0.25sin(0.5 ) (0.25,0.25) 2.25 (0.5,0.25) 2.25 u u u = + (0.75,0.25) u u u u 1 2 3 0 0 t=1.0 0 0 t=0.75 t=0.5 0 0 u1 u2 u3 t=0.25 0 0 0 0 t=0 Sin(0.25 ) Sin(0. 5 ) Sin(0.75 ) x=0.0 x=1.0 x=0.25 x=0.5 x=0.75 CISE301_Topic9 KFUPM 50

Related


More Related Content