MATLAB Answers

how to find the order of convergence

조회 수: 132(최근 30일)
kevin liu
kevin liu 2021년 5월 4일
편집: J. Alex Lee 2021년 5월 4일
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
J. Alex Lee
J. Alex Lee 2021년 5월 4일
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.

댓글을 달려면 로그인하십시오.

답변(2개)

Jan
Jan 2021년 5월 4일
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
kevin liu
kevin liu 2021년 5월 4일
if the initial value is 0, then how to find the order of convergence?(as i compute, the root for this function is about 0.33,using initial value 0)

댓글을 달려면 로그인하십시오.


J. Alex Lee
J. Alex Lee 2021년 5월 4일
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)

Community Treasure Hunt

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

Start Hunting!

Translated by