Numerical Solution of Differential Equations



Similar documents
Visualizing Differential Equations Slope Fields. by Lin McMullin

Math Assignment 6

Solutions to Homework 5

Introduction to Algebraic Geometry. Bézout s Theorem and Inflection Points

Numerical Solution of Differential Equations

AP CALCULUS BC 2008 SCORING GUIDELINES

Section 12.6: Directional Derivatives and the Gradient Vector

SIXTY STUDY QUESTIONS TO THE COURSE NUMERISK BEHANDLING AV DIFFERENTIALEKVATIONER I

GRAPHING IN POLAR COORDINATES SYMMETRY

Numerical Methods for Differential Equations

The Fourth International DERIVE-TI92/89 Conference Liverpool, U.K., July Derive 5: The Easiest... Just Got Better!

Math 432 HW 2.5 Solutions

On using numerical algebraic geometry to find Lyapunov functions of polynomial dynamical systems

Solutions for Review Problems

THE COLLEGES OF OXFORD UNIVERSITY MATHEMATICS, JOINT SCHOOLS AND COMPUTER SCIENCE. Sample Solutions for Specimen Test 2

This makes sense. t /t 2 dt = 1. t t 2 + 1dt = 2 du = 1 3 u3/2 u=5

Practice Final Math 122 Spring 12 Instructor: Jeff Lang

Finite Elements for 2 D Problems

Analysis of Stresses and Strains

Envelope Theorem. Kevin Wainwright. Mar 22, 2004

x 2 + y 2 = 1 y 1 = x 2 + 2x y = x 2 + 2x + 1

Exam 1 Sample Question SOLUTIONS. y = 2x

Scan Conversion of Filled Primitives Rectangles Polygons. Many concepts are easy in continuous space - Difficult in discrete space

2.2 Derivative as a Function

To give it a definition, an implicit function of x and y is simply any relationship that takes the form:

Homework 2 Solutions

Separable First Order Differential Equations

ECG590I Asset Pricing. Lecture 2: Present Value 1

1.5 Equations of Lines and Planes in 3-D

Name: ID: Discussion Section:

Machine Learning and Data Mining. Regression Problem. (adapted from) Prof. Alexander Ihler

1 Determinants and the Solvability of Linear Systems

ab = c a If the coefficients a,b and c are real then either α and β are real or α and β are complex conjugates

Solutions to Practice Problems for Test 4

Orbits. Chapter 17. Dynamics of many-body systems.

5.7 Maximum and Minimum Values

MAT 274 HW 2 Solutions c Bin Cheng. Due 11:59pm, W 9/07, Points

( 1) = 9 = 3 We would like to make the length 6. The only vectors in the same direction as v are those

CS Software Engineering for Scientific Computing. Lecture 16: Particle Methods; Homework #4

The Two-Body Problem

SSLV105 - Stiffening centrifuges of a beam in rotation

RAJALAKSHMI ENGINEERING COLLEGE MA 2161 UNIT I - ORDINARY DIFFERENTIAL EQUATIONS PART A

= δx x + δy y. df ds = dx. ds y + xdy ds. Now multiply by ds to get the form of the equation in terms of differentials: df = y dx + x dy.

Solving ODEs in Matlab. BP205 M.Tremont

Exercise: Estimating the Mass of Jupiter Difficulty: Medium

Orbital Mechanics. Angular Momentum

The Math Circle, Spring 2004

Chapter 9. Systems of Linear Equations

FINAL EXAM SOLUTIONS Math 21a, Spring 03

General Theory of Differential Equations Sections 2.8, , 4.1

Numerical Analysis An Introduction

Some Comments on the Derivative of a Vector with applications to angular momentum and curvature. E. L. Lady (October 18, 2000)

Map Patterns and Finding the Strike and Dip from a Mapped Outcrop of a Planar Surface

Procedure for Graphing Polynomial Functions

