Introduction to Numerical Differentiation and Interpolation March 10, !=1 1!=1 2!=2 3!=6 4!=24 5!= 120

Similar documents
Basic Concepts in Numerical Analysis November 6, 2017

Numerical Differentiation

Numerical Differentiation

4 Round-Off and Truncation Errors

Chapter 5. Curve fitting

PGE 310: Formulation and Solution in Geosystems Engineering. Dr. Balhoff. Interpolation

Outline. Numerical Heat Transfer. Review All Black Surfaces. Review View Factor, F i j or F ij. Review Gray Diffuse Opaque II

Lecture 12 APPROXIMATION OF FIRST ORDER DERIVATIVES

Given a table of data poins of an unknown or complicated function f : we want to find a (simpler) function p s.t. px (

Data Processing Techniques

Outline. Remaining Course Schedule. Review Systems of ODEs. Example. Example Continued. Other Algorithms for Ordinary Differential Equations

Assignment 7/MATH 247/Winter, 2010 Due: Friday, March 19. Powers of a square matrix

Numerical Analysis Formulae Booklet

Regression and the LMS Algorithm

ENGI 4430 Numerical Integration Page 5-01

Basics of Information Theory: Markku Juntti. Basic concepts and tools 1 Introduction 2 Entropy, relative entropy and mutual information

MMJ 1113 FINITE ELEMENT METHOD Introduction to PART I

CS475 Parallel Programming

Lecture 5: Interpolation. Polynomial interpolation Rational approximation

General Method for Calculating Chemical Equilibrium Composition

Ordinary Differential Equations. Orientation. Lesson Objectives. Ch. 25. ODE s. Runge-Kutta Methods. Motivation Mathematical Background

Nonlinear Piecewise-Defined Difference Equations with Reciprocal Quadratic Terms

For combinatorial problems we might need to generate all permutations, combinations, or subsets of a set.

ESS Line Fitting

Analysis of Lagrange Interpolation Formula

PowerPoints organized by Dr. Michael R. Gustafson II, Duke University Revised by Prof. Jang, CAU

Taylor s Series and Interpolation. Interpolation & Curve-fitting. CIS Interpolation. Basic Scenario. Taylor Series interpolates at a specific

Multiple Choice Test. Chapter Adequacy of Models for Regression

Lecture 3 Probability review (cont d)

Outline. Finite Difference Grids. Numerical Analysis. Finite Difference Grids II. Finite Difference Grids III

C-1: Aerodynamics of Airfoils 1 C-2: Aerodynamics of Airfoils 2 C-3: Panel Methods C-4: Thin Airfoil Theory

Derivation of 3-Point Block Method Formula for Solving First Order Stiff Ordinary Differential Equations

Third handout: On the Gini Index

Shuai Dong. Isaac Newton. Gottfried Leibniz

Babatola, P.O Mathematical Sciences Department Federal University of Technology, PMB 704 Akure, Ondo State, Nigeria.

Lecture Notes 2. The ability to manipulate matrices is critical in economics.

Bounds on the expected entropy and KL-divergence of sampled multinomial distributions. Brandon C. Roy

ORDINARY DIFFERENTIAL EQUATIONS EULER S METHOD

CHAPTER 4 RADICAL EXPRESSIONS

UNIT 1 MEASURES OF CENTRAL TENDENCY

Lecture Notes Forecasting the process of estimating or predicting unknown situations

Supervised learning: Linear regression Logistic regression

Chapter 5 Properties of a Random Sample

( ) 2 2. Multi-Layer Refraction Problem Rafael Espericueta, Bakersfield College, November, 2006

Johns Hopkins University Department of Biostatistics Math Review for Introductory Courses

CS5620 Intro to Computer Graphics

MEASURES OF DISPERSION

Johns Hopkins University Department of Biostatistics Math Review for Introductory Courses

CS 2750 Machine Learning. Lecture 8. Linear regression. CS 2750 Machine Learning. Linear regression. is a linear combination of input components x

Correlation and Simple Linear Regression

2006 Jamie Trahan, Autar Kaw, Kevin Martin University of South Florida United States of America

Initial-Value Problems for ODEs. numerical errors (round-off and truncation errors) Consider a perturbed system: dz dt

Chapter 13, Part A Analysis of Variance and Experimental Design. Introduction to Analysis of Variance. Introduction to Analysis of Variance

The Selection Problem - Variable Size Decrease/Conquer (Practice with algorithm analysis)

Cubic Nonpolynomial Spline Approach to the Solution of a Second Order Two-Point Boundary Value Problem

Chapter 3. Differentiation 3.3 Differentiation Rules

L5 Polynomial / Spline Curves

Binary classification: Support Vector Machines

CS 1675 Introduction to Machine Learning Lecture 12 Support vector machines

Simple Linear Regression

PTAS for Bin-Packing

Numerical Simulations of the Complex Modied Korteweg-de Vries Equation. Thiab R. Taha. The University of Georgia. Abstract

Machine Learning. Introduction to Regression. Le Song. CSE6740/CS7641/ISYE6740, Fall 2012

Fourth Order Four-Stage Diagonally Implicit Runge-Kutta Method for Linear Ordinary Differential Equations ABSTRACT INTRODUCTION

Chapter 4 (Part 1): Non-Parametric Classification (Sections ) Pattern Classification 4.3) Announcements

