[討論]微分繪圖的問題
今天教授丟給我們一個問題
Consider the function f(x) =x^3 - 2x + 4 on the interval [-2, 2] with
h = 0.25
Use the forward, backward, and centered finite difference approximations
for the first and second derivatives and then use graph
to illustrate which approximation is the most accurate.
Graph all three first derivative finite difference
approximations along with the theoretical one.
= = 不會下標語法,以↓替代
Forward finite difference approximation
f’(x↓i) = (f(x↓(i+1) ) - f(x↓i))/h + O(h)
Backward finite difference approximation:
f’(x↓i) = (f(x↓i) - f(x↓(i-1))/h + O(h)
Centered finite difference approximation
f’(xi) = (f↓(x i+1)) - f(x↓(i-1))/2h – O(h2)
我已經看過題目,並且知道,教授要我們繪出f(x)= x^3 - 2x +4 每個0.25間
兩點數據差除以h 的圖,也就是微分的定義,可是,
在Matlab上卻不知道怎麼著手,所以,請求板上高手給點意見,
絕對不是將問題丟給別人,很少發文,請板上高手多多指教,謝謝。
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 203.77.64.20