15 Reputation

4 Badges

1 years, 325 days

MaplePrimes Activity

These are replies submitted by MalakMMK

@Carl Love 

Hello Sir, Hope you are doing well I was woundering if would help me in that matter in which I can calculate the black points in basin of attraction as you suggested in the previous massage.

Thank you for your time and effort.

Kind regards


@Carl Love 

Thank you so so much sir I truly appreciate your time and efoort to help me thank you


No actually have not made it by myself I got help in maple prime I'm a complete begginner when it xomes to maple this why I'm trying to learn 

but as I told you before when I tried implementing 8th order method it does not work on 1D input it just keep evaluating the code forever

this why I''m working with 2D to compare more method (black points wise)

@Carl Love 

Thamk you Sir for your great help,

I have a small problem when it comes to 1D input I can only work with simple 4th order method, 

the 2D allows me it work with far more complicated method such as 8th and 16th orders

@Carl Love 

I've changed it to 8 like him 

@Carl Love 

It works perfectlu but accordiong to a the research paper in which this method is displayed , it says in z^4-2 at 8th iteration it supposed to have 1729 black pints while the code displays 3832

@Carl Love 

Forgive me sir as I'm a little beginner in Maple,

I have tried both ways the "comma equal operaror" keeps making an error in the code

and the  numelems(BlackZ); is returning zero 

@Carl Love 

The divergence point are the black points in a basins of attraction graph, in which the method is not convergant

for example this is in 8th iteration of z^4-1 , it supposed to have 1729 black points at step 0.01


Provided the code that I used to generate the images as the for loop method is proven to be easier and much faster than the prevous method my concern is only about the style.

Thank you for your time.


Is it possible to use the same approach you did by using a for loop but, 
getting a similar style to the first image because it is more explainable, this king at z^4-1, the black areas are very clear to identify and it has 4 colors, however, in the second image I'm Always getting 3 colors.

I tried doing it but the program keep running without any results.


Hello, sorry for the delay, 

This is what I'm trying to do:

I'm trying to compare multiple fourth-order method: including king's, and the one I'm currntly working on:


The following uses the Escape command from the IterativeMaps package.

It is reasonable fast (even with some relatively ineffient post-processing.

I have chosen to post-process the output data so that the coloring is
made according to the root to which the given x+y*I input point converges.

Optionally we can scale the saturation by the iteration count.

ee := z^3-1;



## For ee a polynomial we can compute all the roots.
## This is used to specify the colors, below.
rts:=[fsolve(ee)]; ##rts:=[fsolve(ee,z,complex)];
evalf[1](rts); ## evalf[1](%);





#(minr,maxr) := (min,max)(Re~(rts)):
#(mini,maxi) := (min,max)(Im~(rts)):
(minr,maxr) := -1, 1;
(mini,maxi) := -1, 1;

-1, 1


-1, 1


# One iteration of Newton's method
dee := diff(ee, z);
Newt1 := eval( z - ee/dee, z=zr+zi*I);





# One iteration of Haf's method, u is xn uu is xn1 ####### F(u)is fx and F(v) is fy
F := unapply(ee,z): dF:=D(F):
v := u - (2*F(u)/3*dF(u)): #first step
dFv := diff(F(v),u): nn := dF(u)/dFv: W := 1/6*(1+3*nn+(-4*ln(2-nn))):
uu := v - F(u)*W/dF(u)+dF(v):
Haf1 := eval(uu, [u=zr+zi*I]);



H := proc(Z,N,maxiter,{scalesaturation::truefalse:=false})
  local final,G,h,w,img,temp,temp2,newt,fzi,fzr;
  uses IterativeMaps, ImageTools;
  fzi := evalc( Im( Z ) );
  fzi := convert(simplify(fzi),horner);
  fzr := evalc( Re( subs(zi=zit, Z) ) );
  fzr := convert(simplify(fzr),horner);
  h,w := N, floor(N*(maxr-minr)/(maxi-mini));
  newt := Escape( height=h, width=w,
                       [zi, zr, zit],
                       [fzi, fzr, zi],
                       [y, x, y], evalc(abs(eval(ee,[z=zr+zit*I])))^2<1e-10,
                       2*minr, 2*maxr, 2*mini, 2*maxi,
                       iterations = maxiter,
                       redexpression = zr, greenexpression = zit, blueexpression=i );
  ## Done inefficiently, set the hue by position in the list of
  ## all roots
  if scalesaturation then
  end if;
  final := HSVtoRGB(img):
end proc:


Newtimg := H(Newt1,400,200):

# scale down the saturation by the time to converge
NewtimgS := H(Newt1,400,200,scalesaturation):


Haf1img := H(Haf1,400,200):

# scale down the saturation by the time to

Haf1imgS := H(Malak1,400,200,scalesaturation):




The Maple code only works if I set the ee value to z^2-1

and the original paper:


yes I did but he program keep running without any progress, 

it id for an academic project

1 2 Page 1 of 2