question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :a_bismuth_nucleus_s_binding_energy do 4 kind :numerical 5 describes "%{energy} of the nucleus of bismuth (A = %{nucleons}, Z = %{protons}), given its mass %{mass}, with " \ 6 "mH = %{hydrogen} and mn = %{neutron}, in MeV?" 7 given nucleons: "209" 8 given protons: "83" 9 given mass: "208.980388 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/a_bismuth_nucleus_s_binding_energy" 2 require_relative "../science/nuclei/mass_energy" 3 4 solve :a_bismuth_nucleus_s_binding_energy , using: MassEnergy do 5 objects :bismuth 6 7 take nucleons: bismuth . mass_number 8 take protons: bismuth . atomic_number 9 take mass: bismuth . mass 10 take hydrogen: m_H 11 take neutron: m_n 12 13 energy = bismuth . binding_energy 14 answer energy :, in: "MeV" , figures: 4 15 16 conclusion "A heavy nucleus holds many more nucleons, so its total binding energy is larger, though each " \ 17 "nucleon in it is held a little less tightly than in iron." 18 end
1 require_relative "../solutions/a_bismuth_nucleus_s_binding_energy" 2 3 play_with :a_bismuth_nucleus_s_binding_energy do 4 title "A Bismuth Nucleus's Binding Energy" 5 end