Lecture 42 Determining Internal Node Values

Similar documents
FDM for parabolic equations

Chapter 1: Introduction

Finite Difference Methods for

Ordinary Differential Equations: Initial Value problems (IVP)

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

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

Scientific Computing: An Introductory Survey

Fourth Order RK-Method

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

Chapter 6 - Ordinary Differential Equations

Computation Fluid Dynamics

Consistency and Convergence

Solving ODEs and PDEs in MATLAB. Sören Boettcher

Logistic Map, Euler & Runge-Kutta Method and Lotka-Volterra Equations

Initial Value Problems

Graded Project #1. Part 1. Explicit Runge Kutta methods. Goals Differential Equations FMN130 Gustaf Söderlind and Carmen Arévalo

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

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

1 Systems of First Order IVP

Mathematics Qualifying Exam Study Material

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

Approximations of diffusions. Mathématiques appliquées (MATH0504-1) B. Dewals, Ch. Geuzaine

ENGI Partial Differentiation Page y f x

Math 4263 Homework Set 1

Numerical Methods - Initial Value Problems for ODEs

APPLICATIONS OF FD APPROXIMATIONS FOR SOLVING ORDINARY DIFFERENTIAL EQUATIONS

Ordinary Differential Equations

Linear Multistep Methods I: Adams and BDF Methods

2tdt 1 y = t2 + C y = which implies C = 1 and the solution is y = 1

Applied Math for Engineers

Finite difference methods for the diffusion equation

Numerical Methods for Differential Equations

Initial value problems for ordinary differential equations

An Introduction to Numerical Methods for Differential Equations. Janet Peterson

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

Math 225 Differential Equations Notes Chapter 1

10.34: Numerical Methods Applied to Chemical Engineering. Lecture 19: Differential Algebraic Equations

Euler s Method, cont d

MA/CS 615 Spring 2019 Homework #2

Scientific Computing with Case Studies SIAM Press, Lecture Notes for Unit V Solution of

multistep methods Last modified: November 28, 2017 Recall that we are interested in the numerical solution of the initial value problem (IVP):

Time Integration Methods for the Heat Equation

Introduction to the Numerical Solution of IVP for ODE

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

Streamline calculations. Lecture note 2

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

Chapter 9b: Numerical Methods for Calculus and Differential Equations. Initial-Value Problems Euler Method Time-Step Independence MATLAB ODE Solvers

Ordinary Differential Equations II

Definition of differential equations and their classification. Methods of solution of first-order differential equations

Mini project ODE, TANA22

Initial Value Problems

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

Numerical Solutions to Partial Differential Equations

Do not turn over until you are told to do so by the Invigilator.

Numerical Differential Equations: IVP

1 Error Analysis for Solving IVP

Ordinary Differential Equations

Numerical Analysis of Differential Equations Numerical Solution of Parabolic Equations

MASSACHUSETTS INSTITUTE OF TECHNOLOGY DEPARTMENT OF MECHANICAL ENGINEERING CAMBRIDGE, MASSACHUSETTS NUMERICAL FLUID MECHANICS FALL 2011

Math 251 December 14, 2005 Answer Key to Final Exam. 1 18pt 2 16pt 3 12pt 4 14pt 5 12pt 6 14pt 7 14pt 8 16pt 9 20pt 10 14pt Total 150pt

Finite Difference Methods for Boundary Value Problems

Implicit Functions, Curves and Surfaces

2.29 Numerical Fluid Mechanics Fall 2011 Lecture 20

Do not turn over until you are told to do so by the Invigilator.

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

10.34 Numerical Methods Applied to Chemical Engineering Fall Homework #4: IVP

INTRODUCTION TO PDEs

Lecture 6. Numerical Solution of Differential Equations B21/B1. Lecture 6. Lecture 6. Initial value problem. Initial value problem

ENGI Partial Differentiation Page y f x

Lecture 2. Introduction to Differential Equations. Roman Kitsela. October 1, Roman Kitsela Lecture 2 October 1, / 25

ODE Runge-Kutta methods

Linear Multistep Methods

Lecture 8: Calculus and Differential Equations

Lecture 8: Calculus and Differential Equations

Numerical Methods for Differential Equations

Lecture 28 The Main Sources of Error

Partial Differential Equations (PDEs) and the Finite Difference Method (FDM). An introduction

Differential Equations FMNN10 Graded Project #1 c G Söderlind 2017

Introduction to PDEs and Numerical Methods Tutorial 11. 2D elliptic equations

Simple ODE Solvers - Derivation

Numerical Methods - Boundary Value Problems for ODEs

Question 9: PDEs Given the function f(x, y), consider the problem: = f(x, y) 2 y2 for 0 < x < 1 and 0 < x < 1. x 2 u. u(x, 0) = u(x, 1) = 0 for 0 x 1

