determining order of accuracy
23 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Ethan Boyce
el 27 de En. de 2020
Respondida: J. Alex Lee
el 27 de En. de 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
0 comentarios
Respuesta aceptada
J. Alex Lee
el 27 de En. de 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)
0 comentarios
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!