Numerical Integration Methods

Slides:



Advertisements
Similar presentations
Formal Computational Skills
Advertisements

1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral.
Computational Methods in Physics PHYS 3437
Computational Methods in Physics PHYS 3437
Asymptotic error expansion Example 1: Numerical differentiation –Truncation error via Taylor expansion.
NUMERICAL DIFFERENTIATION AND INTEGRATION
Revisiting Numerical Integration: Getting More from Fewer Points Asilomar - December 2007 Bruce Cohen Lowell High School, SFUSD
Today’s class Romberg integration Gauss quadrature Numerical Methods
Lecture 18 - Numerical Differentiation
1cs542g-term Notes  Notes for last part of Oct 11 and all of Oct 12 lecture online now  Another extra class this Friday 1-2pm.
Total Recall Math, Part 2 Ordinary diff. equations First order ODE, one boundary/initial condition: Second order ODE.
ECIV 201 Computational Methods for Civil Engineers Richard P. Ray, Ph.D., P.E. Error Analysis.
Lecture 3: Integration. Integration of discrete functions
MANE 4240 & CIVL 4240 Introduction to Finite Elements Numerical Integration in 1D Prof. Suvranu De.
Initial-Value Problems
8-1 Chapter 8 Differential Equations An equation that defines a relationship between an unknown function and one or more of its derivatives is referred.
Numerical Solutions of Ordinary Differential Equations
CISE-301: Numerical Methods Topic 1: Introduction to Numerical Methods and Taylor Series Lectures 1-4: KFUPM.
Numerical Solution of Ordinary Differential Equation
MATH 685/ CSI 700/ OR 682 Lecture Notes Lecture 10. Ordinary differential equations. Initial value problems.
1 Chapter 6 Numerical Methods for Ordinary Differential Equations.
NUMERICAL DIFFERENTIATION The derivative of f (x) at x 0 is: An approximation to this is: for small values of h. Forward Difference Formula.
Quadrature Greg Beckham. Quadrature Numerical Integration Goal is to obtain the integral with as few computations of the integrand as possible.
Professor Walter W. Olson Department of Mechanical, Industrial and Manufacturing Engineering University of Toledo Solving ODE.
Ch 8.1 Numerical Methods: The Euler or Tangent Line Method
Boyce/DiPrima 9th ed, Ch 8.4: Multistep Methods Elementary Differential Equations and Boundary Value Problems, 9th edition, by William E. Boyce and Richard.
Integration. Problem: An experiment has measured the number of particles entering a counter per unit time dN(t)/dt, as a function of time. The problem.
Simpson’s 1/3 rd Rule of Integration. What is Integration? Integration The process of measuring the area under a.
Integrals 5.
1 Chapter 5 Numerical Integration. 2 A Review of the Definite Integral.
Today’s class Numerical Integration Newton-Cotes Numerical Methods
1 Chapter 7 NUMERICAL INTEGRATION. 2 PRELIMINARIES We use numerical integration when the function f(x) may not be integrable in closed form or even in.
Ch 8.3: The Runge-Kutta Method
1 Simpson’s 1/3 rd Rule of Integration. 2 What is Integration? Integration The process of measuring the area under a curve. Where: f(x) is the integrand.
EE3561_Unit 8Al-Dhaifallah14351 EE 3561 : Computational Methods Unit 8 Solution of Ordinary Differential Equations Lesson 3: Midpoint and Heun’s Predictor.
CISE-301: Numerical Methods Topic 1: Introduction to Numerical Methods and Taylor Series Lectures 1-4: KFUPM CISE301_Topic1.
CISE301_Topic11 CISE-301: Numerical Methods Topic 1: Introduction to Numerical Methods and Taylor Series Lectures 1-4:
Modeling and simulation of systems Numerical methods for solving of differential equations Slovak University of Technology Faculty of Material Science.
Boyce/DiPrima 9 th ed, Ch 8.5: More on Errors; Stability Elementary Differential Equations and Boundary Value Problems, 9 th edition, by William E. Boyce.
1 EEE 431 Computational Methods in Electrodynamics Lecture 4 By Dr. Rasime Uyguroglu
Modelling & Simulation of Chemical Engineering Systems Department of Chemical Engineering King Saud University 501 هعم : تمثيل الأنظمة الهندسية على الحاسب.
Scientific Computing Numerical Solution Of Ordinary Differential Equations - Euler’s Method.
Computational Methods in Physics PHYS 3437 Dr Rob Thacker Dept of Astronomy & Physics (MM-301C)
5. Integration 2.Quadrature as Box Counting 3.Algorithm: Trapezoid Rule 4.Algorithm: Simpson’s Rule 5.Integration Error 6.Algorithm: Gaussian Quadrature.
Chap. 11 Numerical Differentiation and Integration
CHAPTER 3 NUMERICAL METHODS
559 Fish 559; Lecture 5 Non-linear Minimization. 559 Introduction Non-linear minimization (or optimization) is the numerical technique that is used by.
Numerical Analysis – Differential Equation
Please remember: When you me, do it to Please type “numerical-15” at the beginning of the subject line Do not reply to my gmail,
Ch 8.2: Improvements on the Euler Method Consider the initial value problem y' = f (t, y), y(t 0 ) = y 0, with solution  (t). For many problems, Euler’s.
Today’s class Ordinary Differential Equations Runge-Kutta Methods
Lecture 40 Numerical Analysis. Chapter 7 Ordinary Differential Equations.
ECE 576 – Power System Dynamics and Stability Prof. Tom Overbye Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign.
Ordinary Differential Equations
1/14  5.2 Euler’s Method Compute the approximations of y(t) at a set of ( usually equally-spaced ) mesh points a = t 0 < t 1
Lecture 39 Numerical Analysis. Chapter 7 Ordinary Differential Equations.
This chapter is concerned with the problem in the form Chapter 6 focuses on how to find the numerical solutions of the given initial-value problems. Main.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 6 - Chapters 22 and 23.
1 LECTURE 6 Stability of Parabolic PDEs. 2 Aim of Lecture Last week we discussed Parabolic PDEs –Looked at Explicit and Implicit Methods –Advantages and.
CISE301_Topic8L71 CISE301: Numerical Methods Topic 8 Ordinary Differential Equations (ODEs) Lecture KFUPM (Term 101) Section 04 Read , 26-2,
Quadrature – Concepts (numerical integration) Don Allen.
Keywords (ordinary/partial) differencial equation ( 常 / 偏 ) 微分方程 difference equation 差分方程 initial-value problem 初值问题 convex 凸的 concave 凹的 perturbed problem.
Numerical Integration Methods
NUMERICAL DIFFERENTIATION Forward Difference Formula
5.5 Trapezoidal Rule.
Class Notes 19: Numerical Methods (2/2)
MATH 174: NUMERICAL ANALYSIS I
Numerical Integration Methods
CISE-301: Numerical Methods Topic 1: Introduction to Numerical Methods and Taylor Series Lectures 1-4: KFUPM CISE301_Topic1.
Presentation transcript:

