Testing finite difference approximation

20 ビュー (過去 30 日間)
Jayden Riley
Jayden Riley 2020 年 10 月 12 日
コメント済み: J. Alex Lee 2020 年 10 月 13 日
I need to right a script that tests 𝑓(𝑥) = 𝑥^3 at 𝑥 = 3 and determine the second order accuracy numerically by plotting the total relative Error vs Δ𝑥 in a double log plot, where Δ𝑥 = 10^𝑒𝑥𝑝 with the 𝑒𝑥𝑝 varying from 0 to −6 with a step size of 0.25. I have found the second order accurate finite difference approximation for the first derivative of a function 𝑓(𝑥) to be f'(x)=f(xi+Δx)-f(xi-Δx)/2(Δx).
Any suggestions?
  1 件のコメント
J. Alex Lee
J. Alex Lee 2020 年 10 月 13 日
where are you stuck?

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeStatistics and Machine Learning Toolbox についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by