© yy1 f1(x1)
© yy2 the mean of yy1 and yy3
© yy3 f2(x3)
© hy y-interval half-width
©
expr("define f1(x)="&f1) © Define local functions to be spliced
expr("define f2(x)="&f2)
x2-h→x1 © Find splice interval bounds
x2+h→x3
f1(x1)→yy1 © Find si(x1), si(x3)
f2(x3)→yy3
(yy1+yy3)/2→yy2 © Find splice interval midpoint
math\spli4x(yy2,x2,h,c)→x2 © Solve for x at interval midpoint
abs(yy2-yy1)→hy © Find y-axis half-width
hy/((f1(x),x)|x=x1)→xp1 © Find dx/dy at x1 and x2
hy/((f2(x),x)|x=x3)→xp3
augment(math\splice4(x1,x2,x3,xp1,xp3),{yy2,hy}) © Solve for splice coefficients
EndFunc
Note that the output list includes y2 and hy in addition to the coefficient list, since you will need them to
evaluate the inverse polynomial. If you have saved the output list in list1, then use
left(list1,5)
to extract just the polynomial coefficients, and
list[6]
to get y2, and
list[7]
to get hy.
User interface program for splice4()
The user interface program shown below, spli4ui(), automates the process of calculating a splice and
checking the results. spli4ui() finds the splice coefficients and saves them. It also calculates and
displays the errors for s(x) and the first derivatives.
spli4ui() uses a symbolic variable ä. If you have a variable ä in the current folder, it will be deleted.
spli4ui() assumes that the derivatives of the functions to be spliced can be found with the built-in
derivative function. For functions which cannot be differentiated by the calculator, you can still calculate
a splice, but you cannot use spli4ui(). See tip [6.26], Accurate numerical derivatives with nDeriv() and
Ridder's method, to find the necessary derivatives.
spl4ui()
Prgm
©splice4() user interface
©16apr02/dburkett@infinet.com
6 - 105