Numerical Integration Methods Fish 559; Lecture 2 a

Some Preliminaries-I Numerical methods are numerical and hence subject to various types of errors: Roundoff error: The consequences of a computer representing a real number using finite accuracy. Note: roundoff errors accumulate; and subtraction of two numbers that are nearly identical may lead to very large roundoff errors. Truncation error: the difference between the true answer and the value from the numerical analysis.

Some Preliminaries-II Truncation error: There are often error bounds for methods (though we will not consider these in this course). Truncation error can be reduced by increasing the number of steps / reducing tolerances or step sizes, but this can be costly in terms of computation time and, eventually, roundoff error will begin to impact the results.

Numerical Integration (or numerical quadrature) The objective of numerical integration is to solve the problem: which is equivalent to finding subject to: We will assume that the function f cannot be integrated analytically!

Numerical Integration (why do this) The density of larvae is given by the function f (as a function of distance along a river); how many larvae are there between points a and b along the river? Let f be the function that determines the rate of change in the number of animals of species i (which depends on the number of animals of species i). If there are 1,000 animals of species i at time t0, how many are there at time t0+1.

Numerical Integration (An example problem) We wish to evaluate the integral:

Numerical Integration (Single-step approaches-I) We could approximate the integral by its height at its first point, at its last point, or at the middle. Approximating the integral by the average of the first two approaches is the “Trapezoidal rule”.

