question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :a_nichrome_element_settling do 4 kind :numerical 5 describes "A heating element using nichrome connected to a %{supply} supply draws an initial current of " \ 6 "%{initial} which settles after a few seconds to a steady value of %{steady}. The room temperature is " \ 7 "%{room}, and the temperature coefficient of resistance of nichrome averaged over the temperature range " \ 8 "involved is %{coefficient}. %{temperature}, in °C?" 9 given supply: "230 V" 10 given initial: "3.2 A" 11 given steady: "2.8 A" 12 given room: "27.0 °C" 13 given coefficient: "1.70e-4 °C-1" 14 asks temperature: "What is the steady temperature of the heating element" 15 end
1 require_relative "../questions/a_nichrome_element_settling" 2 require_relative "../science/current_electricity/temperature_dependence_of_resistance" 3 4 solve :a_nichrome_element_settling , using: TemperatureDependenceOfResistance do 5 objects :cold , :hot 6 7 take supply: hot . voltage 8 take initial: cold . current 9 take steady: hot . current 10 take room: T_0 11 take coefficient: cold . temperature_coefficient 12 deduce_from "A heating element using nichrome" , hot . temperature_coefficient => cold . temperature_coefficient , 13 hot . reference_resistance => cold . reference_resistance 14 15 deduce_from "draws an initial current" , cold . voltage => hot . voltage , cold . temperature => T_0 16 17 temperature = hot . temperature 18 answer temperature :, in: "°C" , figures: 3 19 20 conclusion "At first the element is at room temperature and passes more current; as it heats up its " \ 21 "resistance grows until the current settles, and that growth tells how hot it is." 22 end
1 require_relative "../solutions/a_nichrome_element_settling" 2 3 play_with :a_nichrome_element_settling do 4 title "A Nichrome Element Settling" 5 end