Skip to content

i2000s/NumericalIntegration.jl

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NumericalIntegration

Build Status

Coverage Status

codecov.io

This is a simple package to provide functionality for numerically integrating presampled data (meaning you can't choose arbitrary nodes). If you have the ability to evaluate your integrand at arbitrary points, please consider using better tools for the job (such as the excellent FastGaussQuadrature.jl).

Do note that while the code is trivial, it has not been extensively tested and does not focus on numerical precision. Issues, suggestions and pull requests are welcome.

Example usage

# setup some data
x = collect(-π : π/1000 : π)
y = sin(x)

# integrate using the default TrapezoidalFast method
integrate(x, y)

# integrate using a specific method
integrate(x, y, SimpsonEven())

The currently available methods are:

  • Trapezoidal
  • TrapezoidalEven
  • TrapezoidalFast (default)
  • TrapezoidalEvenFast
  • SimpsonEven
  • SimpsonEvenFast

All methods containing "Even" in the name assume evenly spaced data. All methods containing "Fast" omit basic correctness checks and focus on performance. Consequently, the fast methods will segfault or produce incorrect results if you supply incorrect data (vectors of different lengths, etc.).

About

Basic numerical integration routines for presampled data.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Julia 100.0%