CUBSPL uses the traditional cubic-curve fitting method to interpolate data in the SPLINE statement (C++ or FORTRAN).
Use
Called By
Any user-written subroutine
Prerequisite
SPLINE statement in the dataset
Calling Sequence
CALL CUBSPL (xval, zval, id, iord, array, errflg)
Input Arguments
xval | A double-precision value that specifies the x value at which CUBSPL is to interpolate y. |
zval | A double-precision value that specifies the z value at which CUBSPL is to interpolate y. |
id | An integer variable that specifies the identifier of the corresponding SPLINE statement. |
iord | An integer variable that specifies the order of the derivative that CUBSPL is to return. The order is usually zero, but can be one or two. |
Output Arguments
array | A double-precision array of length three. The values contained in array depend on IORD. The table below summarizes what array is to contain: |
IORD: | Array: |
0 | The interpolated value of y | Array(0) = y Array(1) = 0 Array(2) = 0 |
1 | The first partial derivatives of y with respect to x and z | Array(1) =  Array(2) =  Array(3) = 0 |
2 | The second partial derivatives of y with respect to x and z | Array(1) =  Array(2) =  Array(3) =  |
Note that: |
errflg | A logical (true or false) variable that CUBSPL returns to the calling subroutine. If CUBSPL detects an error in its calculations, it sets errflg to true before it returns errflg to the calling subroutine. |
Extended Definition
CUBSPL accesses data in a SPLINE statement, using the traditional cubic curve-fitting method to fit a spline to the data, and returns one of the following:
■A value for the dependent variable (y) for each value it receives for the independent variable or variables.
■The first partial derivatives of y with respect to the dependent variable(s).
■The second partial derivatives of y with respect to the dependent variable(s).
If the spline data input with the SPLINE statement has one independent variable, Adams Solver uses a cubic polynomial to interpolate between points. If the spline data has two independent variables, Adams Solver first uses a cubic interpolation method to interpolate between points of the first (x) independent variable, and then uses a linear method to interpolate between curves of the second (z) independent variable.
In addition to CUBSPL, Adams Solver includes the AKISPL data access subroutine, which uses the Akima cubic curve-fitting method. Use CUBSPL when defining motion inputs. Use AKISPL if the primary concern is with the forces or torques acting on the model.
If the spline data incorporates sudden changes in value, CUBSPL gives more oscillatory results for the curve or surface than are given by the AKISPL data access subroutine. However, the first and second derivatives are smoother than those of the curve or surface given by AKISPL. This may be an important consideration. For example, if one of these spline subroutines is used to define a motion, Adams Solver uses the second derivative to compute the force or torque attributable to the motion. It also uses the first and second derivatives to calculate results. If one of these spline subroutines is used to define a force, the dependent values give the force, and Adams Solver uses the first derivative to calculate results.