determining order of accuracy

68 ビュー (過去 30 日間)
Ethan Boyce
Ethan Boyce 2020 年 1 月 27 日
回答済み: J. Alex Lee 2020 年 1 月 27 日
I've been given a table of discretion size and relative error and asked to determine the order of accuracy. I am new to Matlab and I am unsure how to tell matlab how to calculate this
h = 0.2 0.1 0.05 0.025
e = 6.98e-8 1.4e-9 2.5e-11 4.2e-13

採用された回答

J. Alex Lee
J. Alex Lee 2020 年 1 月 27 日
This is not a matlab question but a numerical analysis problem. Since someone already generated the results for you, it's a matter of understanding that typical discretization errors scale with the discretization size raised to some power, which is the order of accuracy
where h is the discretization size, so
So within a shift, you can find the order of accuracy p
h = [0.2 0.1 0.05 0.025 ]
e = [6.98e-8 1.4e-9 2.5e-11 4.2e-13]
pfit = polyfit(log(h),log(e),1)
p = pfit(1)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeTables についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by