Difference between revisions of "Fdweights.m"

From Spinach Documentation Wiki
Jump to: navigation, search
(→‎See also)
Line 36: Line 36:
  
 
==See also==
 
==See also==
−
[[fdmat.m]], [[fdlap.m]], [[fdhess.m]], [[fdkup.m]], [[fdweights.m]], [[fftdiff.m]], [[fourdif.m]], [[fourlap.m]]
+
[[fdmat.m]], [[fdlap.m]], [[fdhess.m]], [[fdkup.m]], [[fdvec.m]], [[fftdiff.m]], [[fourdif.m]], [[fourlap.m]]
  
  
 
''Version 2.2, authors: Bengt Fornberg, [[Ilya Kuprov]]''
 
''Version 2.2, authors: Bengt Fornberg, [[Ilya Kuprov]]''

Revision as of 14:03, 16 August 2018

Calculates finite difference weights for numerical derivatives, including order 0, which amounts to interpolation.

Syntax

     w=fdweights(target_point,grid_points,max_order)

Arguments

    target_point - the point at which the derivative 
                   is required

    grid_points  - the points at which the function 
                   is given

    max_order    - maximum derivative order

Outputs

    w            - finite difference coefficient array
                   with the coefficients for the succes-
                   sive derivatives in rows

Examples

Point weights for central schemes on a three-point stencil, where the value is required at the centre:

 >> fdweights(0,[-1 0 1],2)

 ans =
          0    1.0000         0
    -0.5000         0    0.5000
     1.0000   -2.0000    1.0000

The three rows are for interpolation, first derivative and second derivative respectively.

See also

fdmat.m, fdlap.m, fdhess.m, fdkup.m, fdvec.m, fftdiff.m, fourdif.m, fourlap.m


Version 2.2, authors: Bengt Fornberg, Ilya Kuprov