I have an issue with Newton(tangent) method in Matlab.
I wrote a program, that:
- Displays the graphic of the given function
f
, associated with the nonlinear equation, which solutions I need to determine(thus I let the user determine the first approximation using the graph, by choosing a point on [Ox axes that's nearest to the solution -> to the intersection off
with [Ox) Determines the solution for the equation, corresponding to the first approximation.
But, still it isn't enough.
Is it possible to make such a kind of test for the first approximation, introduced by user, that it would prevent Newton method from blocking(this means that there is no point of local minimum in the vecinity of the choosen first approximation) ? Thus, when something like this happens, user would know that the point choosen is wrong, because there are two tangents to the graph of function
f
, so the program won't give anything, but will block.Can you, please, suggest me something ?