Maximum Likelihood Estimation

Idea is to sample from a different distribution that picks points in important regions of the sample space. Want ( ) ( ) ( ) E f X = f x g x dx

Section l h l Stem=Tens. 8l Leaf=Ones. 8h l 03. 9h 58

ANALYSIS ON THE NATURE OF THE BASIC EQUATIONS IN SYNERGETIC INTER-REPRESENTATION NETWORK

A Conventional Approach for the Solution of the Fifth Order Boundary Value Problems Using Sixth Degree Spline Functions

CHAPTER VI Statistical Analysis of Experimental Data

1. A real number x is represented approximately by , and we are told that the relative error is 0.1 %. What is x? Note: There are two answers.

1 0, x? x x. 1 Root finding. 1.1 Introduction. Solve[x^2-1 0,x] {{x -1},{x 1}} Plot[x^2-1,{x,-2,2}] 3

12.2 Estimating Model parameters Assumptions: ox and y are related according to the simple linear regression model

Kernel-based Methods and Support Vector Machines

CSE 5526: Introduction to Neural Networks Linear Regression

Statistics. Correlational. Dr. Ayman Eldeib. Simple Linear Regression and Correlation. SBE 304: Linear Regression & Correlation 1/3/2018

Objectives of Multiple Regression

Ordinary Least Squares Regression. Simple Regression. Algebra and Assumptions.

Introduction to Computer Design. Standard Forms for Boolean Functions. Sums and Products. Standard Forms for Boolean Functions (cont ) CMPT-150

. The set of these sums. be a partition of [ ab, ]. Consider the sum f( x) f( x 1)

8.1 Hashing Algorithms

Mean is only appropriate for interval or ratio scales, not ordinal or nominal.

A stopping criterion for Richardson s extrapolation scheme. under finite digit arithmetic.

THE ROYAL STATISTICAL SOCIETY 2016 EXAMINATIONS SOLUTIONS HIGHER CERTIFICATE MODULE 5

Radial Basis Function Networks

x y exp λ'. x exp λ 2. x exp 1.

Outline. Review Numerical Approach. Schedule for April and May. Review Simple Methods. Review Notation and Order

Homework Assignment Number Eight Solutions

FREQUENCY ANALYSIS OF A DOUBLE-WALLED NANOTUBES SYSTEM

GUARANTEED REAL ROOTS CONVERGENCE OF FITH ORDER POLYNOMIAL AND HIGHER by Farid A. Chouery 1, P.E. US Copyright 2006, 2007

Chapter 3. Differentiation 3.2 Differentiation Rules for Polynomials, Exponentials, Products and Quotients

A Class of Deformed Hyperbolic Secant Distributions Using Two Parametric Functions. S. A. El-Shehawy

Mu Sequences/Series Solutions National Convention 2014

Evaluation of uncertainty in measurements

Evaluating Polynomials

UNIT 2 SOLUTION OF ALGEBRAIC AND TRANSCENDENTAL EQUATIONS

Lecture 3. Sampling, sampling distributions, and parameter estimation

Lecture 7. Confidence Intervals and Hypothesis Tests in the Simple CLR Model

G S Power Flow Solution

Transcription:

