hello Internet oscar veliz again with another
video this time showing you how to find
the interval of convergence as well as
how widen that interval when it comes to
finding roots only bisection and false
position method actually have a
guarantee of convergence that's because
the interval that they use a and B force
the function to cross the x axis somewhere in between Newton type methods don't have this
same guaranteed convergence unless you
find the interval of convergence Newton
type methods are root finding
approaches with this form that have a
Newton step and a Newton update so
Newton's method is a Newton type method
but so are Secan Method a finite
difference method all of these you are
just in finding the interval of
convergence for let's look at an example
of a function both converging and
diverging when we try to find the root
this function will use the arctangent
and the approach will be used to find
the root is Newton's method which means
we also need the derivative in this case
it's 1 over x squared plus 1 we'll start
from 3 points the value point 5 the value of
1 and the value of 1.5 here's what the
arctangent looks like and the root is
clearly 0 but that's not really what
we're looking for we want to find the
interval the convergence so if we use
Newton's method starting at the point at
0.5 it takes about three iterations to
start converging on the root and if you
start the value 1 it also clearly starts
to converge but if we start the value 1
point 5 this causes our root finding
method to start to diverge here I
plotted out all of the points that we
used in our tests and we'll show green
squares for when they converged and red
x's for when they diverged
I also plotted out the negative starting
points to see if they also converge or
diverged and it's pretty clear that
anywhere between negative 1 and 1 will
converge at any point outside of
negative 1.5 and 1.5 diverges but when
does it go from converging to diverging
that's what we want to find we want to
find the interval of convergence so how
do we find that
interval given some function and an error
threshold we'll use a few test points to
see when they start to converge and
diverge well then take a new test point
midway between those two important
points and replace it depending on the
behavior of the function this is
essentially bisection using our example
from earlier we know that everything up
to one converged and everything after
1.5 diverged so we'll take the midpoint
and test it using Newton's method a few
times and it looks like this one is
converging so we'll add this to our
interval of convergence now we would
repeat the process using the new value
for C and D take the midpoint and start
using Newton's method and looks like
this one's also converging so we'll add
it to our new rule of convergence
again we take the midpoint between C and
D and test it using Newton's method
although this time it looks like it is
diverging so we'll exclude it from our
interval of convergence and we keep
repeating this process until C and D
come together here are our actual numbers
for C and D as we iterate through them
but this is only one half of the story
what we need are both sides of the
interval so if you look at this our
actual interval if your distance between
negative one point three nine and one
point three nine this is that same
interval graphically but what we would
like is for a way to expand that
interval recall this form for a Newton
type method we'll do one small change by
adding a variable gamma this is a
damping factor it's a number between
zero and one
not including zero when gamma is one
it's like normal we take the full Newton
step but when gamma is less than that
you take only a partial Newton step
let's look at an example where gamma is
equal to 0.9 and we start at the
divergent point of 1.5 with the gamma of
0.9 the point that usually led to
divergence 1.5 now leads to convergence
this is because we don't take the entire
Newton step so we don't use a normal
value for x2 we only take it part of it
now our interval of convergence is
actually between negative one point five
seven and positive one point five seven
but this is actually with the very large
value for gamma with a very small
gamma we can actually start much further
away in this case the starting point of
four and still lead to convergence with
our value for gamma being point one
our interval of convergence is actually
now between negative 13 and positive 13
some things to keep in mind the interval
of convergence depends a lot on the
function you're using the value for
gamma and the root finding method there can
also be outlier points outside of your
interval that lead to convergence
normally if your function isn't behaved
well and there also can be multiple
intervals of convergence usually if you
have multiple roots and they're spaced
far away from each other
also these intervals usually don't have
to be symmetric in our case they were
for the arctangent in practice usually
start with a small value for gamma
and then increase it as you iterate
through your function and even if you're
not interested in finding the interval
to converges you can still use gamma to
avoid divergence the example code that I
use to generate these graphs will be
hosted on github thank you for watching
if you have any questions comments
concerns or other suggestions or videos
please be sure to leave them in the
comments
