FORCOS

Utility/GeneralEvaluates a Fourier Cosine. A Fourier Cosine series is a collapsed version of a Fourier series, where the factors multiplying the SIN() terms are all zero.

Use

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

Format

Fortran Calling Syntax
CALL FORCOS (X, X0, W, PAR, NPAR, IORD, VALUE, ERRFLG)
C/C++ Calling Syntax
c_forcos(x, x0, w, par, npar, iord, value, errflg)
Python Calling Syntax
[value, errflg] = py_forcos(x, x0, par, npar, iord)
MATLAB Calling Syntax
[value, errflg] = m_forcos(x, x0, par, npar, iord)

Attributes

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 Fourier Cosine series.
W
[double precision]
The fundamental frequency of the Fouries series. It is assumed to be specified in radians per unit of X unless a D is used after the value.
PAR
[double precision]
The array of coefficients.
NPAR
[integer]
The number of coefficients specified.
IORD
[integer]
The order of the derivative that FORCOS has to return. Order can be 0, 1 or 2.

Output

VALUE
[integer]
The value that the subroutine returns.
ERRFLG
[logical]
A logical (true or false) variable that FORCOS returns to the calling subroutine. If FORCOS detects an error while calling a subroutine, it sets the error flag to true.