notes

© All Rights Reserved

2 views

notes

© All Rights Reserved

- mth 204
- MA1251 Numeric Methods
- Lagrange
- 243166312-Numerical-Analysis.pdf
- Syllabus Advanced Mathematics 2015.1 (1)
- Math201_F2017_Syllabus
- 5710 NM Tutorial 2
- 38666963 Elementary Textbook on the Calculus
- Introduction to Programming Using ‘C’ ECSL 102B 3–0–0=3 Fundamentals:
- Partial Differential Equations
- syllabus
- The Basis Refinement Method
- 1_2_3_4_5_6_gauss interpolation.pptx
- Midterm SOS 237 Package Calculus
- 361 Study Guide
- FDM-5
- Tutorial 9 - Solutions
- es4 - analysis - lessonsex - rev2014
- Finite Element Method_chapter4
- Matrix Calc

You are on page 1of 29

of a function by using the function values at

only a set of discrete points

Ordinary differential equation (ODE)

Partial differential equation (PDE)

Represent the function by Taylor polynomials

or Lagrange interpolation

Evaluate the derivatives of the interpolation

polynomial at selected (unevenly distributed)

nodal points

y f(x)

dy f ( x x) f ( x)

Differentiation lim

dx x0 ( x x) x

y f ( x x) f ( x) dy

Difference

x ( x x ) x dx

Evenly distributed points along the x-axis

x h

x1 x2 x3

Numerical Differentiation

Forward difference

Backward difference

Centered difference

Forward difference

h

x

xi1 xi xi+1

Backward difference

h

x

xi1 xi xi+1

Centered difference

2h

x

xi1 xi xi+1

y

First Derivatives

f ( x )

x

i-2 i-1 i i+1 i+2

f ( x i 1 ) f ( x i ) y i 1 y i

Forward difference f ( x )

x i 1 x i x i 1 x i

Backward difference f ( x ) f ( x i ) f ( x i 1 ) y i y i 1

x i x i 1 x i x i 1

Central difference f ( x i 1 ) f ( x i 1 ) y i 1 y i 1

f ( x )

x i 1 x i 1 x i 1 x i 1

Truncation Errors

Uniform grid spacing

h2 h3

f ( x i 1 ) f ( x i h ) f ( x i ) hf ( x i ) f ( x i ) f ( x i )

2! 3!

2 3

f ( x ) f ( x h ) f ( x ) hf ( x ) h

f ( x i )

h

f ( x i )

i 1 i i i

2! 3!

f ( xi1 ) f ( xi ) h

forward : f ( x i ) f ( 1 ) O(h)

h 2

f ( xi ) f ( xi 1 ) h

backward : f ( x i ) f ( 2 ) O(h)

h 2

f ( xi 1 ) f ( xi 1 ) h2

central : f ( x i ) f ( 3 ) O(h 2 )

2h 6

Example: First Derivatives

Use forward and backward difference approximations

to estimate the first derivative of

f ( x ) 0.1 x 4 0.15 x 3 0.5 x 2 0.25 x 1.2

at x = 0.5 with h = 0.5 and 0.25 (exact sol. = -0.9125)

Forward Difference

f ( 1) f (0.5 ) 0.2 0.925

h 0.5 , f ( 0.5 ) 1.45 , t 58.9%

1 0.5 0.5

h 0.25 , f (0.5 ) f (0.75 ) f (0.5 ) 0.63632813 0.925 1.155 , 26.5%

0.75 0.5 0.25

t

Backward Difference

f (0.5 ) f (0 ) 0.925 1.2

h 0.5 , f ( 0.5 ) 0.55 , t 39.7%

0.5 0 0.5

h 0.25 , f (0.5 ) f (0.5 ) f (0.25 ) 0.925 1.10351563 0.714 , 21.7%

0.5 0.25 0.25

t

Example: First Derivative

Use central difference approximation to estimate the

first derivative of

f ( x ) 0.1 x 4 0.15 x 3 0.5 x 2 0.25 x 1.2

at x = 0.5 with h = 0.5 and 0.25 (exact sol. = -0.9125)

Central Difference

f ( 1 ) f ( 0 ) 0.2 1.2

h 0.5 , f ( 0.5 ) 1.0 , t 9.6%

10 1

f ( 0.75 ) f ( 0.25 )

h 0.25 , f ( 0.5 )

0.75 0.25

0.63632813 1.10351563

0.934 , t 2.4%

0.5

Second-Derivatives

Taylor-series expansion

Uniform grid spacing

h2 h3 h4

f ( x i 1 ) f ( x i ) hf ( x i ) f ( x i ) f ( x i ) f ( x i )

2! 3! 4!

2 3 4