24, B = 59 24, A = 55

APPM 2360: Final Exam 10:30am 1:00pm, May 6, 2015.

Identification Methods for Structural Systems. Prof. Dr. Eleni Chatzi Lecture March, 2016

Theory, Solution Techniques and Applications of Singular Boundary Value Problems

2.2 Separable Equations

Lecture 10. (2) Functions of two variables. Partial derivatives. Dan Nichols February 27, 2018

Lecture Notes on Numerical Differential Equations: IVP

6.1 Matrices. Definition: A Matrix A is a rectangular array of the form. A 11 A 12 A 1n A 21. A 2n. A m1 A m2 A mn A 22.

2.1 Differential Equations and Solutions. Blerina Xhabli

FIRST-ORDER ORDINARY DIFFERENTIAL EQUATIONS III: Numerical and More Analytic Methods David Levermore Department of Mathematics University of Maryland

Physics 584 Computational Methods

MATH 353 LECTURE NOTES: WEEK 1 FIRST ORDER ODES

You may not use your books, notes; calculators are highly recommended.

PHY307F/407F - Computational Physics Background Material for Expt. 3 - Heat Equation David Harrison

Ordinary differential equations - Initial value problems

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

where is the Laplace operator and is a scalar function.

Ordinary Differential equations

Transcription:

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 are the values of the solution at the nodes. The interior nodes values are determined by variational principles. Variational principles usually amount to minimizing internal energy. It is a physical principle that systems seek to be in a state of minimal energy and this principle is used to find the internal node values. Variational Principles For the differential equations that describe many physical systems, the internal energy of the system is an integral. For instance, for the steady state heat equation the internal energy is the integral I[u] = R u xx (x, y) + u yy (x, y) = g(x, y) (42.1) u 2 x(x, y) + u 2 y(x, y) + 2g(x, y)u(x, y) da, (42.2) where R is the region on which we are working. It can be shown that u(x, u) is a solution of (42.1) if and only if it is minimizer of I[u] in (42.2). The finite element solution Recall that a finite element solution is a linear combination of finite element functions: U(x, y) = C j Φ j (x, y), where n is the number of nodes. To obtain the values at the internal nodes, we will plug U(x, y) into the energy integral and minimize. That is, we find the minimum of I[U] for all choices of {C j } m, where m is the number of internal nodes. In this as with any other minimization problem, the way to find a possible minimum is to differentiate the quantity with respect to the variables 160

161 and set the results to zero. In this case the free variables are {C j } m. Thus to find the minimizer we should try to solve I[U] = 0 for 1 j m. (42.3) We call this set of equations the internal node equations. At this point we should ask whether the internal node equations can be solved, and if so, is the solution actually a minimizer (and not a maximizer). The following two facts answer these questions. These facts make the finite element method practical: For most applications the internal node equations are linear. For most applications the internal node equations give a minimizer. We can demonstrate the first fact using an example. Application to the steady state heat equation If we plug the candidate finite element solution U(x, y) into the energy integral for the heat equation (42.2), we obtain I[U] = U x (x, y) 2 + U y (x, y) 2 + 2g(x, y)u(x, y) da. (42.4) Differentiating with respect to C j we obtain the internal node equations 0 = R Now we have several simplifications. First note that since R 2U x U x + 2U y U y + 2g(x, y) U da for 1 j m. (42.5) U(x, y) = C j Φ j (x, y), we have Also note that and so U x (x, y) = U = Φ j (x, y). U x = (Φ j ) x. C j x Φ j(x, y), Similarly, Uy = (Φ j ) y. The integral (42.5) then becomes 0 = 2 U x (Φ j ) x + U y (Φ j ) y + g(x, y)φ j (x, y) da for 1 j m.

