question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :a_hole_in_a_copper_sheet do 4 kind :numerical 5 describes "A hole is drilled in a copper sheet. The diameter of the hole is %{diameter} at %{cool}. Coefficient of " \ 6 "linear expansion of copper = %{expansion}. %{change} when the sheet is heated to %{hot}, in cm?" 7 given diameter: "4.24 cm" 8 given cool: "27.0 °C" 9 given expansion: "1.70e-5 K-1" 10 given hot: "227 °C" 11 asks change: "What is the change in the diameter of the hole" 12 end
1 require_relative "../questions/a_hole_in_a_copper_sheet" 2 require_relative "../science/thermal_properties_of_matter/thermal_expansion" 3 4 solve :a_hole_in_a_copper_sheet , using: ThermalExpansion do 5 objects :hole 6 7 take diameter: hole . length_at_first 8 take cool: hole . temperature_at_first 9 take expansion: hole . coefficient_of_linear_expansion 10 take hot: hole . temperature_after 11 12 change = hole . change_in_length 13 answer change :, in: "cm" , figures: 3 14 15 conclusion "Heating swells the whole sheet like a photographic enlargement, so the hole grows too, just " \ 16 "as a disc of copper filling it would." 17 end
1 require_relative "../solutions/a_hole_in_a_copper_sheet" 2 3 play_with :a_hole_in_a_copper_sheet do 4 title "A Hole in a Copper Sheet" 5 end