f ( x ) f ( x ) hf ( x ) h f ( x ) h f ( x ) h f ( x )

i 1 i i

2!

i

3!

i

4!

i

h2 h4

f ( x i 1 ) f ( x i 1 ) 2 f ( x i ) f ( x i ) f ( x i )

2! 4!

f ( x i 1 ) 2 f ( xi ) f ( xi 1 ) h2

f ( xi ) 2

f ( )

h 4!

Centered Finite-Divided Differences

Forward Finite-divided differences

Backward finite-divided differences

First Derivatives

f ( x )

Parabolic curve

3 -point Forward difference

f ( xi 2 ) 4 f ( xi1 ) 3 f ( xi )

f ( x )

xi 2 xi

3 -point Backward difference

3 f ( xi ) 4 f ( xi 1 ) 3 f ( xi 2 )

f ( x )

xi xi2

Example: First Derivatives

Use forward and backward difference approximations

of O(h2) to estimate the first derivative of

f ( x ) 0.1 x 4 0.15 x 3 0.5 x 2 0.25 x 1.2

at x = 0.5 with h = 0.25 (exact sol. = -0.9125)

Forward Difference

f ( 1 ) 4 f ( 0.75 ) 3 f ( 0.5 )

f ( 0.5 )

2( 0.25 )

0.2 4( 0.6363281 ) 3( 0.925 )

0.859375 , t 5.82%

0.5

Backward Difference

3 f ( 0.5 ) 4 f ( 0.25 ) f ( 0 )

f ( 0.5 )

2( 0.25 )

3( 0.925 ) 4( 1.035156 ) 1.2

0.878125 , t 3.77%

0.5

Higher Derivatives

All second-order accurate O(h2)

f ( x i 1 ) f ( x i 1 )

f ( x i )

2h

f ( x i 1 ) 2 f ( x i ) f ( x i 1 )

f ( x i )

h2

f ( x i 2 ) 2 f ( x i 1 ) 2 f ( x i 1 ) f ( x i 2 )

f ( x i )

h3

f ( x i 2 ) 4 f ( x i 1 ) 6 f ( x i ) 4 f ( x i 1 ) f ( x i 2 )

f ( xi )

h4

Higher order formula may be derived

19.3 Richardson Extrapolation

D D(h1 ) a2 h1

2

a4 h1

4

........ D(h1 ) E1 (h1 )

2

(1)

based on the step size h1. Reducing the step size to half, h2 =h1/2,

we obtained another approximation D(h2).

E1( h12 ) 4 D( h2 ) D( h1 )

4 Hence 4*(2) - (1), D +E3 ( h14 )

E2 ( h22 ) 3

By properly combining the two approximations, D(h1) & D(h2),

the error is reduced to O(h4).

Example of using Richardson Extrapolation

Central Difference Scheme

1 h2

f '( x ) D h [ f ( x h ) f ( x h )] f '''( x ) O ( h 4 ) (1)

2h 6

1 h2

f '( x ) D h / 2 [ f ( x h / 2) f ( x h / 2)] f '''( x ) O( h 4 ) (2)

h 24

4D( h / 2) D( h)

4*(2) - (1), f ' O( h )

4

3

of f(h) is reduced to O(h4).

Ex19.2: Richardson Extrapolation

Use central difference approximation to estimate the

first derivative of

f ( x ) 0.1 x 4 0.15 x 3 0.5 x 2 0.25 x 1.2

at x = 0.5 with h = 0.5 and 0.25 (exact sol. = -0.9125)

f (1) f (0)

D1 ( h 0.5) 1.0, t 9.6%

1 0

f (0.75) f (0.25)

D2 ( h 0.25) 0.934, t 2.4%

0.75 0.25

4 D2 D1

D 0.9125, t 0%

3

General Three-Point Formula

Lagrange interpolation polynomial for

unequally spaced data

f ( x ) Li 1 ( x ) f ( x i 1 ) Li ( x ) f ( x i ) Li 1 ( x ) f ( x i 1 )

( x x i )( x x i 1 )

f ( xi 1 )

( x i 1 x i )( x i 1 x i 1 )

( x x i 1 )( x x i 1 )

f ( xi )

( x i x i 1 )( x i x i 1 )

( x x i 1 )( x x i )

f ( xi1 )

( x i 1 x i 1 )( x i 1 x i )

Lagrange Interpolation

1st-order Lagrange polynomial

x x1 x x0

f1 ( x ) L0 f ( x0 ) L1 ( x ) f ( x1 ) f ( x0 ) f ( x1 )

x0 x1 x1 x0

( x x1 )( x x 2 )

f2 ( x ) f ( x0 )

( x0 x1 )( x0 x 2 )

( x x0 )( x x 2 )

f ( x1 )

( x1 x0 )( x1 x 2 )

