fork/numbat
git clone https://git.julia.blue/fork/numbat
c354c09
v1.6.3
1# Hot Banana 2# 3# I heard that bananas are radioactive. If they are radioactive, then 4# they radiate energy. How many bananas would you need to power a house? 5# 6# https://what-if.xkcd.com/158/ 7 8# Bananas contain Potassium-40 with the following properties: 9 10let halflife: Time = 1.25 billion years 11let molar_mass: MolarMass = 40 g / mol 12 13# 40-K has a natural occcurence of 14 15let occurence_40K = 0.0117% 16 17# We can now compute the radioactivity of natural potassium 18 19let decay_rate: Activity = ln(2) / halflife 20 21let radioactivity: Activity / Mass = 22 N_A × occurence_40K × decay_rate / molar_mass -> Bq / g 23 24print("Radioactivity of potassium: {radioactivity}") 25 26# Next, we come to bananas 27 28@aliases(bananas) 29unit banana 30 31# https://fdc.nal.usda.gov/fdc-app.html#/food-details/173944/nutrients 32 33let potassium_per_banana = 451 mg / banana 34 35let radioactivity_banana: Activity / Banana = 36 potassium_per_banana × radioactivity -> Bq / banana 37 38print("Radioactivity of a banana: {radioactivity_banana}") 39 40# A single 40-K decay releases an energy of 41# (https://commons.wikimedia.org/wiki/File:Potassium-40-decay-scheme.svg) 42 43let energy_per_decay: Energy = 11 percent × 1.5 MeV + 89 percent × 1.3 MeV 44 45# Finally: how many bananas do we need to power a single household? 46 47let power_per_banana: Power / Banana = 48 radioactivity_banana × energy_per_decay -> pW / banana 49 50print("Power per banana: {power_per_banana}") 51 52unit household 53 54let power_consumption_household: Power / Household = 55 3000 kWh per household per year 56 57let bananas_per_household = 58 power_consumption_household / power_per_banana -> bananas / household 59 60print("Bananas per household: {bananas_per_household}") 61 62# TODO: https://what-if.xkcd.com/158/ says this number should be around 63# 300 quadrillion, but we only get 0.1 quadrillion. 300 quadrillion 64# times "a couple of picowatt" would be an average power consumption of 65# at least 300 kW / household, which seems … excessive.