{"id":1308,"date":"2016-01-18T12:00:42","date_gmt":"2016-01-18T17:00:42","guid":{"rendered":"https:\/\/blogs.mathworks.com\/cleve\/?p=1308"},"modified":"2016-12-05T14:06:53","modified_gmt":"2016-12-05T19:06:53","slug":"fractal-global-behavior-of-newtons-method","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/cleve\/2016\/01\/18\/fractal-global-behavior-of-newtons-method\/","title":{"rendered":"Fractal Global Behavior of Newton&#8217;s Method"},"content":{"rendered":"<div class=\"content\"><!--introduction-->When the starting point of Newton's method is not close to a zero of the function, the global behavior can appear to be unpredictable. Contour plots of iteration counts to convergence from a region of starting points in the complex plane generate thought-provoking fractal images. Our examples employ the subject of two recent posts, the historic cubic $x^3-2x-5$.\r\n\r\n<!--\/introduction-->\r\n<h3>Contents<\/h3>\r\n<div>\r\n<ul>\r\n \t<li><a href=\"#430340b1-3f9b-4d82-abae-cc8227a1b509\">Historic cubic<\/a><\/li>\r\n \t<li><a href=\"#e18e3943-4e3a-4b33-aa23-a5e8cc337883\">Newton iterator<\/a><\/li>\r\n \t<li><a href=\"#1df32073-6b1d-4bfe-a5e3-1d4778c95438\">View fractals<\/a><\/li>\r\n \t<li><a href=\"#29aa41e2-2886-4df2-ba39-3a9c732ada58\">Bird's eye view<\/a><\/li>\r\n \t<li><a href=\"#91801cda-2a7c-46e4-aeea-8b147c287b5d\">Zoom in at origin<\/a><\/li>\r\n \t<li><a href=\"#51dc8feb-c4fd-41b4-8a99-415e7eb7894e\">Detail at the origin.<\/a><\/li>\r\n \t<li><a href=\"#0ad0f1cf-4b35-4a85-936e-e7825c573649\">At a pole<\/a><\/li>\r\n \t<li><a href=\"#91d14c56-4a23-4ea2-b691-177621d1c3bc\">Zoom 10^6, flip colormap<\/a><\/li>\r\n \t<li><a href=\"#c4fa3f93-a32f-4e8a-b1ac-eeffde0d3851\">Zoom 10^8<\/a><\/li>\r\n \t<li><a href=\"#d097fd99-799b-46c6-bb5d-ebf48f1314cd\">One more<\/a><\/li>\r\n \t<li><a href=\"#93ef4fcb-aa3d-4a1a-b2a9-55388112c01a\">References<\/a><\/li>\r\n<\/ul>\r\n<\/div>\r\n<h4>Historic cubic<a name=\"430340b1-3f9b-4d82-abae-cc8227a1b509\"><\/a><\/h4>\r\nAll of today's images are generated from the cubic $x^3-2x-5$ that was the subject of two previous posts, <a href=\"https:\/\/blogs.mathworks.com\/cleve\/2015\/12\/21\/a-historic-cubic\/\">a-historic-cubic<\/a> and <a href=\"https:\/\/blogs.mathworks.com\/cleve\/2016\/01\/04\/testing-zero-finders\/\">testing-zero-finders<\/a>.\r\n\r\n$$ F(z) = z^3-2z-5 $$\r\n<pre class=\"codeinput\">   F = @(z) z.^3-2*z-5;\r\n<\/pre>\r\nNewton's method also requires the derivate.\r\n\r\n$$ F'(z) = 3z^2-2 $$\r\n<pre class=\"codeinput\">   Fprime = @(z) 3*z.^2-2;\r\n<\/pre>\r\n<h4>Newton iterator<a name=\"e18e3943-4e3a-4b33-aa23-a5e8cc337883\"><\/a><\/h4>\r\nHere is the function that carries out the Newton iteration, starting at a specified point in the complex plane. The function returns both the resulting zero and the count of the number of iterations required to reach it. These counts are the basis for the fractal images.\r\n<pre class=\"codeinput\">   type <span class=\"string\">newton<\/span>\r\n<\/pre>\r\n<pre class=\"codeoutput\">   function [z,kount] = newton(F,Fprime,z)\r\n   % Newton.  [z,kount] = newton(F,Fprime,z).\r\n   % Start Newton's method for function F and derivative Fprime\r\n   % at a scalar complex point z.  Return converged value z and\r\n   % the iteration kount. \r\n      sqrteps = sqrt(eps(2));\r\n      kount = 0;\r\n      w = Inf;\r\n      while abs(z-w) &gt; sqrteps\r\n         kount = kount+1;\r\n         w = z;\r\n         z = z - F(z).\/Fprime(z);\r\n      end\r\n   end\r\n<\/pre>\r\n<h4>View fractals<a name=\"1df32073-6b1d-4bfe-a5e3-1d4778c95438\"><\/a><\/h4>\r\nThis function uses <tt>contourf<\/tt> to produce two colored contour plots. The first shows the iteration counts for a square grid of starting points. The second is based on the polar angles of the computed zeros. There are just three contour levels in the second plot, corresponding to the three zeros of the cubic.\r\n<pre class=\"codeinput\">   type <span class=\"string\">fractals<\/span>\r\n<\/pre>\r\n<pre class=\"codeoutput\">   function fractals(F,Fprime,z0,d,n);\r\n   % Fractals.  fractals(F,Fprime,z0,d,n).\r\n   % Investigate fractal images generated by Newton's method\r\n   % for the function F(z) with derivative Fprime(z)\r\n   % started on the (n+1)-by-(n+1) complex grid centered at\r\n   % the point z0 with half-width d.\r\n      \r\n      xs = real(z0)+[-1:2\/n:1]*d;\r\n      ys = imag(z0)+[-1:2\/n:1]*d;\r\n      [y,x] = ndgrid(ys,xs);\r\n      z = x+i*y;\r\n      kounts = zeros(size(z));\r\n      for k = 1:length(z(:))\r\n         [z(k),kounts(k)] = newton(F,Fprime,z(k));\r\n      end\r\n   \r\n      figure(1)\r\n      levels = min(kounts(:)) + [0:10];\r\n      contourf(xs,ys,kounts,levels)\r\n      colorbar\r\n      axis square\r\n   \r\n      figure(2)\r\n      zone = round(atan2(imag(z),real(z))\/pi);\r\n      contourf(xs,ys,zone,-1:1)\r\n      colorbar('Ticks',(2\/3)*(-1:1),'Ticklabels',{'-2\\pi\/3',0,'2*\\pi\/3'})\r\n      c = [1 1 0; 0 1 1; 1 0 1];\r\n      colormap(c)\r\n      axis square\r\n   end \r\n<\/pre>\r\n<h4>Bird's eye view<a name=\"29aa41e2-2886-4df2-ba39-3a9c732ada58\"><\/a><\/h4>\r\nOur largest region is centered at the original and has a half-width of 30. The complex plane is separated into thirds by rays emanating from the origin along the negative real axis and with polar angles of $\\pm \\frac{\\pi}{3}$. All of the fractal behavior occurs near one of these separators.\r\n\r\nIterations that do not start near a separator converge to the zero in that starting region. The contours filled with orange and yellow and the associated colorbar tell us that most iterations starting at a distance greater than 30 from the origin take at least a dozen steps to converge.\r\n<pre class=\"codeinput\">   fractals(F,Fprime,0,30,512)\r\n<\/pre>\r\n<img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/cleve\/cubic_blog3_01.png\" alt=\"\" hspace=\"5\" vspace=\"5\" \/> <img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/cleve\/cubic_blog3_02.png\" alt=\"\" hspace=\"5\" vspace=\"5\" \/>\r\n<h4>Zoom in at origin<a name=\"91801cda-2a7c-46e4-aeea-8b147c287b5d\"><\/a><\/h4>\r\nZoom in by a factor of 10. The half-width is now 3. The three blue contour levels where the function counts are the lowest surround the three zeros. This is where Newton's method works well; start close to a zero and the iteration will converge in a few steps to that zero.\r\n\r\nThe regions separating the three minima have higher iteration count and more complicated behavior. The derivative $F'(x) = 3x^2-2$ is equal to zero at\r\n\r\n$$ x = \\pm \\sqrt{\\frac{2}{3}} \\approx \\pm 0.816$$\r\n\r\nThe Newton iterator with $F'(x)$ in the denominator has poles at these two points. The second derivative $F''(x) = 6x$ is zero at the origin. The contour plots show a four-way branching pattern at the origin and a three-way branching pattern at the positive pole. These two patterns occur repeatedly at all scales in the fractal.\r\n<pre class=\"codeinput\">   fractals(F,Fprime,0,3,512)\r\n<\/pre>\r\n<img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/cleve\/cubic_blog3_03.png\" alt=\"\" hspace=\"5\" vspace=\"5\" \/> <img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/cleve\/cubic_blog3_04.png\" alt=\"\" hspace=\"5\" vspace=\"5\" \/>\r\n<h4>Detail at the origin.<a name=\"51dc8feb-c4fd-41b4-8a99-415e7eb7894e\"><\/a><\/h4>\r\nZoom in by another factor of 30. The half-width is now 0.1. We can see the four-way branching pattern in more detail. In the second contour plot most of this region is colored either magenta or yellow, indicating that most iterations converge to one of the complex zeros in the left half plane. A relatively smaller portion is colored cyan, indicating that convergence to the zero on the positive real axis is less frequent.\r\n<pre class=\"codeinput\">   fractals(F,Fprime,0,0.1,512)\r\n<\/pre>\r\n<img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/cleve\/cubic_blog3_05.png\" alt=\"\" hspace=\"5\" vspace=\"5\" \/> <img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/cleve\/cubic_blog3_06.png\" alt=\"\" hspace=\"5\" vspace=\"5\" \/>\r\n<h4>At a pole<a name=\"0ad0f1cf-4b35-4a85-936e-e7825c573649\"><\/a><\/h4>\r\nPan right to the pole at $x=.816$. We see a three-way separator with the same area for each of the three colors, magenta, yellow and cyan. Iterations started near this pole are equally likely to converge to each of the three zeros.\r\n<pre class=\"codeinput\">   fractals(F,Fprime,.825,1\/16,512);\r\n<\/pre>\r\n<img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/cleve\/cubic_blog3_07.png\" alt=\"\" hspace=\"5\" vspace=\"5\" \/> <img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/cleve\/cubic_blog3_08.png\" alt=\"\" hspace=\"5\" vspace=\"5\" \/>\r\n<h4>Zoom 10^6, flip colormap<a name=\"91d14c56-4a23-4ea2-b691-177621d1c3bc\"><\/a><\/h4>\r\nZoom in by almost six orders of magnitude to a point in the complex plane just above the negative real axis. We see a slightly rotated repeat of the three-way branching pattern.\r\n\r\nIt's fun to play with the colors by interchanging the role of red and blue in the default colormap, <tt>parula<\/tt>.\r\n<pre class=\"codeinput\">   z0 = -1.236425+0.189770i;\r\n   d = 50e-6;\r\n   figure(1)\r\n   colormap(fliplr(colormap));\r\n   fractals(F,Fprime,z0,d,512)\r\n   labels(<span class=\"string\">'-1.236425'<\/span>,<span class=\"string\">'0.189770'<\/span>,<span class=\"string\">'50e-6'<\/span>)\r\n<\/pre>\r\n<img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/cleve\/cubic_blog3_09.png\" alt=\"\" hspace=\"5\" vspace=\"5\" \/> <img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/cleve\/cubic_blog3_10.png\" alt=\"\" hspace=\"5\" vspace=\"5\" \/>\r\n<h4>Zoom 10^8<a name=\"c4fa3f93-a32f-4e8a-b1ac-eeffde0d3851\"><\/a><\/h4>\r\nZoom in by almost eight orders of magnitude to a point on the separator in the right half plane. We now have both three-way and four-way patterns, although they have different colors because I flipped the colormap.\r\n<pre class=\"codeinput\">   z0 = 0.73244050+1.73490150i;\r\n   d = 25e-8;\r\n   fractals(F,Fprime,z0,d,512)\r\n   labels(<span class=\"string\">'0.73244050'<\/span>,<span class=\"string\">'l.73490150'<\/span>,<span class=\"string\">'25e-8'<\/span>)\r\n<\/pre>\r\n<img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/cleve\/cubic_blog3_11.png\" alt=\"\" hspace=\"5\" vspace=\"5\" \/> <img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/cleve\/cubic_blog3_12.png\" alt=\"\" hspace=\"5\" vspace=\"5\" \/>\r\n<h4>One more<a name=\"d097fd99-799b-46c6-bb5d-ebf48f1314cd\"><\/a><\/h4>\r\nHere's my last one. Note that the iteration count has increased to at least 25. Even though Newton's method takes longer to converge, we still see the same three-way and four-way patterns of branching behavior.,\r\n<pre class=\"codeinput\">   z0 = 0.73244062+1.73490165i;\r\n   d = 4e-8;\r\n   figure(1)\r\n   colormap(copper);\r\n   fractals(F,Fprime,z0,d,512)\r\n   labels(<span class=\"string\">'0.73244062'<\/span>,<span class=\"string\">'l.73490165'<\/span>,<span class=\"string\">'4e-8'<\/span>)\r\n<\/pre>\r\n<img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/cleve\/cubic_blog3_13.png\" alt=\"\" hspace=\"5\" vspace=\"5\" \/> <img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/cleve\/cubic_blog3_14.png\" alt=\"\" hspace=\"5\" vspace=\"5\" \/>\r\n<h4>References<a name=\"93ef4fcb-aa3d-4a1a-b2a9-55388112c01a\"><\/a><\/h4>\r\nThe fractal nature of the global behavior of Newton's method is well known. If you ask Google about \"Newton fractal\", you will get many interesting links. Check out the images and movies. And if you ask about \"MATLAB Newton fractal\", you will get several interesting links, including a couple of contributions to MATLAB Central.\r\n\r\nI really enjoy fractals. I've written about <a href=\"https:\/\/www.mathworks.com\/content\/dam\/mathworks\/mathworks-dot-com\/moler\/exm\/chapters\/mandelbrot.pdf\">Mandelbrot sets<\/a> in <a href=\"https:\/\/www.mathworks.com\/moler\/exm\"><i>Experiments with MATLAB<\/i><\/a>. I also wrote a <a href=\"https:\/\/blogs.mathworks.com\/cleve\/2013\/09\/30\/iterated-powers-fractal\/\">blog post<\/a> two years ago about the fractals generated by cycles in the tower of powers function\r\n\r\n$$ z^{z^{z^z}} $$\r\n\r\n<script>\/\/ <![CDATA[\r\nfunction grabCode_d1af3608e36e44e58a1dd2fd12ddc65d() {\r\n        \/\/ Remember the title so we can use it in the new page\r\n        title = document.title;\r\n\r\n        \/\/ Break up these strings so that their presence\r\n        \/\/ in the Javascript doesn't mess up the search for\r\n        \/\/ the MATLAB code.\r\n        t1='d1af3608e36e44e58a1dd2fd12ddc65d ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' d1af3608e36e44e58a1dd2fd12ddc65d';\r\n    \r\n        b=document.getElementsByTagName('body')[0];\r\n        i1=b.innerHTML.indexOf(t1)+t1.length;\r\n        i2=b.innerHTML.indexOf(t2);\r\n \r\n        code_string = b.innerHTML.substring(i1, i2);\r\n        code_string = code_string.replace(\/REPLACE_WITH_DASH_DASH\/g,'--');\r\n\r\n        \/\/ Use \/x3C\/g instead of the less-than character to avoid errors \r\n        \/\/ in the XML parser.\r\n        \/\/ Use '\\x26#60;' instead of '<' so that the XML parser\r\n        \/\/ doesn't go ahead and substitute the less-than character. \r\n        code_string = code_string.replace(\/\\x3C\/g, '\\x26#60;');\r\n\r\n        copyright = 'Copyright 2016 The MathWorks, Inc.';\r\n\r\n        w = window.open();\r\n        d = w.document;\r\n        d.write('\r\n\r\n<pre>\\n');\r\n        d.write(code_string);\r\n\r\n        \/\/ Add copyright line at the bottom if specified.\r\n        if (copyright.length > 0) {\r\n            d.writeln('');\r\n            d.writeln('%%');\r\n            if (copyright.length > 0) {\r\n                d.writeln('% _' + copyright + '_');\r\n            }\r\n        }\r\n\r\n        d.write('<\/pre>\r\n\r\n\r\n\\n');\r\n\r\n        d.title = title + ' (MATLAB code)';\r\n        d.close();\r\n    }\r\n\/\/ ]]><\/script>\r\n<p style=\"text-align: right; font-size: xx-small; font-weight: lighter; font-style: italic; color: gray;\">\r\n<a><span style=\"font-size: x-small; font-style: italic;\">Get\r\nthe MATLAB code<noscript>(requires JavaScript)<\/noscript><\/span><\/a>\r\n\r\nPublished with MATLAB\u00ae R2015a<\/p>\r\n\r\n<\/div>\r\n<!--\r\nd1af3608e36e44e58a1dd2fd12ddc65d ##### SOURCE BEGIN #####\r\n%% Fractal Global Behavior of Newton's Method\r\n% When the starting point of Newton's method is not close to a zero of\r\n% the function, the global behavior can appear to be unpredictable.\r\n% Contour plots of iteration counts to convergence from a region of\r\n% starting points in the complex plane generate thought-provoking\r\n% fractal images.  Our examples employ the subject of two recent posts,\r\n% the historic cubic $x^3-2x-5$.\r\n\r\n%% Historic cubic\r\n% All of today's images are generated from the cubic $x^3-2x-5$\r\n% that was the subject of two previous posts,\r\n% <https:\/\/blogs.mathworks.com\/cleve\/2015\/12\/21\/a-historic-cubic\/ % a-historic-cubic> and\r\n% <https:\/\/blogs.mathworks.com\/cleve\/2016\/01\/04\/testing-zero-finders\/ % testing-zero-finders>.\r\n%\r\n% $$ F(z) = z^3-2z-5 $$\r\n\r\nF = @(z) z.^3-2*z-5;\r\n\r\n%%\r\n% Newton's method also requires the derivate.\r\n%\r\n% $$ F'(z) = 3z^2-2 $$\r\n\r\nFprime = @(z) 3*z.^2-2;\r\n\r\n%% Newton iterator\r\n% Here is the function that carries out the Newton iteration, starting at\r\n% a specified point in the complex plane.  The function returns both the\r\n% resulting zero and the count of the number of iterations required to\r\n% reach it.  These counts are the basis for the fractal images.\r\n\r\ntype newton\r\n\r\n%% View fractals\r\n% This function uses |contourf| to produce two colored contour plots.\r\n% The first shows the iteration counts for a square grid of starting\r\n% points.  The second is based on the polar angles of the computed zeros.\r\n% There are just three contour levels in the second plot, corresponding\r\n% to the three zeros of the cubic.\r\n\r\ntype fractals\r\n\r\n%% Bird's eye view\r\n% Our largest region is centered at the original and has a half-width of 30.\r\n% The complex plane is separated into thirds by rays emanating from the origin\r\n% along the negative real axis and with polar angles of $\\pm \\frac{\\pi}{3}$.\r\n% All of the fractal behavior occurs near one of these separators.\r\n\r\n%%\r\n% Iterations that do not start near a separator converge to the zero in that\r\n% starting region.  The contours filled with orange and yellow and the\r\n% associated colorbar tell us that most iterations starting at a distance\r\n% greater than 30 from the origin take at least a dozen steps to converge.\r\n\r\nfractals(F,Fprime,0,30,512)\r\n\r\n%% Zoom in at origin\r\n% Zoom in by a factor of 10.  The half-width is now 3.\r\n% The three blue contour levels where the function counts are the lowest\r\n% surround the three zeros.  This is where Newton's method works well;\r\n% start close to a zero and the iteration will converge in a few steps\r\n% to that zero.\r\n\r\n%%\r\n% The regions separating the three minima have higher iteration count and\r\n% more complicated behavior.  The derivative $F'(x) = 3x^2-2$ is equal to\r\n% zero at\r\n%\r\n% $$ x = \\pm \\sqrt{\\frac{2}{3}} \\approx \\pm 0.816$$\r\n%\r\n% The Newton iterator with $F'(x)$ in the denominator has poles at\r\n% these two points.\r\n% The second derivative $F''(x) = 6x$ is zero at the origin.\r\n% The contour plots show a four-way branching pattern at the origin\r\n% and a three-way branching pattern at the positive pole.  These two patterns\r\n% occur repeatedly at all scales in the fractal.\r\n\r\nfractals(F,Fprime,0,3,512)\r\n\r\n%% Detail at the origin.\r\n% Zoom in by another factor of 30.  The half-width is now 0.1.\r\n% We can see the four-way branching pattern in more detail.\r\n% In the second contour plot most of this region is colored either\r\n% magenta or yellow, indicating that most iterations converge to\r\n% one of the complex zeros in the left half plane.  A relatively\r\n% smaller portion is colored cyan, indicating that convergence to the zero\r\n% on the positive real axis is less frequent.\r\n\r\nfractals(F,Fprime,0,0.1,512)\r\n\r\n%% At a pole\r\n% Pan right to the pole at $x=.816$.  We see a three-way separator with\r\n% the same area for each of the three colors, magenta, yellow and cyan.\r\n% Iterations started near this pole are equally likely to converge to\r\n% each of the three zeros.\r\n\r\nfractals(F,Fprime,.825,1\/16,512);\r\n\r\n%% Zoom 10^6, flip colormap\r\n% Zoom in by almost six orders of magnitude to a point in the complex\r\n% plane just above the negative real axis.  We see a slightly rotated\r\n% repeat of the three-way branching pattern.\r\n\r\n%%\r\n% It's fun to play with the colors by interchanging the role of red and\r\n% blue in the default colormap, |parula|.\r\n\r\nz0 = -1.236425+0.189770i;\r\nd = 50e-6;\r\nfigure(1)\r\ncolormap(fliplr(colormap));\r\nfractals(F,Fprime,z0,d,512)\r\nlabels('-1.236425','0.189770','50e-6')\r\n\r\n%% Zoom 10^8\r\n% Zoom in by almost eight orders of magnitude to a point on the separator\r\n% in the right half plane.  We now have both three-way and four-way\r\n% patterns, although they have different colors because I flipped the\r\n% colormap.\r\n%\r\n\r\nz0 = 0.73244050+1.73490150i;\r\nd = 25e-8;\r\nfractals(F,Fprime,z0,d,512)\r\nlabels('0.73244050','l.73490150','25e-8')\r\n\r\n%% One more\r\n% Here's my last one.  Note that the iteration count has increased to\r\n% at least 25.  Even though Newton's method takes longer to converge,\r\n% we still see the same three-way and four-way patterns of branching\r\n% behavior.,\r\n\r\nz0 = 0.73244062+1.73490165i;\r\nd = 4e-8;\r\nfigure(1)\r\ncolormap(copper);\r\nfractals(F,Fprime,z0,d,512)\r\nlabels('0.73244062','l.73490165','4e-8')\r\n\r\n%% References\r\n% The fractal nature of the global behavior of Newton's method is well known.\r\n% If you ask Google about \"Newton fractal\", you will get many interesting\r\n% links.  Check out the images and movies.  And if you ask about \"MATLAB\r\n% Newton fractal\", you will get several interesting links, including a\r\n% couple of contributions to MATLAB Central.\r\n\r\n%%\r\n% I really enjoy fractals.  I've written about\r\n% <https:\/\/www.mathworks.com\/moler\/exm\/chapters\/mandelbrot.pdf % Mandelbrot sets> in <https:\/\/www.mathworks.com\/moler\/exm % _Experiments with MATLAB_>.  I also wrote a\r\n% <https:\/\/blogs.mathworks.com\/cleve\/2013\/09\/30\/iterated-powers-fractal\/ % blog post> two years ago about the fractals generated by cycles in\r\n% the tower of powers function\r\n%\r\n% $$ z^{z^{z^z}} $$\r\n%\r\n\r\n##### SOURCE END ##### d1af3608e36e44e58a1dd2fd12ddc65d\r\n-->","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img src=\"https:\/\/blogs.mathworks.com\/cleve\/files\/feature_image\/cubic_blog3_11.png\" class=\"img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image\" alt=\"\" decoding=\"async\" loading=\"lazy\" \/><\/div><!--introduction-->When the starting point of Newton's method is not close to a zero of the function, the global behavior can appear to be unpredictable. Contour plots of iteration counts to convergence from a region of starting points in the complex plane generate thought-provoking fractal images. Our examples employ the subject of two recent posts, the historic cubic $x^3-2x-5$.\r\n\r\n<!--\/introduction-->... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/cleve\/2016\/01\/18\/fractal-global-behavior-of-newtons-method\/\">read more >><\/a><\/p>","protected":false},"author":78,"featured_media":1322,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[11,18,5,16],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/posts\/1308"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/users\/78"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/comments?post=1308"}],"version-history":[{"count":6,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/posts\/1308\/revisions"}],"predecessor-version":[{"id":2194,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/posts\/1308\/revisions\/2194"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/media\/1322"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/media?parent=1308"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/categories?post=1308"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/tags?post=1308"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}