integrate

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2019 License: BSD-3-Clause Imports: 1 Imported by: 0

README

Gonum integrate GoDoc

Package integrate provides numerical evaluation of definite integrals of single-variable functions for the Go programming language.

Documentation

Overview

Package integrate provides functions to compute an integral given a specific list of evaluations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Trapezoidal

func Trapezoidal(x, f []float64) float64

Trapezoidal estimates the integral of a function f

\int_a^b f(x) dx

from a set of evaluations of the function using the trapezoidal rule. The trapezoidal rule makes piecewise linear approximations to the function, and estimates

\int_x[i]^x[i+1] f(x) dx

as

(x[i+1] - x[i]) * (f[i] + f[i+1])/2

where f[i] is the value of the function at x[i]. More details on the trapezoidal rule can be found at: https://en.wikipedia.org/wiki/Trapezoidal_rule

The (x,f) input data points must be sorted along x. One can use github.com/gonum/stat.SortWeighted to do that. The x and f slices must be of equal length and have length > 1.

Types

This section is empty.

Directories

Path Synopsis
Package quad provides numerical evaluation of definite integrals of single-variable functions.
Package quad provides numerical evaluation of definite integrals of single-variable functions.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL