Simp: Numeric integration using Simpson's Rule

Description Usage Arguments Author(s) Examples

View source: R/MTfuncs_all.R

Description

Numeric integration of a univariate function using Simpson's Rule. NOTE: do NOT use variables with names f, a, b, m, n, h, sum, xx, or simp.

Usage

1
Simp(f, a, b, m = 100)

Arguments

f

An expression to be integrated as a function of t, e.g. "sin(2*pi*t)"

a

Lower limit of integration

b

Upper limit of integration

m

Simpson's parameter (larger number is more accurate but slower)

Author(s)

Matt Tyers

Examples

1
2
Simp("t^2",0,1)
Simp("1.5+3*sin(2*pi*t)",0,0.0833333333,m=2000)

mbtyers/MTfuncs documentation built on May 22, 2019, 12:58 p.m.