(35S) 2nd order Derivative (at a point)
|
11-10-2020, 02:20 PM
Post: #2
|
|||
|
|||
RE: (35S) 2nd order Derivative (at a point)
(11-09-2020 09:51 PM)trojdor Wrote: EXAMPLE This is a bad example to test effect of h on 2nd derivative estimate. XCas> f(x) := horner([a4,a3,a2,a1],x) XCas> simplify( (f(x+h) - 2*f(x) + f(x-h)) / (h*h) ) → 2*a3 + 6*a4*x For cubics, central difference 2nd derivatives is independent of h. XCas> f(x):= x^3 + 5*x^2 - 21*x XCas> (f(x+h) - 2*f(x) + f(x-h)) / (h*h) | x=4, h=1000 → 34 BTW, for decimal calculator, we might get slightly better accuracy by splitting f(x): (this avoids possible rounding errors of 2*f(x)) c = f(x) f''(x) ≈ ((f(x+h) - c) - (c - f(x-h))) / (h*h) Quote:Zuleta uses this simple (forward distancing) approximation of the first derivative: For fair comparison, let's try both ways for f'(4), with same h = 1E-3: XCas> (f(x+h) - f(x)) / h | x=4, h=1E-3 → 67.017001 XCas> (f(x+h) - f(x-h)) / (2*h) | x=4, h=1E-3 → 67.000001 We can confirm all derivatives by expanding f(x+4): XCas> expand(f(x+4)) → x^3 + 17*x^2 + 67*x + 60 f(4) = 60 f'(4) = 67*1! = 67 f''(4) = 17*2! = 34 f'''(4) = 1*3! = 6 |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
(35S) 2nd order Derivative (at a point) - trojdor - 11-09-2020, 09:51 PM
RE: (35S) 2nd order Derivative (at a point) - Albert Chan - 11-10-2020 02:20 PM
RE: (35S) 2nd order Derivative (at a point) - trojdor - 11-10-2020, 11:23 PM
RE: (35S) 2nd order Derivative (at a point) - Albert Chan - 11-11-2020, 12:35 AM
RE: (35S) 2nd order Derivative (at a point) - trojdor - 11-11-2020, 04:11 AM
|
User(s) browsing this thread: 1 Guest(s)