Accuracy in mandelbrot set

5 vues (au cours des 30 derniers jours)
Peter
Peter le 5 Août 2015
Hi all,
I'm trying to write a matlab file which allows me to find nice coordinates in the mandelbrot set (see below). It works fine but if use it to zoom in to much, the images become very pixelated. My guess is that matlab should use more accurate numbers, but i can't seem to manage to solve the problem. You can duplicate my result by running the program below. It will give you the mandelbrot set and a option to click somewhere. It will then zoom in on that point. If you do this 21 times you will clearly see that the image becomes a bit "blurry" (see attached image)
So here is the code:
if true
zoomfactor=4;
middle=-.7;
resolution=300;
startsize=5;
x=gpuArray.linspace(-startsize/2, startsize/2, resolution);
y=gpuArray.linspace(-startsize/2, startsize/2, resolution);
[X,Y]=meshgrid(x,y);
Max=2;
figure(1)
for m=0:inf
iterations=round(zoomfactor^(.12*m)*100);
Z0=(X-1i*Y)*zoomfactor^(-m)+middle;
Z=zeros(size(Z0));
B=gpuArray.zeros(size(Z0));
for n=1:iterations
Z=Z.^2+Z0;
B=B+(abs(Z)<Max);
end
B=log(B);
imagesc(B)
axis off
[a,b]=ginput(1);
end
end
Does any of you know a way to solve this problem (without making the program ridiculously slow).
Thanks in advance, Peter
edit: I've done some more searching, and i've found that the error starts occurring at zooms of factor 10^15 (or looking at the 15th decimal). Apparently matlab doesn't compute the decimals beyond this point (this is double precision). Is there any way to get around this? I tried using vpa() but this slowed down my program significantly. I have looked around the forum and several other people have simular problems regarding the accuracy of matlab. I can however find animations of mandelbrot zoom on the internet which go much further than where i can go, does anybody know how this could be achieved?
Thanks!

Réponses (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by