question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :the_charge_behind_a_flux do 4 kind :numerical 5 describes "A point charge causes an electric flux of %{flux} to pass through a spherical Gaussian surface of " \ 6 "10.0 cm radius centred on the charge. %{charge}, in nC?" 7 given flux: "-1.0e3 N m2/C" 8 asks charge: "What is the value of the point charge" 9 end
1 require_relative "../questions/the_charge_behind_a_flux" 2 require_relative "../science/electric_charges_and_fields/gausss_law" 3 4 solve :the_charge_behind_a_flux , using: GausssLaw do 5 objects :sphere 6 7 take flux: sphere . electric_flux 8 9 charge = sphere . charge_inside 10 answer charge :, in: "nC" , figures: 3 11 12 conclusion "The flux through the surface is the charge inside over the permittivity of free space; flux " \ 13 "flowing inward means a negative charge." 14 end
1 require_relative "../solutions/the_charge_behind_a_flux" 2 3 play_with :the_charge_behind_a_flux do 4 title "The Charge Behind a Flux" 5 end