Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkusHoltmanns authored Oct 2, 2023
1 parent 0478f32 commit 83f957e
Show file tree
Hide file tree
Showing 2 changed files with 235 additions and 8 deletions.
60 changes: 55 additions & 5 deletions StrangeAttractors.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@



char = "JJICKAFXIOXFVGOCIDNIVRPSFYPFGABXKKONQWPAMJGKAGXDBBWFHGXBTPNVD" # "EWM?MPMMWMMMM" #"EZPMSGCNFRENG" #"AXBH"
char = "VMMKMRMREPCPYAFRGJBOTPHNQRFXVNSNYQVJNBXXPKRPVHFQAFGFSTHYFKCIDWXOQJAKRFKHPYHNENTDQLJMQGMXTFPBDFUIPAIODWYAMTXJDIWGERTHDOKWFXPLSWFYPXNQMNOBKILSG" # "VHETJPMKNMHQNUVBIOTFADJUXXIQRSGDSNXAGNEKPMCJRIDEHOFTVTPLWUFLNDCWLKHXKKELUMBDOHSIBSDEWWSPLQVMWLQERMCANDUBCXULQWYGOTLGLLQFSJGVQEUIEQQXXWGEKVTPA" # "UBLFBKKFNATJVTJUKJFGALBIPQHVRUMAROTNVHBLAQVSHVHRGLFJAAABFRJFW" # "JJICKAFXIOXFVGOCIDNIVRPSFYPFGABXKKONQWPAMJGKAGXDBBWFHGXBTPNVD" # "EWM?MPMMWMMMM" #"EZPMSGCNFRENG" #"AXBH"
print(char)
dimension = 0
type_of_attractor = None
torus = False # True
if torus ==True:
print("Torus from a .", end='')

if char[0] == "A" or char[0] =="B" or char[0] =="C" or char[0] =="D":
dimension = 1
if char[0] == "A":
Expand Down Expand Up @@ -53,6 +57,46 @@
if char[0] == "L":
type_of_attractor = "quintic"
print("3D "+type_of_attractor+" map.")
if char[0] == "M" or char[0] =="N" or char[0] =="O" or char[0] =="P":
dimension = 4
if char[0] == "M":
type_of_attractor = "quadratic"
if char[0] == "N":
type_of_attractor = "cubic"
if char[0] == "O":
type_of_attractor = "quartic"
if char[0] == "P":
type_of_attractor = "quintic"
print("4D "+type_of_attractor+" map.")
if char[0] == "Q" or char[0] =="R" or char[0] =="S" or char[0] =="T":
dimension = 3
if char[0] == "Q":
type_of_attractor = "quadratic"
if char[0] == "R":
type_of_attractor = "cubic"
if char[0] == "S":
type_of_attractor = "quartic"
if char[0] == "T":
type_of_attractor = "quintic"
print("3D "+type_of_attractor+" ODE.")
if char[0] == "U" or char[0] =="V" or char[0] =="W" or char[0] =="X":
dimension = 4
if char[0] == "U":
type_of_attractor = "quadratic ODE"
if char[0] == "V":
type_of_attractor = "cubic ODE"
if char[0] == "W":
type_of_attractor = "quartic ODE"
if char[0] == "X":
type_of_attractor = "quintic ODE"
print("4D "+type_of_attractor+".")
if char[0] == "Y" or char[0] =="Z" or char[0] =="[":
dimension = 3
print("3D modulus map.")
if char[0] =="\\"or char[0] =="]"or char[0] =="^":
dimension = 3
print("3D trigonometrical map.")


stop = 1
run = 0
Expand All @@ -61,15 +105,18 @@
x = random.uniform(-0.1,0.1)
y = random.uniform(-0.1,0.1)
z = random.uniform(-0.1,0.1)
variables = (x,y,z)
w = random.uniform(-0.1,0.1)
variables = (x,y,z,w)
x_vals = []
y_vals = []
z_vals = []
w_vals = []
i = 0
n = 100000
n = 50000
n_temp = n
dt = 0.01
while i < n_temp:
variables = functions.function(char,variables)
variables = functions.function(char,variables,dt)
conditions = 0
if dimension >= 1:
x_vals.append( variables[0])
Expand All @@ -80,6 +127,9 @@
if dimension >= 3:
z_vals.append( variables[2])
conditions = conditions + z_vals[i]*z_vals[i]
if dimension >= 4:
w_vals.append( variables[3])
conditions = conditions + w_vals[i]*w_vals[i]
#print(x_vals[i],y_vals[i],z_vals[i])

i=i+1
Expand All @@ -100,7 +150,7 @@
new_string = "SABOOK-Code: "+char
plt.text(0, 1.75, s="\n".join(wrap(new_string)),fontsize=5, horizontalalignment="center")

if dimension == 3:
if dimension >= 3:
fig = plt.figure(dpi = 250)
ax = fig.add_subplot(1, 1, 1, projection='3d')
ax.scatter(x_vals, y_vals, z_vals, s = 0.05, facecolors = 'blue', edgecolors = 'none')
Expand Down
Loading

0 comments on commit 83f957e

Please sign in to comment.