differentiation - oregon state universitysites.science.oregonstate.edu/~restrepo/mth452/... ·...

15
NUMERICAL DIFFERENTIATION f4xo hh mo flxothy fx.li oElaiDfEC4a bT Finite difference Approximations six Assume fix issufficiently smooth oh Xoth Sixth ftp.hflxdtthYYxd f fh3f Gift Forward Difference Approximatiatoffxo ftxothl f d.fi xo tfhf45 3Efxo xoth h Backward Difference Approximation error ftp.flxo.h I a sf teth 143 Elko hid

Upload: others

Post on 11-May-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: DIFFERENTIATION - Oregon State Universitysites.science.oregonstate.edu/~restrepo/MTH452/... · GAUSSIANQUADRATURE ChooseExitsin andfi3in so that ECsx It dx aflail ft is minimized

NUMERICALDIFFERENTIATION

f4xo hhmo flxothyfx.li

oElaiDfEC4abTFinite difference Approximations

six

Assumefix issufficientlysmooth oh Xoth

Sixth ftp.hflxdtthYYxd ffh3f Gift

ForwardDifference Approximatiatoffxo

ftxothl f d.fi xo tfhf45 3Efxoxothh

BackwardDifference Approximation error

ftp.flxo.hI

a sf teth143 Elko hid

Page 2: DIFFERENTIATION - Oregon State Universitysites.science.oregonstate.edu/~restrepo/MTH452/... · GAUSSIANQUADRATURE ChooseExitsin andfi3in so that ECsx It dx aflail ft is minimized

CenterDifferenceApproximationtoffxo

ffxoth7 ffxo.tn2

fExo tfhf 3h Terror

The center difference approximation

ftp.flxothl f xo h2h

is 01h21 approximationwhereas

f'M fCxuth 7 forwardh

tcxdflxo.tl backward

1hare 01h approximations

ex Using derive a finitedifferenceapproxinahu

to f Cxo

I

Page 3: DIFFERENTIATION - Oregon State Universitysites.science.oregonstate.edu/~restrepo/MTH452/... · GAUSSIANQUADRATURE ChooseExitsin andfi3in so that ECsx It dx aflail ft is minimized

use ff fGoth 2Mt Ho h

t fh f 13 error

tle OCK center difference approximationRush highorder approximationcouldbefoundfromTaylorseries

GENERALPROCEDUREFORDERIVATIVES BYFINITE DIFFERENCES

Issue f E Cnt Cab lattice xi3i.no

fix g that lady t iIcxxi7Terror

Lagrange polynomials

Differentiate both sides

Page 4: DIFFERENTIATION - Oregon State Universitysites.science.oregonstate.edu/~restrepo/MTH452/... · GAUSSIANQUADRATURE ChooseExitsin andfi3in so that ECsx It dx aflail ft is minimized

ntl

fix EHaddidnt H GI axilforany Xfl aid Now confineto X Xi is

this thadduki t if Gftp.xila

errorLossofPrecision in Computing DerivativesCautionarytale computingderivatives usyfiniteprecision Suppose approximate Hx bycenterdifference

X 4h Cflxoth throh YfGlet faith Ftxth t eExoth

theM 4 PrusIerror

W FCxoth khekothzge

x.nl

hj f 45

Page 5: DIFFERENTIATION - Oregon State Universitysites.science.oregonstate.edu/~restrepo/MTH452/... · GAUSSIANQUADRATURE ChooseExitsin andfi3in so that ECsx It dx aflail ft is minimized

assure lea.IM cE

f4D cMTleutletnncataapbesGnitepseeisiaerror yields

114 1 Flinch 3Eq thatElm's

y

EAµ

El isemininel

ii

hi

NUMERICALINTEGRATION QUADRATURE

163mostConnon strategiesn Fixxi findZiemann dx re Eciflxi naunknownsciSum iso

Gaussian 11 dx.ggqffxi seFndxiicis.tQuadrature II Hismmnised2h unknowns

Page 6: DIFFERENTIATION - Oregon State Universitysites.science.oregonstate.edu/~restrepo/MTH452/... · GAUSSIANQUADRATURE ChooseExitsin andfi3in so that ECsx It dx aflail ft is minimized

Montecarlo MC ffcxdxn.im tmsiosthmemguessessiaceepLMoftlese

RIEMANNSUMS

Assume Lxi distinct on Cab

bflxidxsfb.ESxi liCx7dx

f Icx.oilfmY5Ddxhtt

If dx Ecifcxi t Error f Terroris 0

G Gdx is91,2 in

EXAMPLES RIGHTHAND8LEFTHANDSUMS eex Piecewise arstatholxPide Xosa X sb hex Xo

Xo X

rec 1 lies I

Page 7: DIFFERENTIATION - Oregon State Universitysites.science.oregonstate.edu/~restrepo/MTH452/... · GAUSSIANQUADRATURE ChooseExitsin andfi3in so that ECsx It dx aflail ft is minimized

NI

LAR feokddxfcxdshfk.io h X XzTo

fati error is

underestimate

µr i for fkoLHR funchies

f Exactfor Cx

Xoh x

Emory dx LARI Gkixddx.ch f433

CoMPosiTEhHRff Yfa X Yz Xm Xn b

