Numerical Methods for Differential Equations



Similar documents
Numerical Methods for Differential Equations

Lecture Notes to Accompany. Scientific Computing An Introductory Survey. by Michael T. Heath. Chapter 10

Introduction to the Finite Element Method

SIXTY STUDY QUESTIONS TO THE COURSE NUMERISK BEHANDLING AV DIFFERENTIALEKVATIONER I

College of the Holy Cross, Spring 2009 Math 373, Partial Differential Equations Midterm 1 Practice Questions

Solving ODEs in Matlab. BP205 M.Tremont

Finite Difference Approach to Option Pricing

Chapter 9 Partial Differential Equations

Mean value theorem, Taylors Theorem, Maxima and Minima.

POISSON AND LAPLACE EQUATIONS. Charles R. O Neill. School of Mechanical and Aerospace Engineering. Oklahoma State University. Stillwater, OK 74078

Class Meeting # 1: Introduction to PDEs

Solved with COMSOL Multiphysics 4.3

Numerical Analysis Lecture Notes

MATH 425, PRACTICE FINAL EXAM SOLUTIONS.

Introduction to Partial Differential Equations. John Douglas Moore

APPLIED MATHEMATICS ADVANCED LEVEL

ORDINARY DIFFERENTIAL EQUATIONS

CITY UNIVERSITY LONDON. BEng Degree in Computer Systems Engineering Part II BSc Degree in Computer Systems Engineering Part III PART 2 EXAMINATION

Second Order Linear Partial Differential Equations. Part I

tegrals as General & Particular Solutions

An Introduction to Partial Differential Equations

Inner Product Spaces

Numerical Analysis An Introduction

Solutions for Review Problems

Elementary Differential Equations and Boundary Value Problems. 10th Edition International Student Version

Math 241, Exam 1 Information.

A First Course in Elementary Differential Equations. Marcel B. Finan Arkansas Tech University c All Rights Reserved

NUMERICAL ANALYSIS PROGRAMS

Finite Element Formulation for Beams - Handout 2 -

AN INTRODUCTION TO NUMERICAL METHODS AND ANALYSIS

Math Assignment 6

The Heat Equation. Lectures INF2320 p. 1/88

Student name: Earlham College. Fall 2011 December 15, 2011

1 Error in Euler s Method

Stability Analysis for Systems of Differential Equations

Solutions to Homework 5

Ordinary Differential Equations

Code: MATH 274 Title: ELEMENTARY DIFFERENTIAL EQUATIONS

5.4 The Heat Equation and Convection-Diffusion

Understanding Poles and Zeros

Introduction to Partial Differential Equations By Gilberto E. Urroz, September 2004

INTRODUCTION (Syllabus, Numerical Methods & Computational Tools)

General Theory of Differential Equations Sections 2.8, , 4.1

2 Integrating Both Sides

1. First-order Ordinary Differential Equations

= f x 1 + h. 3. Geometrically, the average rate of change is the slope of the secant line connecting the pts (x 1 )).

On computer algebra-aided stability analysis of dierence schemes generated by means of Gr obner bases

An Introduction to Partial Differential Equations in the Undergraduate Curriculum

19.7. Applications of Differential Equations. Introduction. Prerequisites. Learning Outcomes. Learning Style

Domain Decomposition Methods. Partial Differential Equations

5 Numerical Differentiation

CS 221. Tuesday 8 November 2011

Chapter 5. Methods for ordinary differential equations. 5.1 Initial-value problems

SOLUTIONS. f x = 6x 2 6xy 24x, f y = 3x 2 6y. To find the critical points, we solve

Lecture 17: Conformal Invariance

Physics 9e/Cutnell. correlated to the. College Board AP Physics 1 Course Objectives

Simple Harmonic Motion

Homework 2 Solutions

The integrating factor method (Sect. 2.1).

Fourth-Order Compact Schemes of a Heat Conduction Problem with Neumann Boundary Conditions

Does Black-Scholes framework for Option Pricing use Constant Volatilities and Interest Rates? New Solution for a New Problem

Synthesis of Four Bar Mechanism for Polynomial Function Generation by Complex Algebra

AP1 Oscillations. 1. Which of the following statements about a spring-block oscillator in simple harmonic motion about its equilibrium point is false?

An Introduction to Applied Mathematics: An Iterative Process

ME6130 An introduction to CFD 1-1

Chapter 3: Mathematical Models and Numerical Methods Involving First-Order Differential Equations

MAT 242 Differential Equations Mathematics

Iterative Solvers for Linear Systems

