Finite difference weights

Finds finite difference (or interpolation) weights for an arbitrary set of nodes in one dimension.
2,2K Downloads
Aktualisiert 6 Feb 2007

Lizenz anzeigen

Given a vector of nodes x, a point of interest xi, and a nonnegative order of derivative m, this function returns weights such that an inner product with the values f(x) returns an approximation to f^(m)(xi). Based on the recursive formula due to Fornberg (A Practical Guide to Pseudospectral Methods, Cambridge University Press).

Examples from the file:

% First derivative near a boundary
h = 0.4; x = h*(0:5)';
w = fdweights(x(2),x,1)
[ w'*exp(x) exp(x(2)) ]

% Interpolation
x = [0 0.25 1 1.5 2.5]';
w = fdweights(0.5,x,0)
[ w'*sin(x) sin(0.5) ]

Zitieren als

Toby Driscoll (2024). Finite difference weights (https://www.mathworks.com/matlabcentral/fileexchange/13878-finite-difference-weights), MATLAB Central File Exchange. Abgerufen .

Kompatibilität der MATLAB-Version
Erstellt mit R2006b
Kompatibel mit allen Versionen
Plattform-Kompatibilität
Windows macOS Linux
Kategorien
Mehr zu Linear Algebra finden Sie in Help Center und MATLAB Answers
Quellenangaben

Inspiriert: Easy build finite-difference operators

Community Treasure Hunt

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

Start Hunting!
Version Veröffentlicht Versionshinweise
1.0.0.0