Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. restart;
  2. with(IterativeMaps):
  3. form := z - z^2;
  4.  
  5. 2
  6. form := -z + z
  7.  
  8. z := subs(z=zr+zi*I, form):
  9. fzi := evalc( Im( z ) );
  10.  
  11. fzi := -2 zi zr + zi
  12.  
  13. fzr := evalc( Re( subs(zi=zitemp, z) ) );
  14.  
  15. 2 2
  16. fzr := zitemp - zr + zr
  17.  
  18. julia_img := CodeTools:-Usage(
  19. Escape( [zi , zr , zitemp , zrsqr , zisqr],
  20. [fzi , fzr , zi , zr^2 , zi^2 ],
  21. [y , x , y , x^2 , y^2 ],
  22. zrsqr+zisqr > 250,
  23. -1.0, 2.0, -1.5, 1.5,
  24. iterations = 30,
  25. height=600, width=600 ) ):
  26.  
  27. memory used=20.41MiB, alloc change=46.80MiB, cpu time=656.00ms,
  28. real time=285.00ms, gc time=0ns
  29.  
  30. with(ImageTools):
  31. FitIntensity(julia_img, inplace):
  32. Embed(julia_img);
  33.  
  34. restart;
  35. form := z - z^2;
  36.  
  37. 2
  38. -z + z
  39.  
  40. update := op(evalc([Re,Im](subs(z=re+im*I, form))));
  41.  
  42. 2 2
  43. update := im - re + re, -2 im re + im
  44.  
  45. JuliaSet := subs(__dummy=update,
  46. proc(a, b)
  47. local re, im, resq, imsq, m;
  48. (re, im) := (a, b):
  49. resq := re^2:
  50. imsq := im^2;
  51. for m to 30 while resq+imsq < 250 do
  52. (re,im) := __dummy;
  53. resq := re^2;
  54. imsq := im^2;
  55. end do;
  56. return m;
  57. end proc):
  58.  
  59. CodeTools:-Usage(
  60. plots:-densityplot(JuliaSet, -1.0..2.0, -1.5..1.5,
  61. colorstyle=HUE, grid=[600, 600],
  62. style=patchnogrid, axes=none,
  63. size=[600,600]) );
  64.  
  65. memory used=4.93GiB, alloc change=8.24MiB, cpu time=25.88s,
  66. real time=25.90s, gc time=5.32s
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement