numpy - How calculate the Error for trapezoidal rule if I only have data? (Python) -


i got array of data , need calculate area under curve, use numpy library , scipy library contain functions trapz in numpy , integrate.simps in scipy numerical integration gave me nice result in both cases.

the problem is, need error each 1 or @ least error trapezoidal rule. thing is, formula ask me function, don't have. have been researching way obtain error return same point...

here pages of scipy.integrate http://docs.scipy.org/doc/scipy/reference/integrate.html , trapz in numpy http://docs.scipy.org/doc/numpy/reference/generated/numpy.trapz.html try , see lot of code numerical integration , prefer use existing ones...

any ideas please?

while cel right cannot determine integration error if don't know function, there can do.

you can use curve fitting fit function through available data points. can use function error estimation.

if expect data fit kind of function sine, log or exponential use basis curve fitting.

for instance, if measuring drag on moving car, known mostly proportional velocity squared because of air resistance.

however, if not have knowledge applicable function assuming have n data points, there polynomial of n-1 degree fits exactly though data points. determining such polynomial data solving system of lineair equations. see e.g. polynomial interpolation. use polynomial estimate unknown real function. note outside range of data points polynomial might wildly inaccurate.


Comments

Popular posts from this blog

dns - How To Use Custom Nameserver On Free Cloudflare? -

python - Pygame screen.blit not working -

c# - Web API response xml language -