question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :iron_and_brass_end_to_end do 4 kind :numerical 5 describes "An iron bar (length %{iron_length}, cross-section %{iron_area}, thermal conductivity %{iron_k}) and a " \ 6 "brass bar (length %{brass_length}, cross-section %{brass_area}, thermal conductivity %{brass_k}) are " \ 7 "soldered end to end. The free ends of the iron bar and brass bar are maintained at %{hot} and %{cold} " \ 8 "respectively. %{junction}, in kelvin?" 9 given iron_length: "0.1 m" 10 given iron_area: "0.02 m2" 11 given iron_k: "79 W m-1 K-1" 12 given brass_length: "0.1 m" 13 given brass_area: "0.02 m2" 14 given brass_k: "109 W m-1 K-1" 15 given hot: "373 K" 16 given cold: "273 K" 17 asks junction: "What is the temperature of the junction of the two bars" 18 end
1 require_relative "../questions/iron_and_brass_end_to_end" 2 require_relative "../science/thermal_properties_of_matter/conduction" 3 4 solve :iron_and_brass_end_to_end , using: Conduction do 5 objects :iron , :brass 6 7 take iron_length: iron . length_of_the_rod 8 take iron_area: iron . cross_section 9 take iron_k: iron . thermal_conductivity 10 take brass_length: brass . length_of_the_rod 11 take brass_area: brass . cross_section 12 take brass_k: brass . thermal_conductivity 13 take hot: iron . hot_end 14 take cold: brass . cold_end 15 16 deduce_from "soldered end to end" , brass . hot_end => iron . cold_end , brass . heat_current => iron . heat_current 17 18 junction = iron . cold_end 19 answer junction :, in: "K" , figures: 3 20 21 conclusion "In the steady state the same heat flows through both bars, so the junction settles where " \ 22 "the better conductor needs a smaller drop to carry it." 23 end
1 require_relative "../solutions/iron_and_brass_end_to_end" 2 3 play_with :iron_and_brass_end_to_end do 4 title "Iron and Brass End to End" 5 end