#/usr/bin/perl use strict; use warnings; # Teapot warming with various splits of water from 10 to 200 ml # # wild assumptions: # pot and warming fraction are allowed to reach equilibrium temperature # pot heat loss between warmings is just a random guess # pot specific heat capacity is a wild guess # warming water is always 100 Celsius # entire pot is one temperature # temperatures handled in Celsius not Kelvin, assume this makes no odds # assumed heat capacities are linear # # heat capacity joules per Kelvin for 1 teapot or 1 gram water my %hc = ( pot => 1500, water => 4.2 ); my \$T_env = 20; # Celsius my \$T_water = 100; # Celsius my \$total_water = 1500; # ml my \$cool_factor = 0.05; { printf "********** the evil of an unwarmed pot ... "; my \$T_tea = warm_pot( \$T_env, \$total_water, ); printf "temp tea: %5.2fC ********** \n\n", \$T_tea; } for my \$warming_water ( 1 .. 10 ) { \$warming_water *= 10; my \$T_pot = \$T_env; # we split the water into various fractions my \$max_step = 4; for my \$split ( 1 .. \$max_step ) { my \$ml = \$warming_water / \$split; printf "warming with \$warming_water in %2i steps (%5.1f water each step) ", \$split, \$ml; for ( 1 .. \$split ) { \$T_pot = warm_pot( \$T_pot, \$ml ); print "."; } print " " x ( 1 + \$max_step - \$split ); printf "warmed pot: %5.2fC ", \$T_pot; \$T_pot = cools(\$T_pot); # now throw in 1500 ml hot water my \$T_tea = warm_pot( \$T_pot, \$total_water - \$warming_water, ); printf "temp tea: %5.2fC\n", \$T_tea; } print \$/; } sub warm_pot { my \$T_pot = shift; my \$ml_h2o = shift; my \$total_joules = \$T_pot * \$hc{pot} + \$ml_h2o * \$hc{water} * \$T_water; my \$total_heat_capacity = \$hc{pot} + \$ml_h2o * \$hc{water}; return \$total_joules / \$total_heat_capacity; } sub cools { my \$T_pot = shift; my \$delta_T = \$T_pot - \$T_env; return \$T_pot - ( \$delta_T * \$cool_factor ); } ##```## ********** the evil of an unwarmed pot ... initial temp tea: 84.62C ********** using 10ml in 1 steps 10.0 water each . warmed pot: 22.18C temp tea: 84.93C using 10ml in 2 steps 5.0 water each .. warmed pot: 24.21C temp tea: 85.30C using 10ml in 3 steps 3.3 water each ... warmed pot: 26.09C temp tea: 85.65C using 10ml in 4 steps 2.5 water each .... warmed pot: 27.82C temp tea: 85.97C . . . using 60ml in 1 steps 60.0 water each . warmed pot: 31.51C temp tea: 86.27C using 60ml in 2 steps 30.0 water each .. warmed pot: 41.22C temp tea: 88.11C using 60ml in 3 steps 20.0 water each ... warmed pot: 49.18C temp tea: 89.61C using 60ml in 4 steps 15.0 water each .... warmed pot: 55.66C temp tea: 90.83C using 70ml in 1 steps 70.0 water each . warmed pot: 33.11C temp tea: 86.50C using 70ml in 2 steps 35.0 water each .. warmed pot: 43.97C temp tea: 88.56C using 70ml in 3 steps 23.3 water each ... warmed pot: 52.67C temp tea: 90.22C using 70ml in 4 steps 17.5 water each .... warmed pot: 59.56C temp tea: 91.52C using 80ml in 1 steps 80.0 water each . warmed pot: 34.64C temp tea: 86.72C using 80ml in 2 steps 40.0 water each .. warmed pot: 46.55C temp tea: 88.99C using 80ml in 3 steps 26.7 water each ... warmed pot: 55.87C temp tea: 90.77C using 80ml in 4 steps 20.0 water each .... warmed pot: 63.07C temp tea: 92.15C using 90ml in 1 steps 90.0 water each . warmed pot: 36.10C temp tea: 86.92C using 90ml in 2 steps 45.0 water each .. warmed pot: 48.97C temp tea: 89.39C using 90ml in 3 steps 30.0 water each ... warmed pot: 58.80C temp tea: 91.28C using 90ml in 4 steps 22.5 water each .... warmed pot: 66.21C temp tea: 92.70C using 100ml in 1 steps 100.0 water each . warmed pot: 37.50C temp tea: 87.12C using 100ml in 2 steps 50.0 water each .. warmed pot: 51.23C temp tea: 89.77C using 100ml in 3 steps 33.3 water each ... warmed pot: 61.49C temp tea: 91.75C using 100ml in 4 steps 25.0 water each .... warmed pot: 69.04C temp tea: 93.21C using 110ml in 1 steps 110.0 water each . warmed pot: 38.84C temp tea: 87.30C using 110ml in 2 steps 55.0 water each .. warmed pot: 53.37C temp tea: 90.13C using 110ml in 3 steps 36.7 water each ... warmed pot: 63.97C temp tea: 92.19C using 110ml in 4 steps 27.5 water each .... warmed pot: 71.59C temp tea: 93.66C using 120ml in 1 steps 120.0 water each . warmed pot: 40.12C temp tea: 87.48C using 120ml in 2 steps 60.0 water each .. warmed pot: 55.37C temp tea: 90.46C using 120ml in 3 steps 40.0 water each ... warmed pot: 66.26C temp tea: 92.59C using 120ml in 4 steps 30.0 water each .... warmed pot: 73.89C temp tea: 94.08C . . . using 200ml in 1 steps 200.0 water each . warmed pot: 48.72C temp tea: 88.64C using 200ml in 2 steps 100.0 water each .. warmed pot: 67.82C temp tea: 92.55C using 200ml in 3 steps 66.7 water each ... warmed pot: 79.31C temp tea: 94.90C using 200ml in 4 steps 50.0 water each .... warmed pot: 86.00C temp tea: 96.27C . . . using 300ml in 1 steps 300.0 water each . warmed pot: 56.52C temp tea: 89.61C using 300ml in 2 steps 150.0 water each .. warmed pot: 77.53C temp tea: 94.19C using 300ml in 3 steps 100.0 water each ... warmed pot: 87.91C temp tea: 96.45C using 300ml in 4 steps 75.0 water each .... warmed pot: 92.78C temp tea: 97.51C ```