question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :a_heating_element_at_117_ohms do 4 kind :numerical 5 describes "At room temperature (%{room}) the resistance of a heating element is %{at_room}. %{temperature} if the " \ 6 "resistance is found to be %{hot}, given that the temperature coefficient of the material of the " \ 7 "resistor is %{coefficient}, in °C?" 8 given room: "27.0 °C" 9 given at_room: "100 Ω" 10 given hot: "117 Ω" 11 given coefficient: "1.70e-4 °C-1" 12 asks temperature: "What is the temperature of the element" 13 end
1 require_relative "../questions/a_heating_element_at_117_ohms" 2 require_relative "../science/current_electricity/temperature_dependence_of_resistance" 3 4 solve :a_heating_element_at_117_ohms , using: TemperatureDependenceOfResistance do 5 objects :element 6 7 take room: T_0 8 take at_room: element . reference_resistance 9 take hot: element . resistance 10 take coefficient: element . temperature_coefficient 11 12 temperature = element . temperature 13 answer temperature :, in: "°C" , figures: 4 14 15 conclusion "The resistance grows in step with the rise in temperature, so how far it has grown tells how far " \ 16 "the element is above room temperature." 17 end
1 require_relative "../solutions/a_heating_element_at_117_ohms" 2 3 play_with :a_heating_element_at_117_ohms do 4 title "A Heating Element at 117 Ohms" 5 end