# AKISPL

Utility/Data Access SubroutineUses a spline fitting method to return the interpolated value or 1st/2nd derivative of the interpolated value for a Reference_Spline element.

## Use

The function can be called by any user-defined subroutine.

## Format

Fortran Calling Syntax
CALL AKISPL (XVAL, ZVAL, ID, IORD, ARRAY, ERRFLG)
C/C++ Calling Syntax
c_akispl (xval, zval, id, iord, array, errflg)
Python Calling Syntax
[array, errflg] = py_akispl (xval, zval, id, iord)
Compose/MATLAB Calling Syntax
[array, errflg] = m_akispl (xval, zval, id, iord)

## Description

AKISPL is a non-smoothing, spline-based interpolation (5th order) that requires a minimum of six points on a curve. It provides good fits to curves where the second derivative is rapidly varying and, hence, it produces good results for the zeroth and first order derivative of the approximated function, but is usually unreliable for the second derivative. AKISPL is faster than CUBSPL or QUISPL and is usually used for force elements based on spring data.

## Attributes

XVAL
[double]
The first independent variable of a curve or surface at which the spline function is supposed to interpolate the output value.
ZVAL
[double]
The second independent variable of a surface at which the spline function is supposed to interpolate the output value. Set this value to 0 if only a curve interpolation is needed.
ID
[integer]
The ID of the Reference_Spline element.
IORD
The order of the derivative to be returned by the spline function. Only 0, 1, or 2 are valid entities.

## Output

ARRAY
[double]
The vector output value of dimension 3.
• If IORD is 0, then ARRAY(1) contains the computed interpolated value y.
• If IORD is 1, then ARRAY(1) and ARRAY(2) contain the derivatives of y with respect to x and z.
• If IORD is 2, then ARRAY(1), ARRAY(2), and ARRAY(3) contain the second derivatives of y with respect to xx, xz, and zz, respectively.
ERRFLG
[logical]
Logical variable that is returned to the calling subroutine and that indicates the success of the spline function call.

## Example

The following is a Python-based, user-defined request element that calls the AKISPL data access subroutine.
def REQSUB(id, time, par, npar, iflag):
results = [0.0]*8
results  = AKISPL(time,0,100,0)
results  = AKISPL(time,0,100,1)
results  = AKISPL(time,0,100,2)
return results