Magnetic Field of a Solenoid: Difference between revisions

From Physics Book
Jump to navigation Jump to search
No edit summary
Line 44: Line 44:
bscale = 600. ## scale factor for B arrows
bscale = 600. ## scale factor for B arrows


## make a solenoid
.## make a solenoid


dxx = L/(Nturns∗Nelts)
dxx = L/(Nturns∗Nelts)
Line 55: Line 55:




## make a list of zero lth arrows at observation locations  
.## make a list of zero lth arrows at observation locations  


Barrows =[] ## empty list
Barrows =[] ## empty list
Line 62: Line 62:


zz=0.
zz=0.


for x in arange(
for x in arange(

Revision as of 13:29, 5 December 2015

Created by ramin8 !!

A Solenoid is a type of electromagnet, which consists of a coil tightly wound into a helix. Usually it produces a uniform magnetic field when an electric current is run through it. The purpose of a solenoid is to create a controlled magnetic field.


The Main Idea

The purpose of this application is to explore another way to apply the Biot-Sarvart law. The magnetic field is uniform along the axis of the solenoid, when electric current is run through it. The solenoid has has to have coils much larger than the radius.


A Mathematical Model

This is the formula for the magnetic field inside a long solenoid: [math]\displaystyle{ B = {\mu _{0}} \frac{NI}{L} }[/math] This formula is used inside a long solenoid, when the radius of the solenoid is much smaller than the length. B is the magnetic field. [math]\displaystyle{ {\mu _{0}} }[/math] is a constant. N is the number of loops in the solenoid. L is the length of the solenoid.

To determine the direction of the magnetic field: use your right hand and curl your fingers towards the direction of the current and the direction that your thumb is pointing to is the direction of the magnetic field.


A Computational Model

A solenoid has a length of .5 meters and a radius of .03 meters and wound around 50 times a wire that has a current of 1 ampere. Find the magnetic field vectors. from visual import ∗

scene . width=1024 scene.x = scene.y = 0

scene . background = color . white

L = 0.5

R = 0.03

kmag = 1e-7

I = 1

Nturns=50. ## number of turns in solenoid

Nelts=20. ## number of line segments per turn

bscale = 600. ## scale factor for B arrows

.## make a solenoid

dxx = L/(Nturns∗Nelts)

xx = arange(L/2., L/2+dxx, dxx)

omega = 2∗pi∗Nturns/L

solenoid = curve(x=xx, y=R∗sin(xx∗omega), z=R∗cos(xx∗omega), color=(.9,.7,0),radius =0.001)


.## make a list of zero lth arrows at observation locations

Barrows =[] ## empty list

dx = L/4.

zz=0.


for x in arange(