DADiSP Worksheet Functions > Function Categories > Statistics and Calculus > AREA

 

AREA

Purpose:

Calculates the area of a series, or portion of a series, using Simpson's Rule.

Syntax:

AREA(series, start, length)

series

-

Optional. Any series or expression evaluating to a series. Defaults to the current Window.

start

-

Optional. An integer. The index of the point defined as the start of the section to for the area calculation. Defaults to 1, the first point.

length

-

Optional. An integer. The length of the section; only valid if start has been specified. Defaults to the length of the section from the start point to the last value of the series.

Returns:

A scalar.

Example:

area(gsin(1000, 1/1000, 0.5))

 

returns 0.636618. For a sinusoid, the analytic computation is as follows:

 

image\area01.gif

 

With f = 0.5 and t = 1:

 

image\area02.gif

Example:

y1 = gnorm(1000, .001);

a1 = integ(y1);

a2 = area(y1);

 

Series a1 contains the cumulative area of y1 and scalar a2 contains the value of the total area of y1. Note that a1[end] == a2, the last point of the cumulative area equals the total area.

Remarks:

AREA returns the total area of a series using the composite Simpson’s rule. This method fits a quadratic polynomial to three points of the series and performs polynomial integration. In particular:

 

image\integ04.gif

 

where

 

image\integ05.gif

 

See INTEG to return the running or cumulative area of a series.

 

See TRAPZ to compute the area using the trapezoidal rule.

 

See CAREA to compute the closed loop area of a series.

 

See POLYAREA to compute the area of a regular closed polygon.

 

The area will be calculated correctly even if the defined start or length require points beyond the end of the series.

 

The area below the origin on the y-axis is negative area. To include the area below y=0 as positive area, take the absolute value of the series first, e.g. area(abs(W1)).

See Also:

ABS

CAREA

CUMTRAPZ

INTEG

POLYAREA

TRAPZ