Post Reply 
f'' oddities on WP 34S
05-22-2015, 11:35 PM
Post: #2
RE: f'' oddities on WP 34S
Both f' and f" use numerical methods to calculate the derivative. It is always possible to trick them. Not that I think it would help in this case, but you often need to set δx as described in the manual. Like most things numerical, you need some understanding of what is going on to effectively use the methods.


From the documentation in the sources:

Code:
Numeric Differentiation

order 4 equation:

df/dx   = (1/12h).[ f(x-2h) - 8.f(x-h) + 8.f(x+h) - f(x+2h) ] + O(h^4)
d2f/dx2 = (1/12h^2).[ - f(x-2h) + 16.f(x-h) - 30.f(x) +16.f(x+h) - f(x+2h) ] + O(h^4)

exact for polynomials up to quartics.


order 6 equation:

f '(x) ~ [ - f(x-3h) + 9 f(x-2h) - 45 f(x-h) + 45 f(x+h) - 9 f(x+2h) + f(x+3h) ] / ( 60 h )
f ''(x) ~ [ 2 f(x-3h) - 27 f(x-2h) + 270 f(x-h) - 490 f(x) + 270 f(x+h) - 27 f(x+2h) + 2 f(x+3h) ] / ( 180 h^2 )

exact for polynomials of degree < 7


order 10 equation:

df/dx = (1/2520.h).[ 2100.( f1 - f-1 ) - 600.( f2 - f-2 ) + 150.( f3 - f-3 ) - 25.( f4 - f-4 ) + 2.( f5 - f-5 ) ] + O(h^10)
d2f/dx2 = (1/25200.h^2).[ -73766 f0 + 42000.( f1 + f-1 ) - 6000.( f2 + f-2 ) + 1000.( f3 + f-3 ) - 125.( f4 + f-4 ) + 8.( f5 + f-5 ) ] + O(h^10)

where f(x+kh) = fk

exact for polynomials of degree < 11

The code attempts the 10th order equations but will fall back to the 6th and 4th order alternatives if the function fails to return a numeric result at the higher ordered.


- Pauli
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
f'' oddities on WP 34S - lrdheat - 05-22-2015, 05:44 PM
RE: f'' oddities on WP 34S - Paul Dale - 05-22-2015 11:35 PM
RE: f'' oddities on WP 34S - lrdheat - 05-23-2015, 07:30 PM
RE: f'' oddities on WP 34S - lrdheat - 05-23-2015, 07:31 PM



User(s) browsing this thread: 1 Guest(s)