Earth, Moon, and Sun Study Guide. (Test Date: )

Math 1302, Week 3 Polar coordinates and orbital motion

5 Numerical Differentiation

= = GM. v 1 = Ωa 1 sin i.

Derive 5: The Easiest... Just Got Better!

Numerical Methods for Differential Equations

Solving Differential Equations by Symmetry Groups

Progettazione Funzionale di Sistemi Meccanici e Meccatronici

Math 241, Exam 1 Information.

A QUICK GUIDE TO THE FORMULAS OF MULTIVARIABLE CALCULUS

Review of Matlab for Differential Equations. Lia Vas

Particular Solutions. y = Ae 4x and y = 3 at x = 0 3 = Ae = A y = 3e 4x

correct-choice plot f(x) and draw an approximate tangent line at x = a and use geometry to estimate its slope comment The choices were:

Solutions to Homework 10

MATH 425, PRACTICE FINAL EXAM SOLUTIONS.

LINEAR ALGEBRA W W L CHEN

UC Irvine FOCUS! 5 E Lesson Plan

Chapter 25.1: Models of our Solar System

2.2. Instantaneous Velocity

Night Sky III Planetary Motion Lunar Phases

Calculus. Contents. Paul Sutcliffe. Office: CM212a.

SECOND DERIVATIVE TEST FOR CONSTRAINED EXTREMA

Physics Midterm Review Packet January 2010

1. First-order Ordinary Differential Equations

Don't Forget the Differential Equations: Finishing 2005 BC4

Copyrighted Material. Chapter 1 DEGREE OF A CURVE

tegrals as General & Particular Solutions

Cost Minimization and the Cost Function

Coffeyville Community College #MATH 202 COURSE SYLLABUS FOR DIFFERENTIAL EQUATIONS. Ryan Willis Instructor


SOLUTIONS TO HOMEWORK ASSIGNMENT #4, MATH 253

Aim: How do we find the slope of a line? Warm Up: Go over test. A. Slope -

Class Meeting # 1: Introduction to PDEs

(Refer Slide Time: 1:42)

Consumer Theory. The consumer s problem

Algebra 2 PreAP. Name Period

MATHEMATICS Unit Pure Core 2

Gravity Field and Dynamics of the Earth

Understanding Basic Calculus

G.A. Pavliotis. Department of Mathematics. Imperial College London

Aim. Decimal Search. An Excel 'macro' was used to do the calculations. A copy of the script can be found in Appendix A.

Adding vectors We can do arithmetic with vectors. We ll start with vector addition and related operations. Suppose you have two vectors

16.1 Runge-Kutta Method

Chapter 7 Nonlinear Systems

Module 1 : Conduction. Lecture 5 : 1D conduction example problems. 2D conduction

Transcription:

Numerical Solution of Differential Equations 3 rd year JMC group project Summer Term 2004 Supervisor: Prof. Jeff Cash Saeed Amen Paul Bilokon Adam Brinley Codd Minal Fofaria Tejas Shah

Agenda Adam: Differential equations and numerical methods Paul: Basic methods (FE, BE, TR). Problem: circle Saeed: Advanced methods (4 th order). Problem: Kepler s equation Minal: Stiff equations Tejas: Derivation of 6 th order method

Agenda Adam: Differential equations and numerical methods Paul: Basic methods (FE, BE, TR). Problem: circle Saeed: Advanced methods (4 th order). Problem: Kepler s equation Minal: Stiff equations Tejas: Derivation of 6 th order method

Introduction to Differential Equations Equations involving a function y of x, and its derivatives Model real world systems General Equation:

Introduction to Differential Equations Simple example Solution obtained by integrating both sides Initial values can determine c

Introduction to Differential Equations Special case when equations do not involve x E.g. Initial values y(0) = 1 and y'(0) = 0, solution is

Introduction to Differential Equations Kepler s Equations of Planetary Motion Difficult to solve analytically we use numerical methods instead

