作者war0tft (Dante)
看板MATLAB
标题[讨论]微分绘图的问题
时间Mon May 7 19:43:55 2012
今天教授丢给我们一个问题
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