how to find the order of convergence
36 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
for the function h(x)=53/162+sin(x-1/3)-(17/18)*(x)-(1/6)*x^2+(1/6)*x^3,how to display the order of convergence(using newton method)?
3 Kommentare
J. Alex Lee
am 4 Mai 2021
Bearbeitet: J. Alex Lee
am 4 Mai 2021
Have you already gone about solving with Newton's method? When you do, keep track of the residuals and solution updates. Quadratic convergence would be residual value roughly halving every step. As Jan notes, you need to track this only for steps close to the actual solution otherwise order of convergence doesn't mean much.
Antworten (2)
Jan
am 4 Mai 2021
The convergence of the Newton methods depends on the initial value. There is no general order of convergence. For some start values the method does not converge at all.
2 Kommentare
J. Alex Lee
am 4 Mai 2021
Newton's method should nominally have quadratic convergence near the root(s) where the linearized approximation is "good". Sure, if you start far from the root (and Newton's method succees), you may locally have worse convergence far away, but there the premise of "linear is good approximation" is less valid so I guess it is a matter of semantics if you want to call that order of convergence?
J. Alex Lee
am 4 Mai 2021
It sounds like you already implemented Newton's method, so just save all your residuals and plot [the log of norm] versus the previous values. The slope of the best fit in the linear region (close to zero) should be order of convergence.
r = nan(MaxIter,1)
for k = 1:MaxIter
% newton iterations
r(k) = % residual calculation
end
ar = abs(r)
% need to filter values of r that are too big or too small...empirically,
% this works for me
mask = ar > 1e-1 | ar < 1e-12
ar(mask) = []
w = ar(1:end-1)
z = ar(2:end)
plot(w,z,'o')
pf = polyfit(w,z,1)
OrderConv = pf(1)
0 Kommentare
Siehe auch
Kategorien
Mehr zu Ordinary Differential Equations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!