question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :a_solenoid_with_an_iron_core do 4 kind :numerical 5 describes "A solenoid has a core of a material with relative permeability %{permeability}. The windings of the " \ 6 "solenoid are insulated from the core and carry a current of %{current}. If the number of turns is " \ 7 "%{turns}, %{field}, in teslas?" 8 given permeability: "400" 9 given current: "2 A" 10 given turns: "1000 m-1" 11 asks field: "what is the magnetic field in the core" 12 end
1 require_relative "../questions/a_solenoid_with_an_iron_core" 2 require_relative "../science/magnetism_and_matter/magnetisation" 3 4 solve :a_solenoid_with_an_iron_core , using: Magnetisation do 5 objects :core 6 7 take permeability: core . relative_permeability 8 take current: core . current 9 take turns: core . turns_per_length 10 11 field = core . magnetic_field 12 answer field :, in: "T" , figures: 2 13 14 conclusion "The windings alone set H; the core lines up its own atomic magnets along it, multiplying the " \ 15 "field four hundred times over." 16 end
1 require_relative "../solutions/a_solenoid_with_an_iron_core" 2 3 play_with :a_solenoid_with_an_iron_core do 4 title "A Solenoid with an Iron Core" 5 end