question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :an_unknown_gas_weighed_by_its_density do 4 kind :numerical 5 describes "The density of an unknown gas at %{temperature} and %{pressure} is %{density}. Assuming the gas to be " \ 6 "an ideal one, %{molar_mass}, in g/mol?" 7 given temperature: "97 °C" 8 given pressure: "0.95 atm" 9 given density: "2.5 g/litre" 10 asks molar_mass: "the molecular weight of this gas should be nearly" 11 end
1 require_relative "../questions/an_unknown_gas_weighed_by_its_density" 2 require_relative "../science/kinetic_theory/ideal_gas" 3 4 solve :an_unknown_gas_weighed_by_its_density , using: IdealGas do 5 objects :gas 6 7 take temperature: gas . temperature , pressure: gas . pressure , density: gas . density 8 9 assume gas . volume => "1 L" 10 11 molar_mass = gas . molar_mass 12 answer molar_mass :, in: "g/mol" , figures: 2 13 14 conclusion "A litre of any ideal gas at this temperature and pressure holds the same number of moles, so its " \ 15 "mass over that number of moles is the molar mass; 97 °C is 370 K on the absolute scale the gas law " \ 16 "needs." 17 end
1 require_relative "../solutions/an_unknown_gas_weighed_by_its_density" 2 3 play_with :an_unknown_gas_weighed_by_its_density do 4 title "An Unknown Gas Weighed by Its Density" 5 end