question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :a_charge_in_a_gaussian_cube do 4 kind :numerical 5 describes "A point charge of %{charge} is at the centre of a cubic Gaussian surface 9.0 cm on edge. %{flux}, in " \ 6 "N m²/C?" 7 given charge: "2.0 μC" 8 asks flux: "What is the net electric flux through the surface" 9 end
1 require_relative "../questions/a_charge_in_a_gaussian_cube" 2 require_relative "../science/electric_charges_and_fields/gausss_law" 3 4 solve :a_charge_in_a_gaussian_cube , using: GausssLaw do 5 objects :cube 6 7 take charge: cube . charge_inside 8 9 flux = cube . electric_flux 10 answer flux :, in: "N m2/C" , figures: 3 11 12 conclusion "The flux through a closed surface depends only on the charge inside, so the size of the cube does " \ 13 "not matter." 14 end
1 require_relative "../solutions/a_charge_in_a_gaussian_cube" 2 3 play_with :a_charge_in_a_gaussian_cube do 4 title "A Charge in a Gaussian Cube" 5 end