# prize35-9 Exercise 1: primary versus secondary succession in the stage model move = [0.30, 0.20, 0.10, 0.04] def first_years(start): share = start[:] year, half, bare = 0, None, None while half is None or bare is None: if half is None and share[4] >= 0.5: half = year if bare is None and share[0] < 0.01: bare = year new = share[:] for i, m in enumerate(move): flow = share[i] * m new[i] -= flow new[i + 1] += flow share = new year += 1 if year > 1000: break return half, bare primary = first_years([1.0, 0.0, 0.0, 0.0, 0.0]) # bare ground, no soil secondary = first_years([0.0, 1.0, 0.0, 0.0, 0.0]) # grass already growing, soil intact print("primary: mature wood reaches 50% in year", primary[0], "; bare ground under 1% in year", primary[1]) print("secondary: mature wood reaches 50% in year", secondary[0], "; bare ground under 1% in year", secondary[1]) print("secondary is", primary[0] - secondary[0], "years faster to reach half mature wood") # Output: # primary: mature wood reaches 50% in year 37 ; bare ground under 1% in year 13 # secondary: mature wood reaches 50% in year 34 ; bare ground under 1% in year 0 # secondary is 3 years faster to reach half mature wood # Reading it: with the same stage rates, starting from grass saves only 3 years, because the model keeps every stage's speed the same. # In real secondary succession the early stages are often much quicker, since soil, roots and seeds survive. Primary succession must first build soil, which can take far longer. # These rates are invented, so treat the years as a demonstration of the method, not a forecast.