# Forces on Current Carrying Wire

Activity Information

Learning Goals

• Understand the relationship of current direction and magnetic field direction in a current-carrying wire
• current and magnetic field in parallel wires
• Use mathematical representations of Coulomb’s Law to describe the electrostatic forces between objects ( HS-PS2-4)

Prior Knowledge Required

• Right-Hand Rule
• Magnetic force
• Biot-Savart Law
• Lorenz Force

Code Manipulation

• Modify existing code
• Create arrows showing magnetic force
• Create sphere to represent movement of charge within the wire

Activity

Handout – ACME Corporation Needs You!

You have been hired by the Acme Corporation to develop a new detector for locating Road Runners (Accelleratti incredibus). A key portion of the detector has two wires that must run past each other for the length of the apparatus. However, it is important that they do not touch as that would cause an explosion, thereby harming the detector’s only qualified user, Wile E. Coyote (Carnivorous vulgaris). Your job is to assess the force acting on each of the wires as a result of a current passing through them. Here are the specifications of the apparatus:

• Wires are 100 cm ling
• Wires are 2.0 cm apart
• Maximum permissible current is 4.5 A.
• Current can run in the same direction or in the opposite direction through both wires

Code

``````GlowScript 2.7 VPython

scene.width = 1000 #set the width of the window
scene.height = 600 #set the height of the window
scene.range = 30 #set the range of the scene - bigger to zoom out

#some constants that might be useful
u = 2e-7

#location, location, location
y1 = 10 #vertical location of wire 1
y2 = -10 #vertical location of wire 2
wirelength = 100

#define the wires objects
wire1 = cylinder(pos = vec(-(wirelength/2),y1,0), length = (wirelength), color = vector(1,1,1), opacity = .2, radius = 1)
wire2 = cylinder(pos = vec(-(wirelength/2),y2,0), length = (wirelength), color = vector(1,1,1), opacity = .2, radius = 1)``````

Handout

In order to determine the force that each wire exerts on the other, the magnetic field B must first be calculated. This can be done using the Biot-Savart Law.

The magnetic force acting on each wire can then be calculated using the Lorentz force equation.

Based on the above calculations, the maximum magnetic force acting on each wire for a 4.5 A current is 2.03∗10^−5

N. Using the right-hand rule, or checking the signs of the calculated forces, you’ll find that the wires attract each other when the current goes in the same direction, and the wires will repel each other when the current goes in opposite directions.

See the completed code below, with the physics-specific lines highlighted.

Code

``````GlowScript 2.7 VPython

scene.width = 1000 #set the width of the window
scene.height = 600 #set the height of the window
scene.range = 30 #set the range of the scene - bigger to zoom out

#some constants that might be useful
u = 2e-7

#location, location, location
y1 = 10 #vertical location of wire 1
y2 = -10 #vertical location of wire 2
wirelength = 100

#define the wires objects
wire1 = cylinder(pos = vec(-(wirelength/2),y1,0), length = (wirelength), color = vector(1,1,1), opacity = .2, radius = 1)
wire2 = cylinder(pos = vec(-(wirelength/2),y2,0), length = (wirelength), color = vector(1,1,1), opacity = .2, radius = 1)

#determine the distance between the wires
r = wire1.pos - wire2.pos

#current and B-field calculation for wire 1
I1 = vec(1,0,0)  #current in amps - positive value means current is left to right - only change the x-field
L = wirelength #length of wires
B1 = (u*cross(I1,r))/(mag(r)**2) #magnetic field strength for current carrying wire 1 at the position of wire 2

#current and B-field calculation for wire 2
I2 = vec(-1,0,0) #current in amps - positive value means current is left to right - only change the x-field
B2 = (u*cross(I2,-r))/(mag(r)**2) #magnetic field strength for current carrying wire 2 at the position of wire 1

#F=ILB or more correctly L*IxB
forcew2w1 = L*(cross(I2,B1))
forcew1w2 = L*(cross(I1,B2))
arrow(pos=wire1.pos+vec(wirelength/2,0,0), axis=(forcew2w1)*1e7, color=color.blue) #edit the axis multiplier to scale for current changes
arrow(pos=wire2.pos+vec(wirelength/2,0,0), axis=(forcew1w2)*1e7, color=color.red) #edit the axis multiplier to scale for current changes
arrow(pos=vec(0,y1,0), axis=(I1)*10) #arrows to indicate direction of current
arrow(pos=vec(0,y2,0), axis=(I2)*10) #arrows to indicate direction of current

#define charges
wirestartleft = -wirelength/2
wirestartright = wirelength/2

if I1.x>0:
start1 = wirestartleft
x1=1
else:
start1 = wirestarright
x1=-1
if I2.x>0:
start2 = wirestartleft
x2=1
else:
start2= wirestartright
x2=-1

Tin1 = text(pos = vec((start1),y1+(-5*x1),0),text='X                  X                 X                   X                     X                    X                       X                    X                          X                           X                          X                           X                           X')
Tout1 = text(pos = vec((start1),y1+(5*x1),0),text='O                  O                 O                   O                     O                    O                       O                    O                          O                           O                          O                           O                           O')

Tin2 = text(pos = vec((start1),y2+(-5*x2),0),text='X                  X                 X                   X                     X                    X                       X                    X                          X                           X                          X                           X                           X')
Tout2 = text(pos = vec((start1),y2+(5*x2),0),text='O                  O                 O                   O                     O                    O                       O                    O                          O                           O                          O                           O                           O')

counter = 0

while counter < 1000:
charge1 = sphere(pos=vec((start1),y1,0), radius = .5, color = vec(1,0,0))
charge2 = sphere(pos=vec((start2),y2,0), radius = .5, color = vec(1,0,0))
while abs(charge1.pos.x) <= 50:
rate(100)
charge1.pos.x = (charge1.pos.x + (.5*x1))
charge2.pos.x = (charge2.pos.x + (.5*x2))
if charge1.pos.x >= 50:
charge1.color = vector(0,0,0)
charge2.color = vector(0,0,0)

counter = counter+1 ``````