![]() |
Nth-order derivative of an arbitrary function
I've been trying to use Maxima to calculate the Nth-order derivative of a numerically-calculated function, which it obviously has a huge problem doing. This isn't any surprise since it would probably need to take N^2 samples of the function to differentiate N times, but there really isn't another way to do it.
Code:
nHas anyone been able to calculate something like this? I have Matlab sitting around ready to install, but I haven't ever used it. My other thought is to write a loop and/or use a matrix. Thanks. ta0kira |
You can't, generally speaking, calculate the n-the derivative because, generally speaking, not every function is that smooth.
|
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.1ta0kira 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. |
| All times are GMT -5. The time now is 04:36 PM. |