question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :a_brass_wire_cooled_between_supports do 4 kind :numerical 5 describes "A brass wire %{length} long at %{warm} is held taut with little tension between two rigid supports. " \ 6 "Co-efficient of linear expansion of brass = %{expansion}; Young's modulus of brass = %{modulus}. If the " \ 7 "wire is cooled to a temperature of %{cold}, %{tension}, if its diameter is 2.0 mm, in newtons?" 8 given length: "1.8 m" 9 given warm: "27 °C" 10 given expansion: "2.0e-5 K-1" 11 given modulus: "0.91e11 Pa" 12 given cold: "-39 °C" 13 asks tension: "what is the tension developed in the wire" 14 end
1 require_relative "../questions/a_brass_wire_cooled_between_supports" 2 require_relative "../science/thermal_properties_of_matter/thermal_expansion" 3 require_relative "../science/mechanical_properties_of_solids/youngs_modulus" 4 5 solve :a_brass_wire_cooled_between_supports , using: [ ThermalExpansion , YoungsModulus ] do 6 objects :wire 7 8 take length: wire . length_at_first 9 take warm: wire . temperature_at_first 10 take expansion: wire . coefficient_of_linear_expansion 11 take modulus: wire . youngs_modulus 12 take cold: wire . temperature_after 13 14 deduce_from "its diameter is 2.0 mm" , wire . thickness => "1.0 mm" 15 deduce_from "held taut" , wire . original_length => wire . length_at_first 16 deduce_from "between two rigid supports" , wire . extension => - wire . change_in_length 17 18 tension = wire . load 19 answer tension :, in: "N" , figures: 2 20 21 conclusion "Cooled, the wire would shrink, but the supports hold it at its old length; it is stretched " \ 22 "by just what it would have shrunk, and that strain sets the tension." 23 end
1 require_relative "../solutions/a_brass_wire_cooled_between_supports" 2 3 play_with :a_brass_wire_cooled_between_supports do 4 title "A Brass Wire Cooled Between Supports" 5 end