question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :an_iron_nucleus_s_binding_energy do 4 kind :numerical 5 describes "%{energy} of the nucleus of iron (A = %{nucleons}, Z = %{protons}), given its mass %{mass}, with " \ 6 "mH = %{hydrogen} and mn = %{neutron}, in MeV?" 7 given nucleons: "56" 8 given protons: "26" 9 given mass: "55.934939 u" 10 given hydrogen: "1.007825 u" 11 given neutron: "1.008665 u" 12 asks energy: "What is the binding energy" 13 end
1 require_relative "../questions/an_iron_nucleus_s_binding_energy" 2 require_relative "../science/nuclei/mass_energy" 3 4 solve :an_iron_nucleus_s_binding_energy , using: MassEnergy do 5 objects :iron 6 7 take nucleons: iron . mass_number 8 take protons: iron . atomic_number 9 take mass: iron . mass 10 take hydrogen: m_H 11 take neutron: m_n 12 13 energy = iron . binding_energy 14 answer energy :, in: "MeV" , figures: 4 15 16 conclusion "The iron nucleus weighs less than its protons and neutrons apart; that lost mass, as energy, is " \ 17 "what holds it together." 18 end
1 require_relative "../solutions/an_iron_nucleus_s_binding_energy" 2 3 play_with :an_iron_nucleus_s_binding_energy do 4 title "An Iron Nucleus's Binding Energy" 5 end