Itroducto to Numercal Deretato ad Iterpolato Marc, Itroducto to Numercal Deretato ad Iterpolato Larr Caretto Mecacal Egeerg 9 Numercal Aalss o Egeerg stems Marc, Itroducto Iterpolato s te use o a dscrete set o data pots (,, =,, N) to appromate te value o () or some tat s ot te data set Numercal deretato s te appromato o dervatves rom a smlar set o data Ote used as part more comple problems suc as umercal soluto o deretal equatos L: Dervatves o terpolato polomals ca be used as appromato to dervatves Loos at basc deas eac topc te Derece Grds ubdvde rego to dscrete pots pacg betwee te pots ma be uorm or o-uorm Eample: grd or m ma wt N+ odes umbered rom zero to N Ital ode value, = m al grd ode value, N = ma Nodal spacg Δ = - ( =, N) Uorm spacg, = Δ = ( m ma )/N N+ odes gve N spaces te Derece Grds II No-uorm grd llustrated below --- ------ --------- ---~ ~--- ----- ---- N- N- N D D D DN- D N Use te ollowg otato to represet te value o a ucto () at = () at = s represeted as ( ) or or uorm grds, all D = + = = costat so = + ad = ( + ) Dervatve Epressos Obta rom deretatg terpolato polomals or rom alor seres eres epaso or () about = a ( ) ( a) d d Note: d /d = ad! = d d ( a) ( - a) ( - a)... a! d! d a a!=!= d!= ( ) ( - a)! d!=6 a!= 5!=! = (-)(-)... ()()() 5 Wat s error rom trucatg seres? rucato Error I we trucate seres ater m terms ( ) m d! d a ( - a) m d! d a ( - a) erms used rucato error, e m Ca wrte trucato error as sgle term at uow locato,, (dervato based o te teorem o te mea) m d d m e m ( - a) ( - a) m! d ( m )! d m a Note derece dervatve locato 6 ME 9 - Numercal Aalss o Egeerg stems

Itroducto to Numercal Deretato ad Iterpolato Marc, Dervatve Epressos Loo at te-derece grd wt equal spacg: = D so = + ; = ( ) alor seres about = gves ( + ) = [ + (+)] = + terms o ( ) = ( ) ( ) d d d! d ( ) = + a = a = Compact dervatve otato d d... d d d! d d d ( )... 7 More Dervatve Notato Use subscrpt to dcate locato o dervatves at deret pots mlar to otato tat ( + ) = + wc s equvalet to [ + (+)] = + Epad results rom prevous slde to dcate deret locatos d d... d d d d... d d d d d d 8 Dervatve Epressos II Combe all detos or compact seres otato ( ) ( ) d d d! d ( ) d! d ( ) ( )...!! Use ts ormula to get epasos or varous grd locatos about = ad use results to get dervatve epressos ( )... 9 Dervatve Epressos III Appl geeral equato or = ad = ( )! ( )!...!!...!!... A orward!!...!! B Bacward. Dervatve Epressos IV ubtract + ad - epressos...!!!! 5...! 5!! 5!... A Result called cetral derece epresso... Order o te Error orward ad bacward dervatve ave error term tat s proportoal to Cetral derece error s proportoal to Error proportoal to called t order Reducg step sze b a actor o a reduces t order error b a e e ME 9 - Numercal Aalss o Egeerg stems

Itroducto to Numercal Deretato ad Iterpolato Marc, Order o te Error Notato Wrte te error term or t error term as O( ) Bg o otato, O, deotes order Recogzes tat actor multplg ma cage slgtl wt because locato o trucato error mgt cage rst order orward rst order bacward O( ) O( ) ecod order cetral O( ) Hger Order Dervatves Add + ad - epressos!!...!! 6... 6!...!!! s secod-order, cetral derece epresso or secod dervatve 5! O... Hger Order Drectoal We ca get ger order dervatve epressos at te epese o more computatos Get secod order orward ad bacward dervatve epressos rom prevous results ad + ad -, respectvel Combe + ad - equatos wt prevous epressos or + ad - to elmate rst order error term 5 Geeral equato pecc alor eres ( )! ( )!... = 8...!! = - 8...!! = 9 7...!! = - 9 7...!! 6 ecod Order orward ubtract + rom + to elmate term 8.. 6... 6 ecod order... 6 error, O(... ) 7 ecod Order Bacwards Add - to - to elmate term 8.. 6... 6 ecod... 6 order error,... O( ) 8 ME 9 - Numercal Aalss o Egeerg stems

Itroducto to Numercal Deretato ad Iterpolato Marc, Oter Dervatve Epressos Ca cotue ts aso Wrte alor seres or +, -, +, -, +, -, etc. Create lear combatos wt actors tat elmate desred terms Elmate term to obta cetral derece Keep ol terms wt or orward derece epressos Keep ol terms wt or orward derece epressos ee results o pages 5 ad 55 o Rao 9 Dervatve Epressos O O Note order o dervatve, order o error, ad drecto (orward vs. bacward) O O O O Eample Problem Use a secod-order cetral-derece epresso to estmate d[s()]/d = usg =. Wat s te correct te-derece epresso? O Wat are + ad -? Recall deto + = ( + ) Usg epresso or dervatve at = meas tat = ( ) must be at = Eample Problem Cotued I = wat are + ad -? Recall deto + = ( + ) I =, + = + () = + = =. ad + ( ) = = =. s s s. s..998. d[s()]/d = = cos() = = so error s.998 =.667 - Repeat Eample or =. Here we ave te same epresso we derved prevousl, () = [s() s(-)]/(), but =. Prevous result: or =., error =.667 - e result s ow s s s. s..99998. Here error s.99998 =.667-5 Reducg b. reduces error b. or secod-order error Geeral Result I a te-derece epresso Wt a error o order (e A ) Reducg te step sze b a actor a ould reduce te error b a actor a ME 9 - Numercal Aalss o Egeerg stems

Itroducto to Numercal Deretato ad Iterpolato Marc, Eercse d te secod dervatves o e at = or =. ad =. (equato below) Compare to eact results de /d = = d e /d = = e = = e = Estmate order o umercal results rom equato le e e e l Possble quz questo smlar to ts oe O 5 Roudo Error Possble dervatve epressos rom subtractg close dereces Eample () = e : () (e + e - )/() ad error at = s (e + e - )/() e.66.785 E.788.5 (.) ecod order error.785567.789 9 E.7888859.5 (.).78887.788556688 9 E.78888 5.9 (.) 6 Error.E+.E+.E-.E-.E-.E-.E-5.E-6.E-7.E-8.E-9.E- gure -. Eect o tep ze o Error Numercal dervatve zero at smallest step szes rucato error: lear d log(error) / d log () or large step szes Roudo error at smaller step szes.e-.e-7.e-5.e-.e-.e-9.e-7.e-5.e-.e- Derece Epressos orward dereces or costat Geeral deto: D = + ecod order deto: D = D(D ) = D( + ) = D + D = ( + + ) ( + ) = + + + Ca ou sow tat te ollowg s correct? D = + + + + I geeral, D = D - + D - tep ze 7 8 Derece Epressos II Bacward dereces or costat Geeral deto: = - ecod order deto: = ( ) = ( - ) = - = ( - ) ( - - ) = - + - Ca ou sow tat te ollowg s correct? = - + + - I geeral, = - - - Derece Epressos III Cetral dereces or costat Geeral deto: d = +/ -/ ecod order deto: d = d(d) = d( +/ -/ ) = d +/ d -/ = ( + ) ( - ) = + + - Ca ou sow tat te ollowg s correct? d = +/ +/ + -/ -/ Geeral recurso ormula or odd ad eve deltas: Odd: d + +/ = d + d Eve: d = d - +/ d - -/ 9 ME 9 - Numercal Aalss o Egeerg stems 5

Itroducto to Numercal Deretato ad Iterpolato Marc, Iterpolato tart wt N data pars, d a ucto (usuall a polomal) tat ca be used or terpolato N data pots gve polomal order N Basc rule: te terpolato polomal must t all pots eactl Deote te polomal as p() e basc rule s tat p( ) = Ma deret orms Iterpolato Data Eample 6 5 5 Here we ave s data pars Eample problem: Wat s te value o we =? Ca use deret umbers o data pars rom to 6 or polomal p(), te basc rule s tat p( ) = E.g. p() = Wat s p()? p() = Newto Polomals p() = a + a ( ) + a ( )( ) + data pots requred or t order polomal + a ( )( )( ) + + a ( )( )( ) ( - ) erms wt actors o are zero we = Use ts ad rule tat p( ) = to d a a =, a = ( ) / ( ) = a + a ( ) + a ( )( ) olve or a usg results or a ad a Newto Polomals II = a + a ( ) + a ( )( ) a a( ) a ( )( ) ( ) ( )( ) Could cotue ts aso to determe coecets rom data Use alteratve sceme ot derved ere ow as dvded derece table to compute a rom same data Dvded Derece able Eter data o ad rows o table sppg oe row betwee etres tart wt data as zerot dvded derece rst dvded derece, = ( + ) / ( + ) ecod (or later) dvded derece s derece o rst (or later) dereces a coecets are tal dvded dereces 5 Zerot derece Dvded Derece able a rst ecod rd derece derece derece a a a 6 ME 9 - Numercal Aalss o Egeerg stems 6

Itroducto to Numercal Deretato ad Iterpolato Marc, ME 9 - Numercal Aalss o Egeerg stems 7 7 Dvded Derece Eample a a a a 6..5 6 6..5 8 Dvded Derece Eample II Dvded derece table gves a =, a =, a =., ad a = /6 Polomal p() = a + a ( ) + a ( )( ) + a ( )( )( ) = + ( ) +.( )( ) + (/6)( )( )( ) = +.( ) + (/6)( )( ) Cec p() = +.()() + (/6) ()()() = + 6 + = (Correct!) Dvded Derece Eercse Loo at prevous dvded derece eample Add ew data pot Determe terpolato coecets Add ew data pot at, Determe dvded derece all ew dvded derece terms out to ourt derece 9 Wat s? a a Wat s? a a Wat s? a a

Itroducto to Numercal Deretato ad Iterpolato Marc, d ourt Dvded Derece oluto a a a a R a Dvded Derece Patter Get geeral ormula or code wt D(m,) as m t value o t dvded derece Ital m data are te zerot dvded derece, D(m,) rst dvded derece, m = ( m+ m ) / / m+ m ) s D(m,) = [D(m+,) D(m,)] / m+ m ) ecod dvded derece, m s D(m,) = ( m+ m ) / m+ m ) = [D(m+,) D(m,)] / m+ m ) 5 Dvded Derece Patter II rom prevous slde we see tat D(m,) s m t value o t dvded derece We wat code to rom terpolatg polomal or N data pots ( to N ) We start b settg zerot derece as tal data,.e.: D(m,) = m I we cotue ormulas or deret dvded dereces we wll see tat te ollowg ormula s true D(m,) = [D(m+, ) D(m, )] / m+ m ) 6 Dvded Derece Code or m = o N N+ data pots D(m, ) = (m) zerot d Net m or = o N or m = o N - D(m, ) = (D(m +, - ) - _ D(m, - )) / _ ((m + ) - (m)) Net m Net D(m,) s m t value o t dvded derece 7 Usg Code Ecel Arras mported rom Ecel set put rage to varat (lower boud = ) ub model(i as Rage) Dm as Varat Dm rows as Log, cols as Log = I rows = Uboud(,) cols = Uboud(,) Have to revse code to adle ts arra or cop arra to oe-dmesoal arra wt lower boud o zero 8 ME 9 - Numercal Aalss o Egeerg stems 8

Itroducto to Numercal Deretato ad Iterpolato Marc, Costat tep ze Dvded dereces wor or equal or uequal step sze I D = s a costat we ave smpler results = D / = ( + )/ = D / = ( + - + )/ = D /6 = ( + + + + )/6 D s called te t orward derece Ca also dee bacwards ad cetral dereces Iterpolato Approaces We we ave N data pots ow do we terpolate amog tem? Order N- polomal ot good coce Use pecewse polomals o lower order (lear or quadratc) Ca matc rst ad or ger dervatves were pecewse polomals jo Cubc sples are pecewse cubc polomals tat matc rst ad secod dervatves (as well as values) 9 5.7 Cubc ple Iterpolato 5 Newto Iterpolatg Polomal.6 value.5... Kow Natural No Kot Data Y Value Polomal Data. 5 6 values - 5 6 X Values 5 5 Polomal Applcatos Data terpolato Appromato uctos umercal quadrature ad soluto o ODEs Bass uctos or te elemet metods Ca obta equatos or umercal deretato tatstcal curve ttg (ot dscussed ere) usuall used practce t Quz Results Mamum possble score: 5 Number o studets: Mea score:. Meda score: 5.5 tadard devato: 7. Grade dstrbuto: 6 7 5 5 6 6 6 7 7 7 5 5 ME 9 - Numercal Aalss o Egeerg stems 9

Itroducto to Numercal Deretato ad Iterpolato Marc, Quz ve Commets Uorm Grds We let sde s te same, ca solve bot rgt sdes at same tme Watc roudo calculator Lear to use umbers wtout smbols to represet equatos Caot use terato uless arra s dagoall domat Quz s moved rom ts Wedesda to et Wedesda 55 Uorm grd otato: = + ---- ---- ---- ---- ---- ---- ---- ---- - - - - + + + + ormulas wt terms represet ( ) Equatos le te ollowg O O Gve te dervatve at = terms o values, = ( ) at grd locatos 56 ME 9 - Numercal Aalss o Egeerg stems