CGN Computer Methods. Numerical Methods Lecture 4 - Numerical Integration / Differentiation

Similar documents
Numerical Integration over Curved Domains Using Convex Quadrangulations And Gauss Legendre Quadrature Rules

Trigonometric Functions (tangent)

A Model Comparison In this lesson, students will graph two equations on a coordinate plane to compare earnings over a given period.

Breaking Even In this lesson, students will use the four basic operations to find the break-even point of a product.

STATISTICAL TECHNIQUES. Data Analysis and Modelling

Chapter 12 Module 3. AMIS 310 Foundations of Accounting

1. You are given the following joint PPF for 3 individuals: Sarah, John, and Michael.

Part I: Math Review Remember to show all of your work. Also remember that calculators are not permitted on exams, so you should try these by hand.

Economics 101 Fall 2013 Answers to Homework #6 Due Tuesday, Dec 10, 2013

Semester 2, 2015/2016

Physics 141 Plotting on a Spreadsheet

Water and Wastewater Engineering Dr. B. S. Murty Department of Civil Engineering Indian Institute of Technology, Chennai

If you have never done this before - go to CASA for fingerprint/picture process before your test date.

Chapter 10 Regression Analysis

Practice DEPARTMENTAL FINAL EXAMINATION 2014 MATH M 119 BRIEF SURVEY OF CALCULUS

Attribute Theory of Consumer Behavior

Optimization Prof. Debjani Chakraborty Department of Mathematics Indian Institute of Technology, Kharagpur

An Experimental Study on Improvement of Office Work Productivity by Circadian Rhythm Light

Module Tag. Com_P2_M6. PAPER No. 2 : Managerial Economics MODULE No. 6: methods of measuring Elasticity of demand

Optimal Determination of Purchaser s Order Quantity and Producer s Process Mean

Midterm 2 - Solutions

BUSINESS STATISTICS (PART-37) TIME SERIES & FORECASTING (PART-2) ANALYSIS FOR SECULAR TREND-I (UNITS V & VI)

Laboratory 3 Factorial Experiment: Paper Helicopter Design

Bioreactors Prof G. K. Suraishkumar Department of Biotechnology Indian Institute of Technology, Madras. Lecture - 02 Sterilization

Bandwagon and Underdog Effects and the Possibility of Election Predictions

LEIBNIZ SHIFTS IN DEMAND AND SUPPLY

Untangling Correlated Predictors with Principle Components

Random Sampling Lab. Technique 1: Sampling. Procedure:

PRESTRESSED CONCRETE STRUCTURES. Amlan K. Sengupta, PhD PE Department of Civil Engineering, Indian Institute of Technology Madras

Economics 230a, Fall 2017 Lecture Note 4: Excess Burden and Basic Optimal Taxation

STEP/MAT/AEA Questions by A Level Chapter (Pure)

Quadratic Regressions Group Acitivity 2 Business Project Week #4

The marginal propensity to consume is the derivative of a consumption function Cxwith ( )

ENR202 Mechanics of Materials Lecture 1A Slides and Notes

THE NORMAL CURVE AND SAMPLES:

5/11/2007. WinTR-55 for Plan Reviewers Small Watershed Hydrology Intermediate WinTR-55 Training Modeling Multiple Sub-area Watersheds

Answers to the Take-Home Midterm Examination

Designing Information Devices and Systems I Spring 2018 Lecture Notes Note Interpretation: Water Reservoirs and Pumps

Data Science Analytics Big Data

THE PRODUCTION FUNCTION

Economics 102 Summer 2015 Answers to Homework #2 Due Tuesday, June 30, 2015

October 25, Your Name: Midterm Exam Autumn Econ 580 Labor Economics and Industrial Relations

2.3A Comparing Linear Equations

Economics for business 2

Forecasting Introduction Version 1.7

A01 325: #1 VERSION 2 SOLUTIONS

American Association for Public Opinion Research

a. Find MG&E s marginal revenue function. That is, write an equation for MG&E's MR function.

Measuring Performance with Objective Evaluations

