Taylor Table and Finite Difference Aproximations

Determines Taylor coefficients for a finite differencing scheme with constant spacing.
617 Downloads
Updated 6 Nov 2010

View License

Determine the coefficents to a finite differencing scheme
ie. find the coeffs [c1,c2,c3] that are appropriate for the 2nd order
cent. diff. approx. to the first derivative :
(du/dx)[j] = 1/dx*(c1*u[j-1] + c2*u[j] + c3*u[j+1]) + error terms

Inputs:
x - vector containing relative distances to sampling points
ie. for example above would be x=[-1,0,1]
ie. 5 terms full forward: x = [0,1,2,3,4]
ie. 5 terms central : x = [-2,-1,0,1,2]

derv - order of the derivative to approximate

Ouputs:
c - the coefficients you're looking for!
T optional output matrix showing the Taylor Table coefficents
errOrder - lowest order of higher order terms
(order of accuracy, ie. H.O.T. = O(dx^2) is 2nd order)

Taylor table matrix output is ordered similarly to:
http://people.nas.nasa.gov/~pulliam/Classes/New_notes/Taylor_Tables.pdf

Cite As

Brandon Lane (2024). Taylor Table and Finite Difference Aproximations (https://www.mathworks.com/matlabcentral/fileexchange/29297-taylor-table-and-finite-difference-aproximations), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2007a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0.0