Numerical Integration (Single-step approaches-II) We wish to integrate from a to b. We have formulae that get more accurate as more terms are added: Trapezoidal rule: Simpson’s Rule: Boole’s rule: h is the step size. It is (b-a) divided by the number of function calls less 1. There are many variants on this theme! http://en.wikipedia.org/wiki/George_Boole

Numerical Integration (Single-step approaches-III) Results: Trapezodinal rule: 0.68394 Simpson’s rule: 0.74718 Boole’s rule: 0.74683 Exact: 0.74682!

Numerical Integration (Multi-step rules) Therefore, in order to numerically integrate over the interval [a, c], we can apply one of the single-step rules multiple times and add the results, i.e. for Simpson’s rule:

Other Approaches (Gaussian quadrature-I) Generalizing the previous approaches: The previous methods have all been based on equal spacing along abscissa. We can improve our accuracy (at the expense of a bit more programming) by allowing freedom in the location of the absciccas.

Other Approaches (Gaussian quadrature-II) For two point Gaussian quadrature: This lead to an approximation to the integral of 0.74965. The three point formula leads to 0.74673. Abramowitz and Stegun provide details on the absiccas and weights for equations of different orders (numbers of terms in the approximating equation).

The Error Function Perhaps the most frequently required integral in fisheries is the “error function”: It is not necessary to apply the methods of this lecture to compute this integral because very accurate approximations to it have been programmed and are available in software libraries (e.g. NORMDIST in EXCEL, cumd_norm in ADMB and pnorm in R). The lesson from this example, is that someone may have already solved your problem; before writing your own code check whether this is the case!

Multidimensional Integrals Multidimensional integrals are much more complicated than single-dimensional integrals. There are a few basic approaches to computing these integrals: Split the problem into multiple single dimensional integrals. Use Monte Carlo methods. Use numerical methods (such as Laplace’s method). The issue of computing multidimensional integrals using Monte Carlo methods will be discussed later.

Integration of ODEs The generic problem is the study of a set of N coupled first order differential equations: The specification of ODEs generally includes initial conditions, i.e.:

A Familiar Set of ODEs (Ecosim) The initial conditions are determined from Ecopath. Net growth efficiency Immigration Consumption of species i by species j Non-predation mortality, fishing mortality and emigration

Euler’s Method Euler’s method updates the solution from xn to xn+1=xn+h using the formula: This method is simple, but can be very inaccurate (unless a very small step-size is used).

Other Ways to Solve ODEs Runge-Kutta methods. Richardson extrapolation. Predictor-corrector methods. We will focus on the Runge-Kutta method.

Runge-Kutta Methods-I These tend to perform adequately for many problems (but more efficient algorithms do exist). The step size (h) can be monitored and modified automatically to improve performance.

Runge-Kutta Methods-II There are many versions of the Runge-Kutta method but the fourth-order version seems the most popular: There are multidimensional versions of the RK algorithm.

An Example-I Solve the following ODE using (a) Euler’s method and (b) the Runge-Kutta fourth-order method: where:

An Example -II Runge-Kutta Euler

Moving to PDEs Partial Differential Equations (PDEs) are much more difficult to solve. Although algorithms do exist to solve these, the literature is vast and we will not discuss them in this course.

Numerical Instability-I We wish to solve the following initial value problem: We can apply Euler’s method: or Milne’s method:

Numerical Instability-II Euler’s method is stable but Milne’s rule Becomes unstable after x=2! In the case, we knew the correct solution, what would we do in reality?