Managing with oscillation and torsion in newton Raphson method without limiting iterations

StackOverflow https://stackoverflow.com/questions/18595319

  •  27-06-2022
  •  | 
  •  

質問

I've been trying to write a MATLAB-function which calculates the a root of a function simply by using Newton-Raphson. The problem with this algorithm is it diverges near torsion points and roots with oscillations (e.g for x^2+2 after 10 iteration with initial guess -1 the method diverges). Is there any satisfying condition to identify when we get oscillations and torsions which doesn't count iterations in a really inefficient way?

役に立ちましたか?

解決

You may be interested in the Matlab File Exchange entry called "Newton Raphson Solver with adaptive Step Size". It implements the Newton-Raphson method to extract the roots of a polynomial.

In particular, this function has a while staement on line 147. Simply replace

while( err > ConvCrit && n < maxIter)

with

while( err > ConvCrit) %removing the maximum iteration criterion

他のヒント

I'd argue that your initial estimate of -1 is poor, hence the estimation error is large and this is what probably causes the algorithm to overshoot and oscillate (and eventually diverge).

You could consider doing successive over-relaxation by multiplying the quotient f(xn)/f'(xn) by a positive factor. I recommended you to look up methods for adaptive successive over-relaxation (which I won't elaborate here), that (adaptively) set the relaxation parameter iteratively based on the observed behavior of the converging process.

I think that you are trying to solve a function which does not have any real roots... so the newton raphson is not going to provide you any results for any initial guess..

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top