Introduction to Differential Equations Forward Euler and Backward Euler Trapezium Rule General method Use initial value of y at x=0 Calculate next value (x=h for small h) using gradient Call this y 1 and repeat Need formula for y n+1 in terms of y n

Agenda Adam: Differential equations and numerical methods Paul: Basic methods (FE, BE, TR). Problem: circle Saeed: Advanced methods (4 th order). Problem: Kepler s equation Minal: Stiff equations Tejas: Derivation of 6 th order method

Agenda Adam: Differential equations and numerical methods Paul: Basic methods (FE, BE, TR). Problem: circle Saeed: Advanced methods (4 th order). Problem: Kepler s equation Minal: Stiff equations Tejas: Derivation of 6 th order method

Euler s Methods Simplest way of solving ODEs numerically Does not always produce reasonable solutions Forward Euler (explicit) and Backward Euler (implicit)

Forward Euler y True solution y(x + h) = y(x) + h y (x) Explicit y 2 Slope f(x 0, y 0 ) (x 2, y 2 ) Slope f(x 1, y 1 ) Approximated solution E loc = ½h 2 y (2) (ξ) h 2 First order Asymmetric y 1 (x 1, y 1 ) y 0 (x 0, y 0 ) h h x 0 x 1 x 2 x

Backward Euler y 2 y (x 2, y 2 ) y(x + h) = y(x) + h y (x + h) True solution Implicit E loc = - ½h 2 y (2) (ξ) h 2 y 1 Slope f(x 1, y 1 ) (x 1, y 1 ) Slope f(x 2, y 2 ) Approximated solution First order Asymmetric y 0 (x 0, y 0 ) h h x 0 x 1 x 2 x

Trapezium Rule y(x + h) = y(x) + ½ h [y (x) + y (x + h)] Average of FE and BE Implicit E loc = - (h 3 /12) f (2) (ξ) h 3 Second order Symmetric

Example Problem: Circle Consider y = -y, with initial conditions y(0) = 1 y (0) = 0 The analytical solution is y = cos x, that can be used for comparison with numerical solutions

Plots for the True Solution Time series plot (xy) Phase plane plot (zy)

Time Series y x

Phase Plane Plots: FE & BE Forward Euler Backward Euler

Phase Plane Plots: TR FE & BE fail: non-periodic TR: OK, periodic sol n W h y?

Symmetricity TR is symmetric, whereas FE & BE are not Still TR! y(x + h) = y(x) + ½ h [y (x) + y (x + h)] h -h y(x - h) = y(x) - ½ h [y (x) + y (x - h)] X := x - h y(x + h) = y(x) + ½ h [y (X) + y (X + h)]

Symmetricity TR is symmetric, whereas FE & BE are not Still FE? y(x + h) = y(x) + h y (x) h -h y(x - h) = y(x) - h y (x) X := x - h y(x + h) = y(x) + h y (X + h)

Time Step h = 10-1 h = 10-2

Agenda Adam: Differential equations and numerical methods Paul: Basic methods (FE, BE, TR). Problem: circle Saeed: Advanced methods (4 th order). Problem: Kepler s equation Minal: Stiff equations Tejas: Derivation of 6 th order method

Agenda Adam: Differential equations and numerical methods Paul: Basic methods (FE, BE, TR). Problem: circle Saeed: Advanced methods (4 th order). Problem: Kepler s equation Minal: Stiff equations Tejas: Derivation of 6 th order method

After Euler and TR Can create higher order methods, which have far smaller global errors Methods are more complex and require more computation on each step But for same step size more accurate Introduce concept of half step

Two Fourth Order Methods y n+1 y n = y n + h/2(y n ) + (h 2 /12)(4y n+½ + 2y n ) y n+1 y n = h/6(y n+1 + 4y n+½ + y n ) (*) Then to calculate the half-step we use either A or B A) y n+ ½ = ½(y n+1 + y n ) h 2 /48(y n+1 + 4y n+½ + y n ) B) y n+ ½ = y n + ½y n h 2 /192(-2y n+1 + 12y n+½ + 14y n ) Which one is more accurate? (next slide) Solve iteratively and then apply solution to find derivative (*)

