View the step-by-step solution to:

# For this homework, we are going to consider the straightforward problem of applying Newton's method to nding the roots of the simple third-order...

Please explain How I am able to solve this problem.

For this homework, we are going to consider the straightforward problem of applying Newton's method to ﬁnding the roots of the simple third-order polynomial 1:3 — 1. For this
simple polynomial we lmow there are three roots, one of which by inspection is l. The other
two are complex numbers whose cube is also 1: the two numbers {—1 :l: ﬁjﬂﬂ have this
property, which you can {and should} verify in Matlab. Newton’s method for ﬁnding one of these roots consists of iteratively improving an initial
guess a by repeatedly applying the rule _ 23 —1
3r:2 until lea — 1| is suﬁciently small; we'll use 11]&quot;5 as a tolerance level for this homework. Since the roots are generally complex, so too might be e. Newton’s method works
perfectly well for complex values of a, but we must he sure to do the complex-valued
arithmetic properly. As we saw on LEG, Il:i'++ won't do this for us natively, and we will
need to implement the rules for complex subtraction, multiplication, and division manually.
[Integer powers are just repeated multiplication, so those are implicitly covered in the rules
we practiced this week}. Remember that mixing real and complex arithmetic is easily
accomplished by treating any real number as a complex with zero imaginary part {so 1
is really 1 + 03‘ and 3 is really 3 + ﬂj in the equation above} Finally note that for the
absolute value in the convergence test, you need to use the deﬁnition ofthe absolute value
[magnitude] of a complex number. Now, since we already know what the roots of this polynomial are, you might wonder
why we would go through the trouble of writing a program to I[at best approximately) ﬁnd
one. It turns out that there is a fascinating, indeed fractal, geometric ﬁgure hiding in the
Newton calculations for this problem. Barring pathological choices of initial guess for e [and it is possible for Newton to diverge
for a very poor initial guess}, any initial guess will converge to one of the three roots. The
question is: which one? Theoretically, and experimentally, initial guesses in a connected
region of the complex plane &quot;surrounding&quot;I one of the three roots will converge to the nearest
one. But what about regions of the plane that are approximately equidistant from two or
more roots? These might converge equally well to any of the roots, and the boundaries between points which converge to different roots can be very complex [and non-obvious},
resulting in a beautiful fractal structure it visualised graphically. i=2 So that‘s what we want to do with our program. We want it to accept as an input the
choice of initial guess for a. After Newton's metlrod has converged to a root, we want the
program to &quot;graphically&quot;I describe the root to which the initial guess has converged. For
this, we‘ll assign a color corresponding to each of the three roots, &quot;red“l for the root at 1, “green” for the root at. {—1 + veins, and “blue” for the root at [—1 — isms.
A. sample run of your program should look as shown at the top of the following page:

Initial guess (real and mag}: -1 ﬂ {Enter}- Initial guess a I -1 ccnvergen te red met. Initial guess (real and imagll‘. -.1 .1 {Enter} Initial guess a I -ﬂ.1 + [Llj cenverges to green reet.
Initial gliesa (real and inagll: .25 .43 {Enter}
Initial guess 2 I ﬂ.25+ﬂ.43j converges tc: blue rent.
Initial geese (real and iuag]: e u (Enter:- DK - dune! Hate that the cede doesn’t just run Newton‘s methed fer a single initial g'uem1 but keeps
asking fer neu.r initial guesses and reperting the “rent mler” that it cenysrges to until yen
enter I] I] fer the initial guess. Your&quot; cede will need tc: use a ceuple while leeps and cenditienals to de all its werlr. Just
like in Matlah, yen can &quot;'nlrat'El while leaps inside ef ether while leaps. er nest eenditienals inside of leeps. leaps inside ef cenditienals, etc. NDTE: If yen had yeur pregranr test an extremely large number ef initial guesses, and
then drew a ﬁgure with each peint in the eernpleir plane celered aecerding tn the scheme alzuerlre1 yen wenld get the fractal ﬁgure helew knewn as a “Julia set”. {The brightness
1warlatiens within the celers ef this ﬁgure is an indicatien ef hew many Newten iteratiens
it tee}: te cenyerge tn the indicated rent.) See if yen can lecate the three referenes cases
abcwe in this diagram [which is centered en the erigin ef the plane]!

### Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

### -

Educational Resources
• ### -

Study Documents

Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

Browse Documents