Kernel: Python 3 (system-wide)
In [1]:
from tqdm import tqdm import matplotlib.pyplot as plt import numpy as np #se puede jugaer con las variables def LogisticMap(): mu = np.arange(0, 2, 0.0001) #defini b como mu, entonces le coloque los parametros a = 0.1 #le di el valor que me toco para a c = 14 #mi valor de c x = 10.25 iters = 100 # Número de iteraciones sin salida last = 100 # Finalmente dibuje el número de iteraciones del resultado for i in tqdm(range(iters+last)): x = (x/a) + (mu/(x - c)) #la ecuacion remplazando z e y con sus derivadas if i >= iters: plt.plot(mu, x, ',k', alpha=0.5) # alphaSet transparencia plt.show() LogisticMap()
Out[1]:
100%|██████████| 200/200 [00:00<00:00, 379.85it/s]
In [3]:
import numpy as np import matplotlib.pyplot as plt def Roessler(x, y, z, a=0.1, b=0.1, c=14): x_dot = -y - z y_dot = x + a*y z_dot = b + z*(x - c) return x_dot, y_dot, z_dot dt = 0.01 num_steps = 10000 xs = np.empty(num_steps + 1) ys = np.empty(num_steps + 1) zs = np.empty(num_steps + 1) xs[0], ys[0], zs[0] = (0., 2., 1.) for i in range(num_steps): x_dot, y_dot, z_dot = Roessler(xs[i], ys[i], zs[i]) xs[i + 1] = xs[i] + (x_dot * dt) ys[i + 1] = ys[i] + (y_dot * dt) zs[i + 1] = zs[i] + (z_dot * dt) ax = plt.figure().add_subplot(projection='3d') ax.plot(xs, ys, zs, lw=1.) ax.set_xlabel("X") ax.set_ylabel("Y") ax.set_zlabel("Z") ax.set_title("Roessler") plt.show()
Out[3]:
In [0]:
#si buscas en internet vas encontrar que el atractor de roessler debe verse asi, yo tome los codigos del atractor de lorenz para sacar este, por lo menos en mi informe usare ambos