question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :a_platinum_thermometer do 4 kind :numerical 5 describes "The resistance of the platinum wire of a platinum resistance thermometer at the ice point is " \ 6 "%{at_ice} and at steam point is %{at_steam}. When the thermometer is inserted in a hot bath, the " \ 7 "resistance of the platinum wire is %{in_bath}. %{temperature}, in °C?" 8 given at_ice: "5 Ω" 9 given at_steam: "5.23 Ω" 10 given in_bath: "5.795 Ω" 11 asks temperature: "What is the temperature of the bath" 12 end
1 require_relative "../questions/a_platinum_thermometer" 2 require_relative "../science/current_electricity/temperature_dependence_of_resistance" 3 4 solve :a_platinum_thermometer , using: TemperatureDependenceOfResistance do 5 objects :steam , :bath 6 deduce_from "the platinum wire" , bath . temperature_coefficient => steam . temperature_coefficient , 7 bath . reference_resistance => steam . reference_resistance 8 9 take at_ice: steam . reference_resistance 10 take at_steam: steam . resistance 11 take in_bath: bath . resistance 12 13 deduce_from "the ice point" , T_0 => "0 °C" 14 deduce_from "steam point" , steam . temperature => "100 °C" 15 16 temperature = bath . temperature 17 answer temperature :, in: "°C" , figures: 5 18 19 conclusion "Platinum's resistance grows evenly with temperature, so the ice and steam points mark out a " \ 20 "scale, and the bath's resistance reads off where it falls on it." 21 end
1 require_relative "../solutions/a_platinum_thermometer" 2 3 play_with :a_platinum_thermometer do 4 title "A Platinum Thermometer" 5 end