FC_FourierPartialSum

 

FC_FourierPartialSum - General Information

Overview

Type:

Function

Available as of:

V1.0.3.0

Versions:

Current version

Task

This calculates a Fourier partial sum.

Description

This calculates the value of a finite Fourier partial sum. The requirement for this is that first the Fourier coefficients have been calculated up to a sufficiently large index, using the function FC_FourierCoefficients.

The Fourier partial sum for function f up to the index N has the following form (with regard to the definition of the Fourier coefficients see FC_FourierCoefficients):

G-SE-0068556.1.gif-high.gif

 

 

Under suitable preconditions for the function f, S f, N approximates the latter as well as required for a sufficiently large N.

Interface

Input

Data type

Description

i_lrXPeriod

LREAL

Period of the function / length of the definition range

i_diMaxIndex

DINT

Index up to which the Fourier partial sum is to be calculated (designated above as N ). The Fourier coefficients must first have been calculated at least up to this index, using the function FC_FourierCoefficients.

i_plrFourierCoefficientsA

POINTER TO LREAL

Pointer to the start of the array with Fourier coefficients A, which first have been calculated using the function FC_FourierCoefficients.

i_plrFourierCoefficientsB

POINTER TO LREAL

Pointer to the start of the array with Fourier coefficients B, which first have been calculated using the function FC_FourierCoefficients.

i_lrXValue

LREAL

X value for which the Fourier partial sum is to be calculated.

Output

Data type

Description

q_etDiag

GD.ET_Diag

General library-independent statement on the diagnostic.

A value not equal to ET_Diag.Ok corresponds to an diagnostic message.

q_etDiagExt

ET_DiagExt

POU-specific output on the diagnostic.

q_etDiag = ET_Diag.Ok -> Status message

q_etDiag <> ET_Diag.Ok -> Diagnostic message

q_lrFourierPartialSum

LREAL

Calculated value of the Fourier partial sum at the point i_lrXValue.

Diagnostic Messages

q_etDiag

q_etDiagExt

Enumeration value

Description

OK

Ok

0

Ok

InputParameterInvalid

MaxIndexRange

61

MaxIndex is outside the valid range.

InputParameterInvalid

PointerFourierCoefficientsAInvalid

62

The pointer VourierCoefficientsA is invalid.

InputParameterInvalid

PointerFourierCoefficientsBInvalid

63

The pointer VourierCoefficientsB is invalid.

InputParameterInvalid

XPeriodRange

58

XPeriod is outside the valid range.

MaxIndexRange

Enumeration name:

MaxIndexRange

Enumeration value:

61

Description:

MaxIndex is outside the valid range.

Issue

Cause

Solution

-

At the input i_diMaxIndex, an invalid value has been applied.

At the input i_diMaxIndex, a value greater than or equal to 0 must be transferred.

Ok

Enumeration name:

Ok

Enumeration value:

0

Description:

Ok

The partial sum has been calculated successfully.

PointerFourierCoefficientsAInvalid

Enumeration name:

PointerFourierCoefficientsAInvalid

Enumeration value:

62

Description:

The pointer VourierCoefficientsA is invalid.

Issue

Cause

Solution

-

At the input i_plrFourierCoefficientsA, an invalid value has been applied.

At the input i_plrFourierCoefficientsA, a value not equal to 0 must be transferred.

PointerFourierCoefficientsBInvalid

Enumeration name:

PointerFourierCoefficientsBInvalid

Enumeration value:

63

Description:

The pointer VourierCoefficientsB is invalid.

Issue

Cause

Solution

-

At the input i_plrFourierCoefficientsB, an invalid value has been applied.

At the input i_plrFourierCoefficientsB, a value not equal to 0 must be transferred.

XPeriodRange

Enumeration name:

XPeriodRange

Enumeration value:

58

Description:

XPeriod is outside the valid range.

Issue

Cause

Solution

-

At the input i_lrXPeriod, a number smaller than Gc_lrZeroTolerance has been applied.

i_lrXPeriod must be greater than 0.