( x x0 )( x x1 )

f ( x2 )

( x 2 x0 )( x 2 x1 )

Lagrange Interpolation

Third-order Lagrange polynomial

( x x 1 )( x x 2 )( x x 3 )

f3 ( x ) f ( x0 )

( x0 x 1 )( x0 x 2 )( x0 x 3 )

( x x0 )( x x 2 )( x x 3 )

f ( x1 )

( x 1 x0 )( x 1 x 2 )( x 1 x 3 )

( x x0 )( x x 1 )( x x 3 )

f ( x2 )

( x 2 x0 )( x 2 x 1 )( x 2 x 3 )

( x x0 )( x x 1 )( x x 2 )

f ( x3 )

( x 3 x0 )( x 3 x 1 )( x 3 x 2 )

Lagrange Interpolation

L0(x)f(x0) L2(x)f(x2)

x0 x1 x2

L1(x)f(x1)

General Three-Point Formula

Lagrange interpolation polynomial for

unequally spaced data

f ( x ) Li 1 ( x ) f ( x i 1 ) Li ( x ) f ( x i ) Li 1 ( x ) f ( x i 1 )

( x x i )( x x i 1 ) ( x x i 1 )( x x i 1 )

f ( xi 1 ) f ( xi )

( x i 1 x i )( x i 1 x i 1 ) ( x i x i 1 )( x i x i 1 )

( x x i 1 )( x x i )

f ( xi1 )

( x i 1 x i 1 )( x i 1 x i )

First derivative

2 x xi xi1 2 x xi 1 xi 1

f ( x ) f ( x i 1 ) f ( xi )

( x i 1 x i )( x i 1 x i 1 ) ( x i x i 1 )( x i x i 1 )

2 x x i 1 xi

f ( xi1 )

( x i 1 x i 1 )( x i 1 x i )

Second Derivative

First Derivative for unequally spaced data

2 x xi xi1 2 x xi 1 xi 1

f ( x ) f ( x i 1 ) f ( xi )

( x i 1 x i )( x i 1 x i 1 ) ( x i x i 1 )( x i x i 1 )

2 x x i 1 xi

f ( xi1 )

( x i 1 x i 1 )( x i 1 x i )

2 2

f ( x ) f ( x i 1 ) f ( xi )

( x i 1 x i )( x i 1 x i 1 ) ( x i x i 1 )( x i x i 1 )

2

f ( xi1 )

( xi1 x i 1 )( x i 1 x i )

Differentiation of Noisy Data

MATLABs Methods

Derivatives are sensitive to the noise

Use least square fit before taking derivatives

polyfit(p, x) - evaluation of Pn(x)

polyder(p) - differentiation

x x( 1 ), x( 2 ), , x( n )

diff ( x ) x( 2 ) x( 1 ), x( 3 ) x( 2 ), , x( n ) x( n 1 )

dy/dx at x(i) forward difference

dy diff(y)./d iff(x)

dy/dx at x(i 1) backward difference

- mth 204Uploaded bySahil Chopra
- MA1251 Numeric MethodsUploaded byanusha57
- LagrangeUploaded byPlinio Alexis Yauri Castillo
- 243166312-Numerical-Analysis.pdfUploaded byabhishek
- Syllabus Advanced Mathematics 2015.1 (1)Uploaded byJuan Palacios
- Math201_F2017_SyllabusUploaded byMahabub Alam
- 5710 NM Tutorial 2Uploaded bySivanesh Kumar
- 38666963 Elementary Textbook on the CalculusUploaded byPintohedfang
- Introduction to Programming Using ‘C’ ECSL 102B 3–0–0=3 Fundamentals:Uploaded byprajikv
- Partial Differential EquationsUploaded byLameune
- syllabusUploaded byrahul bansal
- The Basis Refinement MethodUploaded bya2172265
- 1_2_3_4_5_6_gauss interpolation.pptxUploaded byAkshat Khandelwal
- Midterm SOS 237 Package CalculusUploaded bySan Li
- 361 Study GuideUploaded byHarry Long
- FDM-5Uploaded byNugyne Koha
- Tutorial 9 - SolutionsUploaded byAaronKo
- es4 - analysis - lessonsex - rev2014Uploaded byapi-203629011
- Finite Element Method_chapter4Uploaded byNalaka Santhajeewa
- Matrix CalcUploaded bymiketol
- Scientific Computing, A Introductory Survey Cap. 11 - M. T. HeathUploaded byJuan Ramos
- XI Business MathsUploaded bySivakumar
- Calculus with Analytic Geometry 1Uploaded byQueen Ann Jumuad
- MSc Time TableUploaded byAtanu Manna
- MIT18_02SC_MNotes_n1_2Uploaded byStacy Johnson
- MathUploaded byhungkg
- Work sheetUploaded byPeter Hua
- Review Questions CalculusUploaded byRomalyn Galingan
- Mbatech Trimester 1 SyllabusUploaded bychirag3110
- fourtran.pdfUploaded byHernan Kennedy Ricaldi Porras

