question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :warming_helium_in_a_cylinder do 4 kind :numerical 5 describes "A cylinder of fixed capacity %{volume} contains helium gas at standard temperature and pressure. " \ 6 "Taking R as %{constant}, %{heat} to raise the temperature of the gas in the cylinder by %{rise}, " \ 7 "in joules?" 8 given volume: "44.8 L" 9 given constant: "8.31 J mol-1 K-1" 10 given rise: "15.0 °C" 11 asks heat: "what is the amount of heat needed" 12 end
1 require_relative "../questions/warming_helium_in_a_cylinder" 2 require_relative "../science/kinetic_theory/specific_heat_of_gases" 3 4 solve :warming_helium_in_a_cylinder , using: SpecificHeatOfGases do 5 objects :helium 6 7 take volume: helium . volume 8 take constant: R 9 take rise: helium . temperature_rise 10 11 deduce_from "standard temperature and pressure" , helium . temperature => "273 K" , helium . pressure => "1 atm" 12 deduce_from "helium" , helium . degrees_of_freedom => "3" 13 14 heat = helium . heat_at_fixed_volume 15 answer heat :, in: "J" , figures: 3 16 17 conclusion "At standard conditions the cylinder holds two moles; helium's atoms only move, three ways, " \ 18 "so each mole takes three halves of R for every kelvin." 19 end
1 require_relative "../solutions/warming_helium_in_a_cylinder" 2 3 play_with :warming_helium_in_a_cylinder do 4 title "Warming Helium in a Cylinder" 5 end