Practice Final Math 122 Spring 12 Instructor: Jeff Lang

Nonlinear Systems of Ordinary Differential Equations

A QUICK GUIDE TO THE FORMULAS OF MULTIVARIABLE CALCULUS

Copyright 2011 Casa Software Ltd.

Numerical Methods for Solving Systems of Nonlinear Equations

N 1. (q k+1 q k ) 2 + α 3. k=0

Experiment 9. The Pendulum

Discrete mechanics, optimal control and formation flying spacecraft

Lectures 5-6: Taylor Series

Numerical methods for American options

4.3 Lagrange Approximation

Numerical Methods for Differential Equations

1 Lecture 3: Operators in Quantum Mechanics

The Method of Least Squares

Parabolic Equations. Chapter 5. Contents Well-Posed Initial-Boundary Value Problem Time Irreversibility of the Heat Equation

Numerical Methods for Engineers

Constrained optimization.

Oscillations. Vern Lindberg. June 10, 2010

Fuzzy Differential Systems and the New Concept of Stability

Numerical Methods for Ordinary Differential Equations

How High a Degree is High Enough for High Order Finite Elements?

An important theme in this book is to give constructive definitions of mathematical objects. Thus, for instance, if you needed to evaluate.

Interactive simulation of an ash cloud of the volcano Grímsvötn

Two-Dimensional Conduction: Shape Factors and Dimensionless Conduction Heat Rates

Numerical Solution to Ordinary Differential Equations By Gilberto E. Urroz, September 2004

Introduction to Finite Difference Methods

CS & Applied Mathematics Dual Degree Curriculum Content

MEL 807 Computational Heat Transfer (2-0-4) Dr. Prabal Talukdar Assistant Professor Department of Mechanical Engineering IIT Delhi

Transcription:

Numerical Methods for Differential Equations Course objectives and preliminaries Gustaf Söderlind and Carmen Arévalo Numerical Analysis, Lund University Textbooks: A First Course in the Numerical Analysis of Differential Equations, by Arieh Iserles and Introduction to Mathematical Modelling with Differential Equations, by Lennart Edsberg c Gustaf Söderlind, Numerical Analysis, Mathematical Sciences, Lund University, 2010-11 Numerical Methods for Differential Equations p.1/26

Chapter 0: Objectives and Preliminaries Course structure and objectives What is Numerical Analysis? The four principles of Numerical Analysis Numerical Methods for Differential Equations p.2/26

1. Course structure and objectives To solve a differential equation analytically we look for a differentiable function that satisfies the equation Large, complex and nonlinear systems cannot be solved analytically Numerical Methods for Differential Equations p.3/26

1. Course structure and objectives To solve a differential equation analytically we look for a differentiable function that satisfies the equation Large, complex and nonlinear systems cannot be solved analytically Instead, we compute numerical solutions with standard methods and software Numerical Methods for Differential Equations p.3/26

Course objectives Understand correspondence between physics and mathematical equations Learn basic numerical techniques for solving differential equations Understand mathematics numerics interaction, and how to match numerical method to mathematical properties Construct elementary MATLAB programs for differential equations Numerical Methods for Differential Equations p.4/26

Course topics IVP Initial value problems first-order equations; higher-order equations; systems of differential equations Numerical Methods for Differential Equations p.5/26

Course topics IVP Initial value problems first-order equations; higher-order equations; systems of differential equations BVP Boundary value problems two-point boundary value problems; Sturm Liouville eigenvalue problems Numerical Methods for Differential Equations p.5/26

Course topics IVP Initial value problems first-order equations; higher-order equations; systems of differential equations BVP Boundary value problems two-point boundary value problems; Sturm Liouville eigenvalue problems PDE Partial differential equations advection equation; wave equation diffusion equation; Numerical Methods for Differential Equations p.5/26

Course topics IVP Initial value problems first-order equations; higher-order equations; systems of differential equations BVP Boundary value problems two-point boundary value problems; Sturm Liouville eigenvalue problems PDE Partial differential equations advection equation; wave equation diffusion equation; Applications in all three areas Numerical Methods for Differential Equations p.5/26

Initial value problems. Examples A first-order equation A simple equation without elementary analytical solution dy dt = y e t2, y(0) = y 0 Numerical Methods for Differential Equations p.6/26

Initial value problems. Examples A first-order equation A simple equation without elementary analytical solution A second-order equation Motion of a pendulum θ + g L sin θ = 0, θ(0) = θ 0, θ(0) = θ0 where θ(t) is the angle, g is the gravitational constant and L is the pendulum length Numerical Methods for Differential Equations p.6/26

