Azzera filtri
Azzera filtri

determining order of accuracy

7 visualizzazioni (ultimi 30 giorni)
Ethan Boyce
Ethan Boyce il 27 Gen 2020
Risposto: J. Alex Lee il 27 Gen 2020
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

Risposta accettata

J. Alex Lee
J. Alex Lee il 27 Gen 2020
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)

Più risposte (0)

Categorie

Scopri di più su Tables in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by