question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :flux_through_a_square do 4 kind :numerical 5 describes "Consider a uniform electric field E = %{field} along x. %{flux} of this field through a square of " \ 6 "10 cm on a side whose plane is parallel to the yz plane, in N m²/C?" 7 given field: "3e3 N/C" 8 asks flux: "What is the flux" 9 end
1 require_relative "../questions/flux_through_a_square" 2 require_relative "../science/electric_charges_and_fields/gausss_law" 3 4 solve :flux_through_a_square , using: GausssLaw do 5 objects :square 6 7 take field: E 8 9 deduce_from "a square of 10 cm on a side" , square . area => "100 cm2" 10 11 flux = square . electric_flux 12 answer flux :, in: "N m2/C" , figures: 2 13 14 conclusion "A plane parallel to the yz plane stands square across a field along x, so the whole of its area " \ 15 "catches the field." 16 end
1 require_relative "../solutions/flux_through_a_square" 2 3 play_with :flux_through_a_square do 4 title "Flux Through a Square" 5 end