Initial value problems. Examples A first-order equation A simple equation without elementary analytical solution A second-order equation Pendulum equation A system of equations Predator prey model ẏ 1 = k 1 y 1 k 2 y 1 y 2 ẏ 2 = k 3 y 1 y 2 k 4 y 2 where y 1 (t) is the population of the prey species and y 2 (t) is the population of the predator species at time t Numerical Methods for Differential Equations p.6/26

Boundary value problems. Examples Second-order two-point BVP The electrostatic potential u(r) between two concentric metal spheres satisfies d 2 u dr 2 + 2 r du dr = 0, u(r 1) = V 1, u(r 2 ) = 0 at the distance r from the center; R 1 and R 2 are the radii of the two spheres Numerical Methods for Differential Equations p.7/26

Boundary value problems. Examples Second-order two-point BVP The electrostatic potential u(r) between two concentric metal spheres satisfies d 2 u dr 2 + 2 r du dr = 0, u(r 1) = V 1, u(r 2 ) = 0 at the distance r from the center; R 1 and R 2 are the radii of the two spheres A Sturm Liouville eigenproblem Euler buckling of column y + λy = 0, y (0) = 0, y(1) = 0 Find eigenvalues λ and eigenfunctions y Numerical Methods for Differential Equations p.7/26

Some application areas in ODEs Initial value problems mechanics M q = F(q) electrical circuits C v = I(v) chemical reactions ċ = f(c) Boundary value problems materials u = M(u)/EI microphysics 2m ψ = E eigenmodes u + λu = 0 Numerical Methods for Differential Equations p.8/26

Partial differential equations. Examples The Poisson equation u xx + u yy = f(x,y) subject to u(x,y) = g(x,y) for x = 0 x = 1 y = 0 y = 1 is an elliptic PDE modelling e.g. the displacement an elastic membrane under load f u(x, y) of Numerical Methods for Differential Equations p.9/26

Partial differential equations. Examples The Poisson equation u xx + u yy = f(x,y) The Diffusion equation u t = u xx subject to u(x, 0) = f(x), x [0,a] u(0,t) = c 1, u(a,t) = c 2, t [0,b] is a parabolic PDE modelling e.g. the time evolution of temperature u(x, t) in an insulated rod with constant temperatures c 1 and c 2 at its ends, and initial temperature distribution f(x) Numerical Methods for Differential Equations p.9/26

Partial differential equations. Examples The Poisson equation u xx + u yy = f(x,y) The Diffusion equation u t = u xx The Wave equation u tt = u xx subject to u(0,t) = 0, u(a,t) = 0 for t [0,b] u(x, 0) = f(x) for x [0,a] u t (x, 0) = g(x) for x (0,a) is a hyperbolic PDE e.g. modelling the displacement u(x, t) of a vibrating elastic string fixed at x = 0 and x = a Numerical Methods for Differential Equations p.9/26

2. What is Numerical Analysis? Categories of mathematical problems Category Algebra Analysis linear computable not computable nonlinear not computable not computable Numerical Methods for Differential Equations p.10/26

2. What is Numerical Analysis? Categories of mathematical problems Category Algebra Analysis linear computable not computable nonlinear not computable not computable Algebra Only finite constructions Numerical Methods for Differential Equations p.10/26

2. What is Numerical Analysis? Categories of mathematical problems Category Algebra Analysis linear computable not computable nonlinear not computable not computable Algebra Analysis Only finite constructions Limits, derivatives, integrals etc. (transfinite) Numerical Methods for Differential Equations p.10/26

2. What is Numerical Analysis? Categories of mathematical problems Category Algebra Analysis linear computable not computable nonlinear not computable not computable Algebra Analysis Only finite constructions Limits, derivatives, integrals etc. (transfinite) Computable number of operations The exact solution can be obtained in a finite Numerical Methods for Differential Equations p.10/26

What is Numerical Analysis? Category Algebra Analysis linear computable not computable nonlinear not computable not computable With numerical methods, problems from all four categories can be solved: Numerical analysis aims to construct and analyze quantitative methods for the automatic computation of approximate solutions to mathematical problems. Goal: Construction of mathematical software Numerical Methods for Differential Equations p.11/26

3. The four principles of numerical analysis There are four basic principles in numerical analysis. Every computational method is constructed from these principles Discretization To replace a continuous problem by a discrete one Linear algebra tools, including polynomials All techniques that are computable Iteration To apply a computation repeatedly (convergence) Linearization To approximate a nonlinear problem by a linear one Numerical Methods for Differential Equations p.12/26

