FORCOS

FORCOS evaluates a Fourier cosine series.

Use

Called By

Any user-written subroutine

Prerequisite

None

Calling Sequence

CALL FORCOS (x, x0, w, par, npar, iord, value, errflg)

Input Arguments

 
x
A double-precision variable that specifies the independent variable.
x0
A double-precision variable that specifies a shift in the Fourier cosine function.
w
A double-precision variable that specifies the fundamental frequency of the series. The variable w must be in radians per unit of the independent variable.
par
A double-precision array of coefficients (a0,...,an).
npar
An integer variable that indicates the number of coefficients specified in the Fournier cosine series.
iord
An integer variable that defines the order of the derivative that FORCOS is to return. IORD can be zero, one, or two.

Output Arguments

 
errflg
A logical (true or false) variable that FORCOS returns to the calling subroutine. If FORCOS detects an error in the subroutine call statement, it sets errflg to true before it returns errflg to the calling subroutine.
value
A double-precision number returned by FORCOS. The meaning of the quantity depends on the value of IORD. The table below explains in more detail:  

Extended Definition

FORCOS evaluates a Fourier cosine series. The following equation defines FORCOS:
where:  
 
For an example of a MOTSUB evaluation subroutine that calls FORCOS, see MOTSUB.