1.204 Lecture 23. Analytic approximations. Transit design. Analytic approximations. First spiral in developing problem solution

Plane Truss Stiffness Matrix

Examiner s report F5 Performance Management March 2016

In this chapter we will study problems for which all the algebraic expressions are linear, that is, of the form. (a number)x +(a number)y;

Instructions. AIRBUS A3XX: Developing the World s Largest Commercial Aircraft

Chapter 12: Limit Pricing and Entry Deterrence

Consumer and Producer Surplus and Deadweight Loss

Elastodynamic FWI efficiency study with partial stacking in 2D

Math 116 Practice for Exam 1

Absolute vs. Comparative Advantage

Rational Numbers in Mathematics. Lecture 2.1: Fractions INTRODUCTION 2.0

Two Way ANOVA. Turkheimer PSYC 771. Page 1 Two-Way ANOVA

Process Design Decisions and Project Economics Dr. V. S. Moholkar Department of Chemical Engineering Indian Institute of Technology, Gawahati

Announcements. Week 12

Lecture 18: Toy models of human interaction: use and abuse

EconS Perfect Competition and Monopoly

i. The profit maximizing output of firm B is smaller than the profit maximizing output of firm A.

Top Talent for Your Bottom Line: Aligning Your Talent Strategy with Revenue Goals

Text transcription of Chapter 4 The Market Forces of Supply and Demand

Operations Research Analysts

Study programme in Sustainable Energy Systems

Lesson 1: Modeling Linear Relationships

7 The Optimum of Monopoly, Price Discrimination

Success Center Directed Learning Activity (DLA) Equivalent Fractions M001.1

Economics II - October 27, 2009 Based on H.R.Varian - Intermediate Microeconomics. A Modern Approach

Genome 373: Machine Learning I. Doug Fowler

Words for Algebra TEACHER NOTES MATH NSPIRED. Math Objectives. Vocabulary. About the Lesson. TI-Nspire Navigator System

Boston College Problem Set 3, Fall 2012 EC Principles of Microeconomics Instructor: Inacio G L Bo

EconS Monopoly - Part 1

Cluster Analysis and Segmentation

In this chapter we will study problems for which all the algebraic expressions are linear, that is, of the form. (a number)x + (a number)y;

EconS Monopoly - Part 2

Application of Series Formula Method in Optimization Arrangement of Webs

Chapter 9: Static Games and Cournot Competition

Concepts for Using TC2000/TCnet PCFs

Question 4: How do you find cost and revenue functions?

Choosing the Right Type of Forecasting Model: Introduction Statistics, Econometrics, and Forecasting Concept of Forecast Accuracy: Compared to What?

Kvalitativ Introduktion til Matematik-Økonomi

1.4 Applications of Functions to Economics

Operations and Supply Chain Management Prof. G. Srinivisan Department of Management Studies Indian Institute of Technology, Madras

Multiple Regression. Dr. Tom Pierce Department of Psychology Radford University

Determination of the Mass Percentage of Copper in a Penny

Logistic Regression with Expert Intervention

Unit 6: Non-Competitive Markets

Linear Functions And Geometry Study Guide FUNCTIONS

Dialogue Strategy. Overview. Formalizing Strategy. Example MDP. In ISU, this is hard-coded by order of the rules. Dialogue Quality

UV254 Go! Measurement and Calibration of BOD against the BOD five day test

Unit 2: Theory of Consumer Behaviour

7. What is planning? It is an act of formulating a program for a definite course of action. Planning is to decide what is to be done.

Problem Set #3 Revised: April 2, 2007

c) Will the monopolist described in (b) earn positive, negative, or zero economic profits? Explain your answer.

Transcription:

