# Dynamic Systems – How can I calculate the fig tree constant?

So I'm trying to calculate the fig tree constant for the logistics map: $$x_ {n + 1} = 4 lambda x_n (1-x_n)$$
I'm writing this through Python and the most important parts I have for my code are:

``````def logistic (L, x):
Return 4 * L * x * (1-x)
n = 1000
Iterations = 1000
hold = 500
L = np.linspace (0,4,1,0, n)
x = 1e-4 * np.ones (n)
for me within reach (iterations):
x = logistics (L, x)

if i> = (iterations - keep):
pl.plot (L, x, & # 39; k & # 39 ;, marker size = 0.1)
``````

At the moment I only have the packages numpy and matplotlib imported into my code.

So that gives me a nice bifurcation diagram, but I was curious how I could calculate Feigenbaum's constant from it. I know I can go through region by region and manually calculate the sections where the period doubles, but I want to be able to do something more robust. I read on Wikipedia that the fig tree constant can be calculated from: $$frac { lambda_ {n-1} – lambda_ {n-2}} { lambda_ {n-1} – lambda_ {n}}$$ for the periods of period doubling. But from the current code that I have already set up, I can only think by manual calculation. Suggestions would be very grateful.