question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :oxygen_molecules_in_their_gas do 4 kind :numerical 5 describes "Take the diameter of an oxygen molecule to be %{diameter}. %{fraction} to the actual volume occupied by " \ 6 "oxygen gas at STP?" 7 given diameter: "3 Å" 8 asks fraction: "Estimate the fraction of molecular volume" 9 end
1 require_relative "../questions/oxygen_molecules_in_their_gas" 2 require_relative "../science/kinetic_theory/molecular_size" 3 4 solve :oxygen_molecules_in_their_gas , using: MolecularSize do 5 objects :oxygen 6 7 take diameter: oxygen . molecular_diameter 8 9 deduce_from "at STP" , oxygen . temperature => "273 K" , oxygen . pressure => "1 atm" 10 11 fraction = oxygen . fraction_filled_by_molecules 12 answer fraction :, figures: 1 13 14 conclusion "The molecules themselves fill only a tiny part of the space a gas takes up; the rest is empty, " \ 15 "which is why a gas squeezes so easily." 16 end
1 require_relative "../solutions/oxygen_molecules_in_their_gas" 2 3 play_with :oxygen_molecules_in_their_gas do 4 title "Oxygen Molecules in Their Gas" 5 end