Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- import matplotlib.pyplot as plt
- def logistic_map(r, x):
- return r * x * (1 - x)
- logistic_map_vec = np.vectorize(logistic_map)
- r_values = np.linspace(2, 4, 1000)
- iterations = 1000
- last = 100
- x = 1e-5 * np.ones(len(r_values))
- fig, ax = plt.subplots(figsize=(10, 7))
- for i in range(iterations):
- x = logistic_map_vec(r_values, x)
- if i >= (iterations - last):
- ax.plot(r_values, x, ',k', alpha=.25)
- ax.set_xlim(2, 4)
- ax.set_title("Бифуркационная диаграмма для логистической карты")
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement