Subroutine Type |
Utility/General |
|
Definition |
Evaluates a generic polynomial. A polynomial is a mathematical expression defined by the sum of the powers of a variable, multiplied by coefficients. |
|
Use |
This function can be called by any user-defined subroutine. |
|
Calling Syntax |
Fortran CALL POLY(X, X0, PAR, NPAR, IORD, VALUE, ERRFLG)
C c_poly(x, x0, par, npar, iord, value, errflg)
Python [value, eflag] = py_poly(x, x0, par, iord)
MATLAB [value, eflag] = m_poly(x, x0, par, iord) |
|
Input Arguments |
X [double precision] |
The independent variable. For example, to specify time as the independent variable, specify X as TIME. |
X0 [double precision] |
The shift in the polynomial. |
|
PAR [double precision] |
The array of coefficients. |
|
NPAR [integer] |
The number of coefficients specified. |
|
IORD [integer] |
The order of the derivative that POLY has to return. Order can be 0, 1 or 2. |
|
Output Values |
Value [integer] |
A value that the subroutine returns. |
Errflg [logical] |
A logical (true or false) variable that POLY returns to the calling subroutine. If POLY detects an error while calling the subroutine, it sets the error flag to true. |