play phryzby with physics

Part of eval backend edge-thanveer, agent version bdd945f

stuck
24 drafts checked

Two long and parallel straight wires A and B carrying currents of 8.0 A and 5.0 A in the same direction are separated by a distance of 4.0 cm. Estimate the force on a 10 cm section of wire A, in newtons?

expects 2 × 10⁻⁵ N

24 checks, 0 agreed

draft 24: failed in solution.rb, line 6 — NoMethodError: undefined method 'distance_from_the_wire' for an instance of Physics::PhysicalObject; distance_from_the_wire is a quantity of MagneticFieldOfCurrents, not a method: reach it from an object, as <object>.distance_from_the_wire; it takes no argument: write <object>.distance_from_the_wire, with qualifiers by keyword (during:, by:) if any

solution.rb · draft 24 stopped at line 6
1solve :two_parallel_wires, using: [MagneticFieldOfCurrents, MagneticForce] do2  objects :a, :b34  take current_a: a.current5  take current_b: b.current6  take separation: a.distance_from_the_wire(b)NoMethodError: undefined method 'distance_from_the_wire' for an instance of Physics::PhysicalObject; distance_from_the_wire is a quantity of MagneticFieldOfCurrents, not a method: reach it from an object, as <object>.distance_from_the_wire; it takes no argument: write <object>.distance_from_the_wire, with qualifiers by keyword (during:, by:) if any78  deduce_from "a 10 cm section", a.length_in_the_field => "10 cm"910  take field_at_a: b.field_near_a_wire1112  force = a.force_on_a_wire13  answer force:, in: "N", figures: 21415  conclusion "Wire B produces a magnetic field at wire A, and the current in A feels a force from that field."16end