question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :neon_and_oxygen_by_density do 4 kind :numerical 5 describes "A vessel contains two non-reactive gases: neon (monatomic) and oxygen (diatomic). The ratio of their " \ 6 "partial pressures is 3:2. The atomic mass of neon is %{neon} and the molecular mass of oxygen is " \ 7 "%{oxygen}. %{ratio} of neon to oxygen in the vessel?" 8 given neon: "20.2 g/mol" 9 given oxygen: "32.0 g/mol" 10 asks ratio: "What is the ratio of the mass densities" 11 end
1 require_relative "../questions/neon_and_oxygen_by_density" 2 require_relative "../science/kinetic_theory/ideal_gas" 3 4 solve :neon_and_oxygen_by_density , using: IdealGas do 5 objects :neon , :oxygen 6 7 take neon: neon . molar_mass 8 take oxygen: oxygen . molar_mass 9 10 deduce_from "partial pressures is 3:2" , neon . pressure => 1.5 * oxygen . pressure 11 deduce_from "A vessel contains two" , neon . volume => oxygen . volume , neon . temperature => oxygen . temperature 12 13 answer find_relation ( neon . density / oxygen . density ), figures: 3 14 15 conclusion "Neon has more molecules in the vessel, but each is lighter, so its greater number nearly cancels " \ 16 "its lightness." 17 end
1 require_relative "../solutions/neon_and_oxygen_by_density" 2 3 play_with :neon_and_oxygen_by_density do 4 title "Neon and Oxygen by Density" 5 end