IMath.SeriesSum

Fore Syntax

SeriesSum(X: Double; Power: Double; Step: Double; Coefficients: Array): Double;

Fore.NET Syntax

SeriesSum(X: double; Power: double; @Step: double; Coefficients: System.Array): double;

Parameters

X is the value of the power series variable.

Power is the index of power of X for the first member of the power series.

Step is the step, by which the index of the Power power is increased for each next member of the power series.

Coefficients is the set of factors by the corresponding powers of X.

Description

The SeriesSum method returns the sum of the power series.

Comments

The sum of the power series is calculated by the formula:

Fore Example

To execute the example, add a link to the MathFin system assembly.

Sub UserProc;
Var
    a: Array[
1..5Of Double;
    d: Double;
Begin
    a[
1] := 2.1;
    a[
2] := 6.3;
    a[
3] := 3.2;
    a[
4] := 8.8;
    a[
5] := 4.5;
    d := Math.SeriesSum(
1011, a);
    Debug.WriteLine(d);
End Sub UserProc;

After executing the example the console window displays the sum of the power series.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.MathFin;

Public Shared Sub Main(Params: StartParams);
Var
    a: Array[1..5Of Double;
    d: Double;
    SSum: Prognoz.Platform.Interop.MathFin.MathClass;
Begin
    SSum := New Prognoz.Platform.Interop.MathFin.MathClass();
    a[1] := 2.1;
    a[2] := 6.3;
    a[3] := 3.2;
    a[4] := 8.8;
    a[5] := 4.5;
    d := SSum.SeriesSum(1011, a);
    System.Diagnostics.Debug.WriteLine(d);
End Sub;

See also:

IMath