|
From: Daniel J S. <dan...@ie...> - 2006-06-14 19:29:15
|
Paging through all.dem, something caught my eye in the bivariat.dem demo. It's not of critical importance; after all, gnuplot is about plotting not applications. The first example is of approximating integration of a function. Unfortunately it appears to be a bad approximation. Attached is a PNG of the plot. Note how the integral approximation strangely drifts downward as x tends to +5. This is an integral of a strictly positive function! Anyway, given the formula for approximation (i.e., via rectangles), one has to conclude it is a sampling sort of thing. So 1) I changed the number of samples so that x=0 ends up being one of the samples. That corrected the slow drift away from the asymptote. 2) ... but introduced a problem where gnuplot's choice of samples and the x<=0 test caused a strange artifact. To fix that, I used x<=epsilon. 3) ... and there still remained an offset of delta/2 due to the integration process, so I added in the appropriate offset. See the attached PNG and diff files for an idea of the needed changes. Anyway, do we want to fix these sorts of things or just live with it? Dan |