Discretization. From function to vector 1 0.5 0 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 1 0.5 0 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 1 0.5 0 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 A continuous function is sampled at discrete points Numerical Methods for Differential Equations p.13/26

Discretization... Reduces the amount of information in a problem to a finite set Select a subset Ω N = {x 0,x 1,...,x N } of distinct points from the interval Ω = [0, 1] Continuous function f(x) is replaced by vector F = {f(x k )} N 0 The subset Ω N is called the grid The vector F is called a grid function or discrete function Discretization yields a computable problem. Approximations are computed only at a finite set of grid points Numerical Methods for Differential Equations p.14/26

Discretization. Approximation of derivatives Definition of derivative f (x) = lim x 0 f(x + x) f(x) x Take x = x k+1 x k finite and approximate f (x k ) f(x k + x) f(x k ) x = F k+1 F k x k+1 x k How accurate is this approximation? Numerical Methods for Differential Equations p.15/26

Error and accuracy Expand in Taylor series f(x k + x) f(x k ) x f(x k) + xf (x k ) + O( x 2 ) f(x k ) x The error is proportional to x = f (x k ) + O( x) Try this formula for f(x) = e x at x k = 1 for various x Numerical Methods for Differential Equations p.16/26

Numerical differentiation Error in numerically calculated derivative of e x at x = 1 10 0 Error in numerical differentiation 10 2 10 4 log error 10 6 10 8 10 10 10 12 10 15 10 10 10 5 10 0 log step size Log error vs. log step size log x Numerical Methods for Differential Equations p.17/26

Numerical differentiation Error in numerically calculated derivative of e x at x = 1 10 0 Error in numerical differentiation 10 2 10 4 log error 10 6 10 8 10 10 10 12 10 15 10 10 10 5 10 0 log step size Log error vs. log step size log x Numerical Methods for Differential Equations p.18/26

Another approach Use a symmetric approximation f(x k + x) f(x k x) 2 x = F k+1 F k 1 x k+1 x k 1 = f (x k ) + O( x 2 ) The approximation is 2nd order accurate because error is x 2 Whenever you have a power law, plot in log log diagram r C x p log r log C + p log x This is a straight line with slope p, easy to identify Numerical Methods for Differential Equations p.19/26

Numerical 2nd order differentiation Error in numerically calculated derivative of e x at x = 1 10 0 Error in numerical differentiation 10 2 10 4 log error 10 6 10 8 10 10 10 12 10 15 10 10 10 5 10 0 log step size Log error vs. log step size log x Numerical Methods for Differential Equations p.20/26

Numerical 2nd order differentiation Error in numerically calculated derivative of e x at x = 1 10 0 Error in numerical differentiation 10 2 10 4 log error 10 6 10 8 10 10 10 12 10 15 10 10 10 5 10 0 log step size Log error vs. log step size log x Numerical Methods for Differential Equations p.21/26

1st and 2nd order comparison Error in numerically calculated derivative of e x at x = 1 10 0 Error in numerical differentiation 10 2 10 4 log error 10 6 10 8 10 10 10 12 10 15 10 10 10 5 10 0 log step size 2nd order approximation has much higher accuracy! Numerical Methods for Differential Equations p.22/26

Discretization of a differential equation Problem Solve ẏ = qy numerically on [0,T], with y(0) = y 0 The analytical solution is a function The numerical solution is a vector y k y(t k ), where t k = kt/n y(t) = y 0 e qt y = {y k } N k=0 with Method Approximate derivative by difference quotient, using step size t = t k+1 t k = T/N Numerical Methods for Differential Equations p.23/26

Discretization of a differential equation... Discretization method Approximate derivative by finite difference quotient y k+1 y k t k+1 t k ẏ(t k ) to get the linear algebraic equation system (k = 0, 1,...N) y k+1 y k t k+1 t k = qy k or y k+1 = ( 1 + qt N ) y k y N = ( 1 + qt N ) N y 0 Numerical Methods for Differential Equations p.24/26

Discretization of a differential equation... NOTE The numerical approximation at time T is y N = ( 1 + qt N ) N y 0 But ( lim 1 + qt N N ) N = e qt The numerical approximation converges to the exact solution as N Numerical Methods for Differential Equations p.25/26

Main course objective The course centers on discretization methods for differential equations of all types We will also encounter the other three principles of numerical analysis as we go linear algebra methods and polynomial techniques; iterative methods; and linearization Numerical Methods for Differential Equations p.26/26