Numerical Methods Lecture 4 - Numerical Integration / Differentiation Numerical Integration - approimating the area under a function We will consider 3 methods: Trapezoidal rule, Simpson s rule, Gauss Quadrature The basic concept is to break the area up into smaller pieces with simple shapes fitted to approimate the function over short lengths. The area under these simple shapes are then added up to approimate the total. Trapezoidal rule - piece-wise linear approimation to curve f( chop area into N smaller pieces (sample of two pieces on the right connect areas with straight lines, creating trapezoids find the area under each trapezoid A=1/2*d*(f(+f(+d add up the trapezoids Eample, the figure at the bottom of the page chops a function into 4 trapezoids over the range [a, b]. The trapeziodal rule adds up the area of each of the 4 trapezoids to represent the area under the fucntion f(. A1=1/2*d*(f(1+f(2 A1 d A2 f( 1 2 3 Area = d = (b-a/n (a, b are limits, N is number of pieces we divide the area into A1= 1/2 * d * (f(1 + f(2 A2 = 1/2* d * ( f(2 + f(3 A3 = 1/2* d * ( f(3 + f(4 A4 = 1/2* d * ( f(4 + f(5 1/2 * d * (f(1+2*f(2+2*f(3+2*f(4+f(5 The generalized equation epressing trapezoidal rule is then ==> #$ --& '(& $ '& ( ( $ '& ( $ ( # Error: The error (in blue between the area of the trapezoid and the curve it represents builds up Error reduction: We can reduce error if we can shorten the straight lines used to estimate curves. Increasing the number (increase N of trapezoids used over the same range [a,b] will reduce error in the area estimate. f Numerically estimate area under f within [a, b] Error A4 A1 A2 A3 a d b 1 2 3 4 5 Numerical Methods Lecture 4 - Numerical Integration / Differentiation page 83 of 88

We can also get a little more sophisticated than straight line estimates The error using trapezoidal rule comes from using a series of straight lines to represent a curve. To reduce this error, we ll now look at using a series of second order curves to represt the function. Simpson s Rule - piece-wise second order approimation of f(. chop area into N smaller pieces connect every 3 points with second order curve fit, this gives us N/2 smaller areas representing the curve in the range [a,b] Find the area under each second order polynomial estimate. A=d/3*[f(1+4*f(2+f(3] Add up the smaller areas to estimate area under the curve Eample, the figure at the bottom of the page chops a function into 8 pieces over the range [a, b]. Every two adjacent pieces are joined to form a sub-area. The Simpson s rule adds up the 4 sub-areas to represent the area under the fucntion f(. A1 = d/3 * (f(1+4f(2+f(3 A2 = d/3 * ( f(3+4*f(4+f(5 A3 = d/3 * ( f(5+4*f(6+f(7 A4 = d/3 * ( f(7+4*f(8+f(9 Area = A1+A2+A3+A4 =d/3 * (f(1+4f(2+2f(3+4f(4+2f(5+4f(6+2f(7+4f(8+f(9 Simpson s rule is ==> #$ --& '(& & '& ( * * # '(', Reduce error by increasing N This method requires N to be even, since we need 3 points per sub-area A=d/3*[f( i-1 +4*f( i +f( i+1 ], d A i-1 i i+1 $ $ & '& ( + $ '& ( $ + # *++, f N = 8 segments gives us 4 areas to add up each area is a topped off with a second order polynomial (red line Numerically estimate area under f within [a, b] a A1 A2 A3 A4 1 2 3 d 4 d b 5 6 8 7 9 Numerical Methods Lecture 4 - Numerical Integration / Differentiation page 84 of 88

Gauss Quadrature Integration Rather than cutting the range up into small pieces, we can try to find a single trapezoid that represents the function over the given range. The trapezoid is defined by the range [-1,1] and the evaluation of the function at f(1 and f(2. See figure ==> f(2 f(1 If we pick 1 and 2 correctly, the blue area (under estimate will balance out the red area (overestimate, and the total area under the trapezoid will be the same as the function. -1 1 The trick is then to find the correct values for 1 and 2, and to weight the function evaluations. Our integral estimate becomes: '& ( & #, - '& ( - $, '& (, We need to solve for 4 unknown values (, -,,, & -, &. We ll need four equations. We ll get these by assuming that the above estimate is eact for constant through 3rd order functions:, - '& ( - $, '& ( # & #, - '& ( - $, '& ( # && # -,,, - '& ( - $, '& ( & & # # --,, - '& ( - $, '& ( # & & # -, solving these four equations simultaneously gives us the following solutions:, - #, # &, - # ------ & # ------ The result: This says that we can estimate the area under any function between [ -1, 1 ] Just by evaluating the fiunction at two carefully chosen spots, '& ( & # '., ------ '. $ ------ (1 Also, the derivation provides that the answer is eact if the function being integrated is a polynomial up to third order The etension: What if the range of integration is not [ -1, 1 ]?? Let s say & # & when the range is [ -1, 1 ]. Let s also say the range of interest is [ a, b ] Skipping the derivation... We reduce the integration to an equivalent over the range [ -1, 1 ] by applying the following change of variables Numerical Methods Lecture 4 - Numerical Integration / Differentiation page 85 of 88

& (- $ $ $ (-, $ & -, $ # ------------------------------------------ (2 & # ----------- & (3 To apply this change of variables, we re-write equation (1 now as: - $ '& ( & # (- $ $ $ (-, $,------ '. -------------------------------------------------------- ( - $ $ $ (-, $ ------ $ '. ---------------------------------------------------- & - -----------, $ (4 Eample: Integrate the following function over the range [ 0, 0.8 ] -/5 (-/ $ 0&, --& $ 120&, 3--& 4 $ 4--& 0 & - Re-writing Eq. 4 above gives the general solution: - '& ( & # ('& ( - $ '& ( - -----------, $ $ (5 (- $ $ (-, $ $,------ (- $ $ (-, $ $ ------ where & - # -------------------------------------------------------- and & (6 # ---------------------------------------------------- For this eample, $ # - and - # -/5. Plugging these values into (6, then plugging & -, & into (5, we get Gauss Quadrature Area estimate = f(0.169 + f(0.631 = 0.516741+1.305837 = 1.82257 Eact Answer = 1.640533 Note, if we truncated the function being integrated after the & term, then the area we estimate using (5 and (6 will be eact, since Gauss quadrature is eact for up to third order polynomial equations. Etension Gauss quadrature can be etended to higher orders, involving more evaluation points, for eample '& ( & #, - '& ( - $, '& ( $, '& ( $ /// $,., '& (.,, Numerical Methods Lecture 4 - Numerical Integration / Differentiation page 86 of 88

Numerical Differentiation Read section 23.1 Derivative represents the slope of a function f( at a particular value & (/# slope is --------- = change in f(/change in 0. formally the definition of the derivative is: '.6 '& ( $, '& ( '& ( $, '& (, (& # 789 ------------------------------------- # 789 ------------------------------------------------- - - Here we will approimate the limit by taking some small rather than mathematically letting it go to 0. Forward difference method '.6 '& ( $, '& ( (& # 789 ------------------------------------- - forward difference Backward difference method '.6 (& '& (, '& (, # 789 ------------------------------------ - find the derivative at +d find the derivative at backward difference Central difference method '.6 '& ( $, '& (, (& # 789 ------------------------------------------------- - -d Central difference -d find the derivative at +d Numerical Methods Lecture 4 - Numerical Integration / Differentiation page 87 of 88

Comparison of all three methods backward difference central difference forward difference find the derivative at -d +d Typically, central difference is the most accurate method since forward and backward biases are averaged out. In fact, just like Simpson s rule is one order higher accuracy that Trapezoidal rule, the central difference method has one order higher accuracy that forward or backward difference. User supplies location at which to estimate derivative User supplies the d value Apply one of the three equations to estimate derivative Miing and Matching Numerical Methods: Consider the Newton Raphson root finding method from NM Lecture 3. This requires the function and its derivative to iteratively solve for a root. Suppose I have a complicated looking function and I don t have the time, skill, or inclination to find its derivative analytically to use in the Newton Raphson routine. How might I combine the central difference method with Newton Raphson? Numerical Methods Lecture 4 - Numerical Integration / Differentiation page 88 of 88