Creating Method A Start with y n+1 y n = h/6[y n+1 + 4y n+½ + y n ] (1) diff. y n+1 y n = h/6[y n+1 + 4y n+½ + y n ] (2) y n+½ = ½(y n+1 + y n ) h/8(y n+1 y n ) (3) diff. y n+½ = ½(y n+1 + y n ) h/8(y n+1 y n ) (4) subs (4) into (1) (to eliminate y n+½ ) and eliminate y n+1 using (2), then use (2) in (3) to get half-step

Comparing Fourth Order Methods Comparing errors when solving circle problem Both A and B produce a much smaller order of error than Euler s

Finding Earth s Orbit Around Sun Kepler s Equation Can use it to find the orbit of planets Use to find orbit of earth around the sun Work in two dimensions z and y z = -(GM z) / (y 2 + z 2 ) 3/2 y = -(GM y) / (y 2 + z 2 ) 3/2 Constants and initial conditions in report

Results Plot Solution uses small step size h = 0.01 Becomes difficult to tell difference between methods visually Using h = 0.1 difference is more marked

Agenda Adam: Differential equations and numerical methods Paul: Basic methods (FE, BE, TR). Problem: circle Saeed: Advanced methods (4 th order). Problem: Kepler s equation Minal: Stiff equations Tejas: Derivation of 6 th order method

Agenda Adam: Differential equations and numerical methods Paul: Basic methods (FE, BE, TR). Problem: circle Saeed: Advanced methods (4 th order). Problem: Kepler s equation Minal: Stiff equations Tejas: Derivation of 6 th order method

Stiff Equations Certain systems of ODEs are classified as stiff A system of ODEs is stiff if there are two or more very different scales of the independent variable on which the dependent variables are changing Some of the methods used to find numerical solutions fail to obtain the required solution

Example Consider the equation: 2 d y dy + ( λ + 1) + λy = 2 dx dx With initial conditions: y( 0) = y' (0) 1 = 1 There are two solutions to this problem 0

Example continued Analytical solution: y=e -x Unwanted solution: y=e -λx We will now show how forward Euler is not stable when solving this problem under certain circumstances

Example continued Let λ = 10 3 and let (the step size) h = 0.1

Increasing the range of the x-axis

When h = 0.001

Agenda Adam: Differential equations and numerical methods Paul: Basic methods (FE, BE, TR). Problem: circle Saeed: Advanced methods (4 th order). Problem: Kepler s equation Minal: Stiff equations Tejas: Derivation of 6 th order method

Agenda Adam: Differential equations and numerical methods Paul: Basic methods (FE, BE, TR). Problem: circle Saeed: Advanced methods (4 th order). Problem: Kepler s equation Minal: Stiff equations Tejas: Derivation of 6 th order method

A Sixth Order Numerical Method Has an error term with smallest h degree as h 7 Idea is to find values for α, A, B, C, D, E, F, C, D, E, F such that:

Derivation Compare Taylor s Expansion of LHS and RHS So for: First expand the LHS

Derivation Now expand individual terms on RHS of our expression: This gives:

Derivation Equate both sides and solve for constants: Similarly we can find C, D, E, F and C, D, E, F

Applying 6 th Order Method How to obtain results using derived method. Produce a set of simultaneous equations and solve. Find y n+1 from old values and those just obtained. Set x, y n, y n etc. to new values. Repeat above procedure with updated variables.

Circle Problem Example Circle is produced for phase plane plot

Kepler s Equations Solution obtained from z-y plot reinforces fourth order method results.

The End But perhaps you want more? Read our report Visit our website: http://www.doc.ic.ac.uk/~pb401/de