示例#1
0
          # Reset counters
          n = 0
          changew, changeb = 1,1
          # Run loop for daisy earth.
          while (n < mf.maxn) and (changew > mf.tol) and (changeb > mf.tol):
              # Store the initial cover fractions
              sw, sb = alphaw, alphab
              # Planetary albedo
              planet_albedo = mf.albedo(alphaw, alphab, alphag, mf.aw, mf.ab, mf.ag)
              # Planetary temperature
              T = mf.planetary_temp(mf.S, planet_albedo, L=L)
              # Local temperature
              Tw = mf.local_temp(planet_albedo, mf.aw, T)
              Tb = mf.local_temp(planet_albedo, mf.ab, T)
              # Birth rate
              betaw = mf.beta(Tw)
              betab = mf.beta(Tb)
              # Change in daisies
              dawdt = mf.daisy_replicator(alphaw, alphag, betaw, gamma)
              dabdt = mf.daisy_replicator(alphab, alphag, betab, gamma)
              # Integrate
              alphaw = mf.euler(alphaw, dawdt)
              alphab = mf.euler(alphab, dabdt)
              alphag = mf.p - alphaw - alphab
              n += 1
          # Store the output
          alphaw_out[i] = alphaw
          alphab_out[i] = alphab
          temp_out[i] = T

 changew, changeb = 1, 1
 # Run loop for daisy earth.
 while (n < mf.maxn) and (changew > mf.tol) and (changeb >
                                                 mf.tol):
     # Store the initial cover fractions
     sw, sb = alphaw, alphab
     # Planetary albedo
     planet_albedo = mf.albedo(alphaw, alphab, alphag, mf.aw,
                               mf.ab, mf.ag)
     # Planetary temperature
     T = mf.planetary_temp(mf.S, planet_albedo, L=L)
     # Local temperature
     Tw = mf.local_temp(planet_albedo, mf.aw, T)
     Tb = mf.local_temp(planet_albedo, mf.ab, T)
     # Birth rate
     betaw = mf.beta(Tw, optimum=w_opt)
     betab = mf.beta(Tb, optimum=b_opt)
     # Change in daisies
     dawdt = mf.daisy_replicator(alphaw, alphag, betaw,
                                 mf.gamma)
     dabdt = mf.daisy_replicator(alphab, alphag, betab,
                                 mf.gamma)
     # Integrate
     alphaw = mf.euler(alphaw, dawdt)
     alphab = mf.euler(alphab, dabdt)
     alphag = mf.p - alphaw - alphab
     n += 1
 # Store the output
 alphaw_out[i] = alphaw
 alphab_out[i] = alphab
 temp_out[i] = T