# INTPOL: Linear, Cubic, Inverse, Derivatives, Integral

### HicEst numerical linear or cubic Akima interpolation of xy data. Roots, Find, 1st and 2nd derivative, integration.

⇒Home ⇒Contents ⇒more Numerics

#### Bookmarks:

⇒cubic_akima_interpolation   ⇒extrapolation   ⇒first_derivative   ⇒interpolated_roots   ⇒linear_interpolation   ⇒numeric_integration   ⇒second_derivative   ⇒y_interpolated

#### Optional keywords:

(Syntax of optional keywords)
D2ydx DYdx ERror Find Init X2 XVector Xi YVector
• result = INTPOL(XVector=x_vector, YVector=y_array [, optional keywords] )
result is:
• when LEN(y_array) == LEN(x_vector)
• with LEN(y_array) == 4* LEN(x_vector)
• the Akima method avoids the wiggles of the Spline method
• of interpolated data between Xi and X2
• example with N=10 (note linear interpolation at boundaries):
• xdata = 0.5 1.9 3.0 4.2 4.8 6.2 6.7 8.1 9.3 9.5
• ycubic = 2.9 2.7 -0.8 3.3 -0.1 7.7 3.9 -1.8 1.1 3.5
• INTPOL(Init, XVector=xdata, YVector=ycubic) ! initialization
• yc = INTPOL(Xi=x, XVector=xdata, YVector=ycubic) ! cubic interpolation
• y1 = INTPOL(Xi=x, XVector=xdata, YVector=ycubic, DYdx) ! 1st derivative
• yi = INTPOL(Xi=xdata(1), XVector=xdata, YVector=ycubic, X2=x) ! integral
keyword type mini sample keyword sequence is insignificant
XVector vec XV=year (

#### required

) a vector with N nodes of the independent variable in rising order
• nodes may be unequally spaced
YVector arr YV=linear (

#### required

)
• linear interpolation (XV and YV have same length):
• REAL :: x_linear(N), y_linear(N)
• cubic interpolation (YV has 4 times the elements of XV):
• REAL x_cubic(N), y_cubic(4,N)
• For x < node(2) or x > node(N-1): Interpolation is always linear. This means that is also linear.
• the outermost 2 nodes determine the

#### slope at boundaries

(force boundary slopes by inserting extra nodes close to the first/last node)
• the Akima polynomial coefficients are in y(N+1, ..., 4*N) after the 1st call with Init
Init --- Init (

#### required on 1st call to cubic interpolation

) to initialize the Akima coefficients
Xi num X=3.1 interpolate at Xi,

#### default is Xi=0

X2 num x2=3.9 integrate the interpolated data from Xi to X2
Find num find=y find x closest to Xi with interpolated value equal to y
DYdx --- dy 1st derivative of interpolated data at Xi
DYdx num dy=yprime find x closest to Xi with 1st derivative equal to yprime
D2ydx --- d2y 2nd derivative of interpolated data at Xi
D2ydy num d2y=y2prime find x closest to Xi with 2nd derivative equal to y2prime
ERror LBL ER=99 on error jump to ⇒ label 99

Support HicEst   ⇒ Impressum
©2000-2016 Georg Petrich, HicEst Instant Prototype Computing. All rights reserved.