question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :two_carbon_nuclei_fusing do 4 kind :numerical 5 describes "The Q value of a nuclear reaction A + b → C + d is defined by Q = [mA + mb – mC – md]c², where the " \ 6 "masses refer to the respective nuclei. Given m(¹²₆C) = %{carbon}, m(²⁰₁₀Ne) = %{neon} and " \ 7 "m(⁴₂He) = %{helium}, %{q} of the reaction ¹²₆C + ¹²₆C → ²⁰₁₀Ne + ⁴₂He, in MeV?" 8 given carbon: "12.000000 u" 9 given neon: "19.992439 u" 10 given helium: "4.002603 u" 11 asks q: "what is the Q-value" 12 end
1 require_relative "../questions/two_carbon_nuclei_fusing" 2 require_relative "../science/nuclei/mass_energy" 3 4 solve :two_carbon_nuclei_fusing , using: MassEnergy do 5 objects :reaction , :carbon , :neon , :helium 6 7 take carbon: carbon . mass 8 take neon: neon . mass 9 take helium: helium . mass 10 11 deduce_from "¹²₆C + ¹²₆C → ²⁰₁₀Ne + ⁴₂He" , 12 reaction . mass_defect => 2 * carbon . mass - neon . mass - helium . mass 13 14 q = reaction . q_value 15 answer q :, in: "MeV" , figures: 3 16 17 conclusion "The neon and helium nuclei weigh less than the two carbon nuclei, and the lost mass comes out as " \ 18 "energy: the reaction is exothermic." 19 end
1 require_relative "../solutions/two_carbon_nuclei_fusing" 2 3 play_with :two_carbon_nuclei_fusing do 4 title "Two Carbon Nuclei Fusing" 5 end