how to find the order of convergence
91 ビュー (過去 30 日間)
古いコメントを表示
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
2021 年 5 月 4 日
編集済み: 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
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 件のコメント
J. Alex Lee
2021 年 5 月 4 日
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
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)
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Quadratic Programming and Cone Programming についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!