ASKSAGE: Sage Q&A Forum - Individual question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 13 Dec 2011 14:34:21 -0600Newton's cubic Math Modelinghttps://ask.sagemath.org/question/8548/newtons-cubic-math-modeling/I need to find the "black points" (where the function becomes undefined) of an equation x^3 -1 using newtons method. So the function turns out to be F(x) = x - (x^3-1)/(3x^2). Is there a way to find a majority of the points (where x is undefined as in the Newton cubic fractal photo aka the black points) using Sage?Mon, 12 Dec 2011 15:05:24 -0600https://ask.sagemath.org/question/8548/newtons-cubic-math-modeling/Comment by kcrisman for <p>I need to find the "black points" (where the function becomes undefined) of an equation x^3 -1 using newtons method. So the function turns out to be F(x) = x - (x^3-1)/(3x^2). Is there a way to find a majority of the points (where x is undefined as in the Newton cubic fractal photo aka the black points) using Sage?</p>
https://ask.sagemath.org/question/8548/newtons-cubic-math-modeling/?comment=20716#post-id-20716Can you be a little more specific? `x^3-1` is defined for all complex `x`, so I assume you are referring to something else.Tue, 13 Dec 2011 02:35:58 -0600https://ask.sagemath.org/question/8548/newtons-cubic-math-modeling/?comment=20716#post-id-20716Answer by kcrisman for <p>I need to find the "black points" (where the function becomes undefined) of an equation x^3 -1 using newtons method. So the function turns out to be F(x) = x - (x^3-1)/(3x^2). Is there a way to find a majority of the points (where x is undefined as in the Newton cubic fractal photo aka the black points) using Sage?</p>
https://ask.sagemath.org/question/8548/newtons-cubic-math-modeling/?answer=12999#post-id-12999I don't think this is a built-in behavior. I'd be interested in a reference for an algorithm, even! Basically, this would just be 0, anything whose tangent line sends it to zero, anything whose tangent line sends it to one of those, etc., right?
If you just wanted to visualize this, you could try using some of the ideas at [this ticket about Newton basins](http://trac.sagemath.org/sage_trac/ticket/11837), though it wouldn't give the "black points".
For a graphical way of exploring this, I would [search sagenb.org](http://www.sagenb.org/pub/?typ=pub&search=newton%27s+method) for implementations of Newton's method in interactive mode.
You could use `solve` to try to get some of these points, though I'm not sure how useful this would be.
sage: LA(x) = x - (x^3-1)/(3*x^2)
sage: LA(0)
---------------------------------------------------------------------------
RuntimeError: power::eval(): division by zero
sage: solve(LA==0,x)
[x == 1/4*(I*(-1)^(1/3)*sqrt(3) - (-1)^(1/3))*2^(2/3), x == 1/4*(-I*(-1)^(1/3)*sqrt(3) - (-1)^(1/3))*2^(2/3), x == 1/2*(-1)^(1/3)*2^(2/3)]
sage: S = solve(LA==0,x)
sage: for s in S:
solve(LA == s.rhs(),x)
....:
[x == -1/576*(-18*I*sqrt(3) - 18)*(-I*sqrt(3) + 1)*2^(1/3)/(1/8*sqrt(6) - 5/16)^(1/3) + 1/24*(3*I*sqrt(3) - 3)*(-1)^(1/3)*2^(2/3) - 1/2*(1/8*sqrt(6) - 5/16)^(1/3)*(I*sqrt(3) + 1), x == -1/576*(-18*I*sqrt(3) - 18)*(I*sqrt(3) + 1)*2^(1/3)/(1/8*sqrt(6) - 5/16)^(1/3) + 1/24*(3*I*sqrt(3) - 3)*(-1)^(1/3)*2^(2/3) - 1/2*(1/8*sqrt(6) - 5/16)^(1/3)*(-I*sqrt(3) + 1), x == 1/24*(3*I*sqrt(3) - 3)*(-1)^(1/3)*2^(2/3) + 1/288*(-18*I*sqrt(3) - 18)*2^(1/3)/(1/8*sqrt(6) - 5/16)^(1/3) + (1/8*sqrt(6) - 5/16)^(1/3)]
[x == -1/576*(-I*sqrt(3) + 1)*(18*I*sqrt(3) - 18)*2^(1/3)/(1/8*sqrt(6) - 5/16)^(1/3) - 1/24*(3*I*sqrt(3) + 3)*(-1)^(1/3)*2^(2/3) - 1/2*(1/8*sqrt(6) - 5/16)^(1/3)*(I*sqrt(3) + 1), x == -1/576*(I*sqrt(3) + 1)*(18*I*sqrt(3) - 18)*2^(1/3)/(1/8*sqrt(6) - 5/16)^(1/3) - 1/24*(3*I*sqrt(3) + 3)*(-1)^(1/3)*2^(2/3) - 1/2*(1/8*sqrt(6) - 5/16)^(1/3)*(-I*sqrt(3) + 1), x == -1/24*(3*I*sqrt(3) + 3)*(-1)^(1/3)*2^(2/3) + 1/288*(18*I*sqrt(3) - 18)*2^(1/3)/(1/8*sqrt(6) - 5/16)^(1/3) + (1/8*sqrt(6) - 5/16)^(1/3)]
[x == -1/2*(I*sqrt(3) + 1)*(1/8*sqrt(2)*sqrt(3) - 5/16)^(1/3) - 1/16*(-I*sqrt(3) + 1)*2^(1/3)/(1/8*sqrt(2)*sqrt(3) - 5/16)^(1/3) + 1/4*(-1)^(1/3)*2^(2/3), x == -1/2*(-I*sqrt(3) + 1)*(1/8*sqrt(2)*sqrt(3) - 5/16)^(1/3) - 1/16*(I*sqrt(3) + 1)*2^(1/3)/(1/8*sqrt(2)*sqrt(3) - 5/16)^(1/3) + 1/4*(-1)^(1/3)*2^(2/3), x == 1/4*(-1)^(1/3)*2^(2/3) + (1/8*sqrt(2)*sqrt(3) - 5/16)^(1/3) + 1/8*2^(1/3)/(1/8*sqrt(2)*sqrt(3) - 5/16)^(1/3)]Tue, 13 Dec 2011 03:25:47 -0600https://ask.sagemath.org/question/8548/newtons-cubic-math-modeling/?answer=12999#post-id-12999Comment by kcrisman for <div class="snippet"><p>I don't think this is a built-in behavior. I'd be interested in a reference for an algorithm, even! Basically, this would just be 0, anything whose tangent line sends it to zero, anything whose tangent line sends it to one of those, etc., right?</p>
<p>If you just wanted to visualize this, you could try using some of the ideas at <a href="http://trac.sagemath.org/sage_trac/ticket/11837">this ticket about Newton basins</a>, though it wouldn't give the "black points".</p>
<p>For a graphical way of exploring this, I would <a href="http://www.sagenb.org/pub/?typ=pub&search=newton%27s+method">search sagenb.org</a> for implementations of Newton's method in interactive mode.</p>
<p>You could use <code>solve</code> to try to get some of these points, though I'm not sure how useful this would be.</p>
<pre><code>sage: LA(x) = x - (x^3-1)/(3*x^2)
sage: LA(0)
---------------------------------------------------------------------------
RuntimeError: power::eval(): division by zero
sage: solve(LA==0,x)
[x == 1/4*(I*(-1)^(1/3)*sqrt(3) - (-1)^(1/3))*2^(2/3), x == 1/4*(-I*(-1)^(1/3)*sqrt(3) - (-1)^(1/3))*2^(2/3), x == 1/2*(-1)^(1/3)*2^(2/3)]
sage: S = solve(LA==0,x)
sage: for s in S:
solve(LA == s.rhs(),x)
....:
[x == -1/576*(-18*I*sqrt(3) - 18)*(-I*sqrt(3) + 1)*2^(1/3)/(1/8*sqrt(6) - 5/16)^(1/3) + 1/24*(3*I*sqrt(3) - 3)*(-1)^(1/3)*2^(2/3) - 1/2*(1/8*sqrt(6) - 5/16)^(1/3)*(I*sqrt(3) + 1), x == -1/576*(-18*I*sqrt(3) - 18)*(I*sqrt(3) + 1)*2^(1/3)/(1/8*sqrt(6) - 5/16)^(1/3) + 1/24*(3*I*sqrt(3) - 3)*(-1)^(1/3)*2^(2/3) - 1/2*(1/8*sqrt(6) - 5/16)^(1/3)*(-I*sqrt(3) + 1), x == 1/24*(3*I*sqrt(3) - 3)*(-1)^(1/3)*2^(2/3) + 1/288*(-18*I*sqrt(3) - 18)*2^(1/3)/(1/8*sqrt(6) - 5/16)^(1/3) + (1/8*sqrt(6) - 5/16)^(1/3)]
[x == -1/576*(-I*sqrt(3) + 1)*(18*I*sqrt(3) - 18)*2^(1/3)/(1/8*sqrt(6) - 5/16)^(1/3) - 1/24*(3*I*sqrt(3) + 3)*(-1)^(1/3)*2^(2/3) - 1/2*(1/8*sqrt(6) - 5/16)^(1/3)*(I*sqrt(3) + 1), x == -1/576*(I*sqrt(3) + 1)*(18*I*sqrt(3) - 18)*2^(1/3)/(1/8*sqrt(6) - 5/16)^(1/3) - 1/24*(3*I*sqrt(3) + 3)*(-1)^(1/3)*2^(2/3) - 1/2*(1/8*sqrt(6) - 5/16)^(1/3)*(-I*sqrt(3) + 1), x == -1/24*(3*I*sqrt(3) + 3)*(-1)^(1/3)*2^(2/3) + 1/288*(18*I*sqrt(3) - 18)*2^(1/3)/(1/8*sqrt(6) - 5/16)^(1/3) + (1/8*sqrt(6) - 5/16)^(1/3)]
[x == -1/2*(I*sqrt(3) + 1)*(1/8*sqrt(2)*sqrt(3) - 5/16)^(1/3) - 1/16*(-I*sqrt(3) + 1)*2 ...</code></pre><span class="expander"> <a>(more)</a></span></div>https://ask.sagemath.org/question/8548/newtons-cubic-math-modeling/?comment=20712#post-id-20712You may find `http://en.wikipedia.org/wiki/Newton_fractal` useful as well - basically, you're looking for a Julia set, and you might find algorithms for finding those out there.Tue, 13 Dec 2011 14:34:21 -0600https://ask.sagemath.org/question/8548/newtons-cubic-math-modeling/?comment=20712#post-id-20712Comment by rower9911 for <div class="snippet"><p>I don't think this is a built-in behavior. I'd be interested in a reference for an algorithm, even! Basically, this would just be 0, anything whose tangent line sends it to zero, anything whose tangent line sends it to one of those, etc., right?</p>
<p>If you just wanted to visualize this, you could try using some of the ideas at <a href="http://trac.sagemath.org/sage_trac/ticket/11837">this ticket about Newton basins</a>, though it wouldn't give the "black points".</p>
<p>For a graphical way of exploring this, I would <a href="http://www.sagenb.org/pub/?typ=pub&search=newton%27s+method">search sagenb.org</a> for implementations of Newton's method in interactive mode.</p>
<p>You could use <code>solve</code> to try to get some of these points, though I'm not sure how useful this would be.</p>
<pre><code>sage: LA(x) = x - (x^3-1)/(3*x^2)
sage: LA(0)
---------------------------------------------------------------------------
RuntimeError: power::eval(): division by zero
sage: solve(LA==0,x)
[x == 1/4*(I*(-1)^(1/3)*sqrt(3) - (-1)^(1/3))*2^(2/3), x == 1/4*(-I*(-1)^(1/3)*sqrt(3) - (-1)^(1/3))*2^(2/3), x == 1/2*(-1)^(1/3)*2^(2/3)]
sage: S = solve(LA==0,x)
sage: for s in S:
solve(LA == s.rhs(),x)
....:
[x == -1/576*(-18*I*sqrt(3) - 18)*(-I*sqrt(3) + 1)*2^(1/3)/(1/8*sqrt(6) - 5/16)^(1/3) + 1/24*(3*I*sqrt(3) - 3)*(-1)^(1/3)*2^(2/3) - 1/2*(1/8*sqrt(6) - 5/16)^(1/3)*(I*sqrt(3) + 1), x == -1/576*(-18*I*sqrt(3) - 18)*(I*sqrt(3) + 1)*2^(1/3)/(1/8*sqrt(6) - 5/16)^(1/3) + 1/24*(3*I*sqrt(3) - 3)*(-1)^(1/3)*2^(2/3) - 1/2*(1/8*sqrt(6) - 5/16)^(1/3)*(-I*sqrt(3) + 1), x == 1/24*(3*I*sqrt(3) - 3)*(-1)^(1/3)*2^(2/3) + 1/288*(-18*I*sqrt(3) - 18)*2^(1/3)/(1/8*sqrt(6) - 5/16)^(1/3) + (1/8*sqrt(6) - 5/16)^(1/3)]
[x == -1/576*(-I*sqrt(3) + 1)*(18*I*sqrt(3) - 18)*2^(1/3)/(1/8*sqrt(6) - 5/16)^(1/3) - 1/24*(3*I*sqrt(3) + 3)*(-1)^(1/3)*2^(2/3) - 1/2*(1/8*sqrt(6) - 5/16)^(1/3)*(I*sqrt(3) + 1), x == -1/576*(I*sqrt(3) + 1)*(18*I*sqrt(3) - 18)*2^(1/3)/(1/8*sqrt(6) - 5/16)^(1/3) - 1/24*(3*I*sqrt(3) + 3)*(-1)^(1/3)*2^(2/3) - 1/2*(1/8*sqrt(6) - 5/16)^(1/3)*(-I*sqrt(3) + 1), x == -1/24*(3*I*sqrt(3) + 3)*(-1)^(1/3)*2^(2/3) + 1/288*(18*I*sqrt(3) - 18)*2^(1/3)/(1/8*sqrt(6) - 5/16)^(1/3) + (1/8*sqrt(6) - 5/16)^(1/3)]
[x == -1/2*(I*sqrt(3) + 1)*(1/8*sqrt(2)*sqrt(3) - 5/16)^(1/3) - 1/16*(-I*sqrt(3) + 1)*2 ...</code></pre><span class="expander"> <a>(more)</a></span></div>https://ask.sagemath.org/question/8548/newtons-cubic-math-modeling/?comment=20713#post-id-20713thanks. i appreciate your help. I'm still looking for an algorithm but cant seem to come up with anything!Tue, 13 Dec 2011 13:23:42 -0600https://ask.sagemath.org/question/8548/newtons-cubic-math-modeling/?comment=20713#post-id-20713