PLUTO  4.4-patch2
Functions
math_quadrature.c File Reference

Collection of handy numerical math tools. More...

#include "pluto.h"

Functions

double GaussQuadrature (double(*func)(double, void *), void *par, double xb, double xe, int nstep, int order)
 

Detailed Description

This file provides a number of standard numerical routines to achieve simple basic tasks such as

Author
A. Mignone (migno.nosp@m.ne@p.nosp@m.h.uni.nosp@m.to.i.nosp@m.t)
Date
March 28, 2013

Function Documentation

◆ GaussQuadrature()

double GaussQuadrature ( double(*)(double, void *)  func,
void *  par,
double  xb,
double  xe,
int  nstep,
int  order 
)

Perform numerical quadrature of the function f(x) between the lower bound xb and upper bound xe by subdividing the interval into 'nstep' steps. A 3 or 5-point Gaussian quadrature rule is used depending on the input variable order (=3 or =5)

Parameters
[in]*funca pointer to the function func(x) (returning double) to be integrated
[in]xbthe lower interval bound
[in]xethe upper interval bound
[in]nstepthe number of sub-intervals into which the original interval [xb,xe] has to be divided
[in]orderthe number of Gaussian points (only 3 or 5)