Skip to content

Commit 50fb7b0

Browse files
committed
more perturbing
1 parent 6c413c4 commit 50fb7b0

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

parameters/perturb.jl

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
using GLMakie
2+
include("MandelbrotSet.jl")
3+
4+
function newtriple(X,(A,B,C))
5+
newA = 2*X*A+1
6+
newB = 2*X*B + A^2
7+
newC = 2*X*C + 2*A*B
8+
return (newA,newB,newC)
9+
end
10+
11+
function coefs(X)
12+
list = []
13+
(A,B,C) = (1,0,0)
14+
for x in X
15+
push!(list,(A,B,C))
16+
(A,B,C) = newtriple(x,(A,B,C))
17+
end
18+
push!(list,(A,B,C))
19+
return list
20+
end
21+
22+
function perturb(X,coefs,delta)
23+
delta2 = delta^2
24+
delta3 = delta^3
25+
for (ii,x) in enumerate(zip(X,coefs))
26+
(A,B,C) = x[2]
27+
Y = x[1]+delta*A + delta2*B + delta3*C
28+
if abs2(Y)>4
29+
return (ii,Y)
30+
end
31+
end
32+
return (NaN,Y)
33+
end
34+
35+
pilot = [0.0+1.0im]
36+
for ii in 1:100
37+
push!(pilot,pilot[end]^2+pilot[1])
38+
end
39+
40+
C = coefs(pilot)
41+
42+
rightcenterdelta = 0.00001+0.000001im
43+
44+
patch = julia_patch(0.0+0.0im,rightcenterdelta)
45+
46+
PA = [(pilot,C,delta) for delta in patch]
47+
48+
results = [perturb(stuff...) for stuff in PA]
49+
50+
pic = [x[1] for x in results]
51+
52+
heatmap(pic,nan_color = RGBAf(0,0,0,1),colormap = :PRGn_9)

0 commit comments

Comments
 (0)