Action:
|
Computes the numerical integral of the given law function over the specified range.
|
|
Filename:
|
kern/kern_scm/law_scm.cxx
|
|
APIs:
|
api_integrate_law
|
|
Syntax:
|
(law:nintegrate law low-lim up-lim [tol])
|
|
Arg Types:
|
law
|
law | string | real | position |
|
|
|
par-pos | gvector
|
|
low-lim
|
real
|
|
up-lim
|
real
|
|
tol
|
real
|
|
Returns:
|
real
|
|
Description:
|
The
law:nintegrate Scheme extension computes a numerical integration on
law.
|
|
|
law can be a defined law, a law string, or a constant number.
|
|
|
low-lim and
up-lim are two real values that specify the lower and upper limit for integration.
|
|
|
tol is an optional real value that specifies the tolerance for the integration calculation.
|
|
Example:
|
; law:nintegrate
|
|
; Define a law to integrate.
|
|
(define law1 (law "x + 1"))
|
|
;; law1
|
|
; Evaluate the law over the range 0 and 1.
|
|
(law:nintegrate law1 0 1)
|
|
;; 1.5
|