Learn R Programming

polyCub (version 0.5-1)

polyCub.SV: Product Gauss Cubature over Polygonal Domains

Description

Product Gauss cubature over polygons as proposed by Sommariva and Vianello (2007).

Usage

polyCub.SV(polyregion, f, ..., nGQ = 20, alpha = NULL, rotation = FALSE,
  engine = "C", plot = FALSE)

Arguments

polyregion
a polygonal domain. The following classes are supported: "owin", "gpc.poly", "SpatialPolygons"
f
a two-dimensional real function (or NULL to only compute nodes and weights). As its first argument it must take a coordinate matrix, i.e., a numeric matrix with two columns, and it must return a numeric vector of length the number of coordina
...
further arguments for f.
nGQ
degree of the one-dimensional Gauss-Legendre quadrature rule (default: 20) as implemented in function gauss.quad of package statmod. Nodes and weights up to nGQ=60 are cach
alpha
base-line of the (rotated) polygon at $x = \alpha$ (see Sommariva and Vianello (2007) for an explication). If NULL (default), the midpoint of the x-range of each polygon is chosen if no rotation is performed, and otherwise the $x
rotation
logical (default: FALSE) or a list of points "P" and "Q" describing the preferred direction. If TRUE, the polygon is rotated according to the vertices "P" and "Q", which are far
engine
character string specifying the implementation to use. Up to polyCub version 0.4-3, the two-dimensional nodes and weights were computed by Rfunctions and these are still available by setting engine = "R". The new C-implementation i
plot
logical indicating if an illustrative plot of the numerical integration should be produced.

Value

  • The approximated value of the integral of f over polyregion. In the case f = NULL, only the computed nodes and weights are returned in a list of length the number of polygons of polyregion, where each component is a list with nodes (a numeric matrix with two columns), weights (a numeric vector of length nrow(nodes)), the rotation angle, and alpha.

References

Sommariva, A. and Vianello, M. (2007). Product Gauss cubature over polygons based on Green's integration formula. Bit Numerical Mathematics, 47 (2), 441-453.

See Also

Other polyCub.methods: .polyCub.iso, polyCub.iso; polyCub.exact.Gauss; polyCub.midpoint; polyCub

Examples

Run this code
# see example(polyCub)

Run the code above in your browser using DataLab