when(o=2,k^2*polyeval({12*a,6*b,2*c},xs),
when(o=3,k^3*(24*a*xs+6*b),when(o=4,k^4*24*a,0)))))
EndFunc
spli4de() returns the string "spli4de err" if the order o is less than 1. No testing is done to ensure the
order is an integer. Note that derivatives with order greater than four are zero.
You should not, in general, use the splice function to estimate derivatives of order greater than the first,
even though spli4de() provides that capability. Since we have not constrained the splice to match the
higher order derivatives, they can vary wildly. In the example above, I fit a splice to two simple
polynomials. The table below shows the derivative errors at the splice boundaries x
1
and x
3
.
-2.43E70-2.43E704
-24,381024,258-.95833
-6.10-0.6147-6.06-0.53162
-3.6E-110.85586.09E-110.85291
Error at x3f2'(x3)Error at x1f1'(x1)Derivative order
As expected, the first derivative errors at the splice boundaries are small, but the errors are so large for
derivatives of orders two and greater as to make the derivative estimate useless.
Integrating the splice
As with the derivative, we find definite integrals with the scaled polynomial and the scaled x
s
values. If
and
I =
¶
x
a
x
b
s
(
x
)
dx I
s
=
¶
x
sa
x
sb
s
s
(x
s
)dx
s
then
I = h
$
I
s
which is derived in a later section in this tip. We integrate the scaled splice function s
s
(x
s
) with the
scaled limits x
sa
and x
sb
found with
x
sa
=
1
h
$
x
a
− x
2
x
sb
=
1
h
$
x
b
− x
2
The following function can be used to integrate the splice function.
spli4in(xa,xb,x2,h,cl)
Func
©(xa,xb,x2,h,{list}) 4th-order splice integral
©9apr02/dburkett@infinet.com
© Input arguments:
© xa lower integration limit
© xb upper integration limit
© x2 splice interval midpoint
© h splice interval half-width
© cl splice coefficient list
h*á(polyeval(cl,xs),xs,(xa-x2)/h,(xb-x2)/h)
EndFunc
6 - 102