English: A replication of Figure 13 of Chaos in biological systems
LF Olsen, H Degn - Quarterly reviews of biophysics, 1985
Reproduced and discussed in Strogatz Nonlinear Dynamics (2nd edition), Figure 10.6.7
```python
import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import solve_ivp
def rossler_system(t, xyz, a, b, c):
x, y, z = xyz
dx_dt = -y - z
dy_dt = x + a * y
dz_dt = b + z * (x - c)
return [dx_dt, dy_dt, dz_dt]
- Rossler system parameters
a = 0.2
b = 0.2
c = 5
- Initial conditions
xyz0 = [1.0, 1.0, 1.0]
tmin, tmax = 0, 10000
t_span = [tmin, tmax]
t_eval = np.linspace(t_span[0], t_span[1], (tmax-tmin) * t_resolution)
solution = solve_ivp(rossler_system, t_span, xyz0, args=(a, b, c), t_eval=t_eval)
x, y, z = solution.y
def find_local_maxima(arr):
local_maxima = []
for i in range(1, len(arr) - 1):
if arr[i - 1] < arr[i] > arr[i + 1]:
local_maxima.append(arr[i])
return local_maxima
local_maxima = find_local_maxima(x)
x = local_maxima[10:-1]
y = local_maxima[11:]
z = np.polyfit(x, y, 5)
p = np.poly1d(z)
fig, ax = plt.subplots(figsize=(8, 6))
ax.scatter(local_maxima[10:-1], local_maxima[11:], s=0.01)
ax.plot(sorted(x), p(sorted(x)), color='red', linewidth=0.2)
ax.set_xlabel("$x_{max}(n)$")
ax.set_ylabel("$x_{max}(n+1)$")
ax.set_title(f"Lorenz map for the Rössler attractor, with $a={a}, b={b}, c={c}$")
plt.show()
```