n l Xo Xu

bfhddxeiqoxiflxi oxi xiti

xigpyp.fi'eRcxdxftxDh fjem

oerrorisover

asxo.ba 7 77467 PHR functions

x

Page 8: DIFFERENTIATION - Oregon State Universitysites.science.oregonstate.edu/~restrepo/MTH452/... · GAUSSIANQUADRATURE ChooseExitsin andfi3in so that ECsx It dx aflail ft is minimized

COMPOSITE PHR

fabfcxsdxe.EOxiflx.jpJti Iitixihy

ta X Yz Xn Tn byu

TRAPEZOIDAL Xosa X sb h X Xo

Xl Xl

Stands t MdxXo Xo

f G Cx xxx x d

Terror we'll usethemeanucleetleoren

x

fftddx.bz flxdtfCxi

f g ixxDCx a dx

Page 9: DIFFERENTIATION - Oregon State Universitysites.science.oregonstate.edu/~restrepo/MTH452/... · GAUSSIANQUADRATURE ChooseExitsin andfi3in so that ECsx It dx aflail ft is minimized

ffcxdtflx.tl B I hz xi.mx

Xi

ffhddxshz fflxdtf.CH Y3zf4s

Xu Terror01h37

f i giftf no error

Xo XlCOMPOSITE TRAPEZOIDAL

fakddxz.tn 8xifCxi tOxzfho t0xngflxn

ftp.yykxsxaoxz x.xbn

Page 10: DIFFERENTIATION - Oregon State Universitysites.science.oregonstate.edu/~restrepo/MTH452/... · GAUSSIANQUADRATURE ChooseExitsin andfi3in so that ECsx It dx aflail ft is minimized

Composit UNIFORMGRID NEWTON COATES

I dx re tho 2fix t2fGd

2fanD t fanwith Ox ban

RudiNewton Gates quadrature refers toquadratureformulas on equallyspacedintends

Simpson Uses 2ndorder Lagrangepolynomialsand this requires atleast 3points

Xo a X at h Xz bI

h s b

ffabfixdxsflolxlfcxdtl.CMdxDtlzCxlfCxzDdx

f ftp.xokx.xkx.xdfmfscxddxE error

Page 11: DIFFERENTIATION - Oregon State Universitysites.science.oregonstate.edu/~restrepo/MTH452/... · GAUSSIANQUADRATURE ChooseExitsin andfi3in so that ECsx It dx aflail ft is minimized

Xz

ffcxjdx flolxlfcxdtl.CMdxDtlzGdfCxzDdx

01h fIt turnsoutthat theerror isoverlypessimistic

see

printednotes Byusingan integral oftheTaylor

series of fad about X one can find

Iaadx hglfcxdt4flxdtflxdfghgf.MG

SAMPSON

error errorerrorOchs

tN exactforfadSIMPSON FERG

i

Xo X Xz

Page 12: DIFFERENTIATION - Oregon State Universitysites.science.oregonstate.edu/~restrepo/MTH452/... · GAUSSIANQUADRATURE ChooseExitsin andfi3in so that ECsx It dx aflail ft is minimized

COMPOSITE SIMPSON Newton GatesVersion

f dxqoxgfkxdt4flxdtlfcxd.tlfCxDtt2flxyt 2fCxn.jt4flxn.ptflxn

nhustbeeoeuaxsbn

affxft.snXxz x.xbn

ADAPTIVE QUADRATURE

Reg uses Richardsonextrapolationfeelater

Adhoc use a finergridwhere fG charges moreri e where f Nae large

Page 13: DIFFERENTIATION - Oregon State Universitysites.science.oregonstate.edu/~restrepo/MTH452/... · GAUSSIANQUADRATURE ChooseExitsin andfi3in so that ECsx It dx aflail ft is minimized

GAUSSIANQUADRATURE

ChooseExitsin and fi 3in so that

ECsx It dx a flail ftis minimized There are In unknowns

Ci and 2x

Thetraditional strategy is to differentiate fwith respectto Xi's and Ci's and set these all

to zero The 1 3 ki that minimize Efix theseunknowns

Traditionally pick fad CPen Gand then find Xi is Eh that lead

to C so i

Page 14: DIFFERENTIATION - Oregon State Universitysites.science.oregonstate.edu/~restrepo/MTH452/... · GAUSSIANQUADRATURE ChooseExitsin andfi3in so that ECsx It dx aflail ft is minimized

ex Take aid EH and n 2

Ci Cz X Xz are unknowns M

R f dx.in ciffxi7

if f Epyx then

froth xtazx4 azxfdx.aedxta

dxtaz.fx2dxtazfx3dx

where ai are arbitrayarstats suffices to

show that issatisfied when aistis91,213

a gxo.tczx.ISdx

2cixitczxis.ixdx0

Page 15: DIFFERENTIATION - Oregon State Universitysites.science.oregonstate.edu/~restrepo/MTH452/... · GAUSSIANQUADRATURE ChooseExitsin andfi3in so that ECsx It dx aflail ft is minimized

cxitcaxis dx

cix.twf'x3dxsoSohrgforeiixi

G Cz lxi zV3 Xz Bg

i f k dxxffr tffBg