Supposing it's smooth for
x+[0,δ] where
δ is some sample range, what would be the simplest way to calculate the Nth derivative? I'll mostly be dealing with harmonic functions and natural exponents, all in the real domain. My first thought is to sample
N+1 times initially, then recursively difference pairs of two until the Nth order:
Code:
2^x | x=1, N=3, δ=0.1
d \ x 1.0 1.033 1.067 1.1 →
0 2.0 2.047 2.095 2.144 Δ/(δ/3) →
1 1.402 1.435 1.469 Δ/(δ/3) →
2 0.983 1.006 Δ/(δ/3) →
3 0.690 (actual: ln(2)^3*2^x=0.666)
The only problem I see with this is that the entire process would need to be repeated for every point on the plot, not to mention the fact that using the function in my initial post would also require numerical calculation of the integral, giving me at least
x*y*(N+1)/2 calculations of that integral. With my plot as it is, 80x50 & N=[0,8] that would be 18,000 numerical integral calculations! Of course, programatically I could carry over points and might be able to get away with ~9,000 calculations of the integral, but I'm not in the mood to write my own fractional-derivative mapper. I suppose that might be in order if I decide to continue this path of research. If not, it's still the sort of thing I would occupy myself with just to prove I haven't been beaten! It really only needs to be within about 10% at this point since I'm doing mostly visual analyses right now. Thanks.
ta0kira
PS Something I just thought of is that the functions I'll deal with will almost always be symbolically differentiable to any integer order (without converging to a constant,) so for real-order
n I could calculate symbolically to order
⌈n⌉, then calculate the fractional integral
⌈n⌉-n of that, which should get me down to 4,000 numerical integrations. I don't know who's idea it was to differentiate
after the fractional integral! Now I need to figure out how to get Maxima to numerically integrate for a plot (could actually be a gnuplot problem; I'll try exporting to a data file.)
PPS I understand that the issue stated initially isn't exactly what it actually is. Sorry.