question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :a_silver_wire_warmed do 4 kind :numerical 5 describes "A silver wire has a resistance of %{cool} at %{cool_temperature}, and a resistance of %{warm} at " \ 6 "%{warm_temperature}. %{coefficient}, in °C⁻¹?" 7 given cool: "2.1 Ω" 8 given cool_temperature: "27.5 °C" 9 given warm: "2.7 Ω" 10 given warm_temperature: "100 °C" 11 asks coefficient: "Determine the temperature coefficient of resistivity of silver" 12 end
1 require_relative "../questions/a_silver_wire_warmed" 2 require_relative "../science/current_electricity/temperature_dependence_of_resistance" 3 4 solve :a_silver_wire_warmed , using: TemperatureDependenceOfResistance do 5 objects :warm 6 7 take cool: warm . reference_resistance 8 take cool_temperature: T_0 9 take warm: warm . resistance 10 take warm_temperature: warm . temperature 11 12 coefficient = warm . temperature_coefficient 13 answer coefficient :, in: "°C-1" , figures: 2 14 15 conclusion "The resistance grows by the same fraction for every degree, so the fraction it grew over the rise " \ 16 "in temperature is the coefficient." 17 end
1 require_relative "../solutions/a_silver_wire_warmed" 2 3 play_with :a_silver_wire_warmed do 4 title "A Silver Wire Warmed" 5 end