question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :flux_out_of_a_black_box do 4 kind :numerical 5 describes "Careful measurement of the electric field at the surface of a black box indicates that the net outward " \ 6 "flux through the surface of the box is %{flux}. %{charge}, in μC?" 7 given flux: "8.0e3 N m2/C" 8 asks charge: "What is the net charge inside the box" 9 end
1 require_relative "../questions/flux_out_of_a_black_box" 2 require_relative "../science/electric_charges_and_fields/gausss_law" 3 4 solve :flux_out_of_a_black_box , using: GausssLaw do 5 objects :box 6 7 take flux: box . electric_flux 8 9 charge = box . charge_inside 10 answer charge :, in: "μC" , figures: 1 11 12 conclusion "Gauss's law ties the net flux out of any closed surface to the charge inside it, whatever the " \ 13 "shape of the box." 14 end
1 require_relative "../solutions/flux_out_of_a_black_box" 2 3 play_with :flux_out_of_a_black_box do 4 title "Flux out of a Black Box" 5 end