## `numeric::ncdata` -- weights and abscissae of Newton-Cotes quadrature

#### Introduction

`numeric::ncdata``(n)` returns the weights and the abscissae of the Newton-Cotes quadrature rule with n equidistant nodes.

#### Call(s)

`numeric::ncdata(n)`

#### Parameters

`n` | - | the number of nodes: a positive integer

#### Returns

A list `[b,c]` is returned. The lists `b=[b[1],..,b[n]]` and `c=[c[1],..,c[n]]` are the rational weights and abscissae of the Newton-Cotes quadrature rule, respectively.

#### Side Effects

The function uses `option remember`. It is not sensitive to the environment variable `DIGITS`.

#### Related Functions

`numeric::gldata`, `numeric::gtdata`, `numeric::quadrature`

#### Details

- The Newton-Cotes quadrature rule sum(b[i]*f(c[i]),i=1..n) produces the exact integral int(f(x),x=0..1) for all polynomials f through degree n-1. If n is odd, then the quadrature rule is exact through degree n.
- The equidistant abscissae c=[c[1],..,c[n]] are given by c[i]=(i-1)/(n-1).

#### Example 1

The following call produces exact data for the quadrature rule with four nodes:

    >> numeric::ncdata(4)

                     [[1/8, 3/8, 3/8, 1/8], [0, 1/3, 2/3, 1]]

#### Background

- The numerical integrator `numeric::quadrature` calls `numeric::ncdata` to provide the data for Newton-Cotes quadrature.

#### Changes

- no changes

Do you have questions or comments?
Copyright © SciFace Software GmbH & Co. KG 2000