All pastes #443375 Raw Edit

Mine

public text v1 · immutable
·published 2007-04-16 19:36 UTC
rendered paste body
     pop   profit      APs
       1     5116      218
      11    51276      218
      21    97436      218
      31   143596      218
      41   189756      436
      51   235916      436
      61   282076      436
      71   328236      436
      81   374396      654
      91   420556      654
     101   466716      654
     111   512876      654
     121   559036      872
     131   605196      872
     141   651356      872
     151   697516      872
     161   743676     1090
     171   789836     1090
     181   835996     1090
     191   882156     1090
     201   928316     1308
     211   974476     1308
     221  1020636     1308
     231  1066796     1308
     241  1112956     1526
     251  1159116     1526
     261  1205276     1526
     271  1251436     1744
     281  1297596     1744
     291  1343756     1744
     301  1389916     1744
     311  1436076     1962
     321  1482236     1962
     331  1528396     1962
     341  1574556     1962
     351  1620716     2180
     361  1666876     2180
     371  1713036     2180
     381  1759196     2180
     391  1805356     2398
     401  1851516     2398
     411  1897676     2398
     421  1943836     2398
     431  1989996     2616
     441  2036156     2616
     451  2082316     2616
     461  2128476     2616
     471  2174636     2834
     481  2220796     2834
     491  2266956     2834


----
import math

round_trip_cost = 104*2+10
cargo_capacity = 203
food_price = 34
water_price = 23
energy_price = 100

subsidy = 250

print '%8s %8s %8s'%('pop', 'profit', 'APs')

for pop in range(1, 500, 10):
  upkeep_cost = pop*(3*food_price+2*water_price-5.25*energy_price)
  profit = pop*200-upkeep_cost+subsidy/4.
  trips = math.ceil(pop*5.25/cargo_capacity)
  ap = round_trip_cost*trips

  print '%8d %8d %8d'%(pop, profit*8, ap)