162 LECTURE 42. DETERMINING INTERNAL NODE VALUES Next we use the fact that the region R is subdivided into triangles { } p i=1 and the functions in question have different definitions on each triangle. The integral then is a sum of the integrals: p 0 = 2 U x (Φ j ) x + U y (Φ j ) y + g(x, y)φ j (x, y) da for 1 j m. i=1 Now note that the function Φ j (x, y) is linear on triangle and so This gives us the simplifications Also, U x and U y restricted to have the form Φ ij (x, y) = Φ j Ti (x, y) = a ij + b ij x + c ij y. (Φ ij ) x (x, y) = b ij and (Φ ij ) y (x, y) = c ij. U x = C k b ik and U y = The internal node equations then reduce to 0 = p i=1 C k c ik. ( n ) ( n ) C k b ik b ij + C k c ik c ij + g(x, y)φ ij (x, y) da for 1 j m. Now notice that ( n C kb ik ) b ij is just a constant on, and, thus, we have ( n ) ( n ) [( n ) ( n ) ] C k b ik b ij + C k c ik c ij = C k b ik b ij + C k c ik c ij A i, where A i is just the area of. Finally, we apply the Three Corners rule to make an approximation to the integral g(x, y)φ ij (x, y) da. Since Φ ij (x k, y k ) = 0 if k j and even Φ ij (x j, y j ) = 0 if does not have a corner at (x j, y j ), we get the approximation Φ ij (x j, y j )g(x j, y j )A i /3. If does have a corner at (x j, y j ) then Φ ij (x j, y j ) = 1. Summarizing, the internal node equations are 0 = [( p n ) ( n ) ] C k b ik b ij + C k c ik c ij + 1 3 g(x j, y j )Φ ij (x j, y j ) A i for 1 j m. i=1 While not pretty, these equations are in fact linear in the unknowns {C j }.

163 Experiment Download the program myfiniteelem.m from the class web site. This program produces a finite element solution for the steady state heat equation without source term: u xx + u yy = 0. To use it, you first need to set up the region and boundary values by running a script such as mywasher or mywedge. Try different settings for the boundary values z. You will see that the program works no matter what you choose. Exercises 42.1 Study for the final!

Review of Part IV Methods and Formulas Initial Value Problems Reduction to First order system: For an n-th order equation that can be solved for the n-th derivative ( ) x (n) = f t, x, ẋ, ẍ,..., dn 1 x dt n 1 use the standard change of variables: Differentiating results in a first-order system: y 1 = x y 2 = ẋ. y n = x (n 1) = dn 1 x dt n 1. (42.6) (42.7) ẏ 1 = ẋ = y 2 ẏ 2 = ẍ = y 3. ẏ n = x (n) = f(t, y 1, y 2,..., y n ). (42.8) Euler s method: y i+1 = y i + hf(t i, y i ). Modified (or Improved) Euler method: k 1 = hf(t i, y i ) k 2 = hf(t i + h, y i + k 1 ) y i+1 = y i + 1 2 (k 1 + k 2 ) 164

165 Boundary Value Probems Finite Differences: Replace the Differential Equation by Difference Equations on a grid. Review the lecture on Numerical Differentiation. Explicit Method Finite Differences for Parabolic PDE (heat): leads to u t u i,j+1 u ij k and u xx u i 1,j 2u ij + u i+1,j h 2 (42.9) u i,j+1 = ru i 1,j + (1 2r)u i,j + ru i+1,j, where h = L/m, k = T/n, and r = ck/h 2. The stability condition is r < 1/2. Implicit Method Finite Differences for Parabolic PDE (heat): leads to u t u i,j+1 u ij k and u xx u i+1,j+1 2u i,j+1 + u i 1,j+1 h 2 (42.10) u i,j = ru i 1,j+1 + (1 + 2r)u i,j+1 ru i+1,j+1, which is always stable and has truncation error O(h 2 + k). Crank-Nicholson Method Finite Differences for Parabolic PDE (heat): ru i 1,j+1 + 2(1 + r)u i,j+1 ru i+1,j+1 = ru i 1,j + 2(1 r)u i,j + ru i+1,j, which is always stable and has truncation error O(h 2 + k 2 ). Finite Difference Method for Elliptic PDEs: u xx + u yy = f(x, y) u i+1,j 2u ij + u i 1,j h 2 + u i,j+1 2u ij + u i,j 1 k 2 = f(x i, y j ) = f ij, Finite Elements: Based on triangles instead of rectangles. Can be used for irregularly shaped objects. An element: Pyramid shaped function at a node. A finite element solution is a linear combination of finite element functions: U(x, y) = C j Φ j (x, y),

166 REVIEW OF PART IV where n is the number of nodes, and where U is an approximation of the true solution. C j is the value of the solution at node j. C j at the boundary nodes are given by boundary conditions. C j at interior nodes are determined by variation principles. The last step in determining C j s is solving a linear system of equations. Matlab Initial value problem solver that uses the Runge-Kutta 45 method, which has error O(h 5 ). The input y0 is the initial vector and tspan is the time span. You can either make f a vector valued anonymous function and do df = @(t,y)[ -y (2); y (1)] [T Y ] = ode45 (dy, tspan,y0) or make a function program that outputs a vector function dy = myf (t,y) dy = [-y (2); y (1)]; end and then do [T Y ] = ode45 (@myf, tspan,y0) The program ode45 and other Matlab IVP solvers use adaptive step size to achieve a desired local and global accuracy, with a default of tol = 10 6 for the global error. The chief benefit of higher order methods and variable step size is that they allow a program to take only as few steps as necessary.