- BISECTION METHOD.docUploaded byAnonymous 1VhXp1
- GrowthUploaded byAnonymous 1VhXp1
- Plumbing Notes Summary of UPCUploaded byAnonymous 1VhXp1
- Plumbing Notes Summary of ASPE Vol 1.docxUploaded byAnonymous 1VhXp1
- Plumbing Notes Summary of ASPE Vol 1Uploaded byAnonymous 1VhXp1
- task pneuUploaded byAnonymous 1VhXp1
- error curve for vacuum gage calibration.xlsxUploaded byAnonymous 1VhXp1
- Cavs 25 3pts.Uploaded byAnonymous 1VhXp1
- 1-REPORT-mL-1Uploaded byAnonymous 1VhXp1
- EquationsUploaded byAnonymous 1VhXp1
- Secant MethodUploaded byAnonymous 1VhXp1
- Me 324 Photonic ThermalUploaded byAnonymous 1VhXp1
- Appendix GUploaded byAnonymous 1VhXp1
- Calculation Flow ChartsUploaded byAnonymous 1VhXp1
- 2017 SPONSORSHIP-LETTER-HANDOS-SUGBO.docxUploaded byAnonymous 1VhXp1
- Pump Form TableUploaded byManikandan Subramanian
- Promissory NoteUploaded byAnonymous 1VhXp1
- Pump Selection DataUploaded byMohammed Amine Moussaoui
- Gantt ChartUploaded byAnonymous 1VhXp1
- Light Intensity CalculationsUploaded byAnonymous 1VhXp1
- Economic AnalysisUploaded byAnonymous 1VhXp1
- Interview SchedUploaded byAnonymous 1VhXp1
- MOR Conclusion RevisedUploaded byAnonymous 1VhXp1
- Daily Accomplishment ReportUploaded byAnonymous 1VhXp1
- FarmingUploaded byAnonymous 1VhXp1
- November 21Uploaded byAnonymous 1VhXp1
- Chain and SprocketUploaded byAnonymous 1VhXp1
- Group 2 Report AssignmentsUploaded byAnonymous 1VhXp1
- CommentsUploaded byAnonymous 1VhXp1

- SAP Content Management - Link Between SAP Objects and Originals - Product Lifecycle Management - SCN WikiUploaded byprodigious84
- Plant Nutrition and Soil Fertility Manual.pdfUploaded byDaniel Ion
- UPHILL, Eric P. - Egyptian Towns and CitiesUploaded bySamara Dyva
- Kpc-3plus Manual RevDUploaded byFrancisco Arpi
- Tuberculosis NejmUploaded byluisperezhernandez
- 647669 CrossChex Standard User Manual V1.0 EnUploaded byrakimun
- tnpcb_you2013.pdfUploaded bySalim Sheik
- Ent600_rubric_amendment 26 Sept 2017Uploaded bysyafiqfat
- Environmental AnalysisUploaded byAjesh Mukundan P
- CC-20090507Uploaded bykaniappan sakthivel
- 2019-03-15T17-22-16_r3dlogUploaded byKair Pimentel
- Schizo Animal ModelsUploaded byniku
- 'The Whole is Always Smaller Than Its Parts' - A Digital Test of Gabriel Tardes' MonadsUploaded bykozanaybar
- Investigation 1 - 8th - Compound NounsUploaded byRolando Conorana
- STP260S_20WdUploaded bysfdfazel
- 14 Common Dog Behavior Myths DecodedUploaded byIsaac John
- SWOT Admart (1)Uploaded byVarma Yrcs
- Bulk Sales Law 2Uploaded byWeng Santos
- IAS 7 SummaryUploaded bymalickmustafa
- Online Shopping Trend in India (Ppt)Uploaded byhandsomeliar
- Agreement Relating to Opening Maintenance and Closure of Correspondent AccountsUploaded byAutochthon Gazette
- Dallas AN114 1-Wire File StructureUploaded byguillermofiobera
- OGP 444 Guide to Health & Safety ReportingUploaded bymseymour91
- M&a CourseworkUploaded byZX Lee
- BB2083 & BB2084 - User's ManualUploaded byMichał Augustyniak
- Mooring Winch Tests1Uploaded byRachit
- article 9Uploaded bySagar Bhavsar
- SWQuestionsUploaded byatlas77
- Interview Experiences 2017 AllUploaded byTEJENDRA KUMAR
- csbpUploaded bysinner123