Jumps, i.e., f(x+)-f(x-)
jumps = fnjmp(f,x)
jumps = fnjmp(f,x)
is likefnval(f,x)
except that it returns the jumpf(x+) –f(x–) acrossx
(rather than the value atx
) of the functionfdescribed byf
and that it only works for univariate functions.
This is a function for spline specialists.
fnjmp(ppmak(1:4,1:3),1:4)
returns the vector[0,1,1,0]
since the页
function here is 1 on [1 .. 2], 2 on [2 .. 3], and 3 on [3 .. 4], hence has zero jump at 1 and 4 and a jump of 1 across both 2 and 3.
Ifx
iscos([4:-1:0]*pi/4)
, thenfnjmp(fnder(spmak(x,1),3),x)
returns the vector[12 -24 24 -24 12]
(up to round-off). This is consistent with the fact that the spline in question is a so calledperfect cubic B-spline, i.e., has an absolutely constant third derivative (on its basic interval). The modified command
fnjmp(fnder(fn2fm(spmak(x,1),'pp'),3),x)
returns instead the vector[0 -24 24 -24 0]
, consistent with the fact that, in contrast to the B-form, a spline in ppform does not have a discontinuity in any of its derivatives at the endpoints of itsbasic interval. Note thatfnjmp(fnder(spmak(x,1),3),-x)
returns the vector[12,0,0,0,12]
since-x
, though theoretically equal tox
, differs fromx
by round-off, hence the third derivative of the B-spline provided byspmak(x,1)
does not have a jump across-x(2)
,- x (3)
, and-x(4)
.