{VERSION 4 0 "IBM INTEL NT" "4.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{CSTYLE "" -1 256 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 257 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 258 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 259 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 260 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 261 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 262 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 263 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 264 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 265 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 266 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 267 "" 1 14 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 268 "" 1 14 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 269 "" 1 14 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 270 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 271 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 272 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 273 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 274 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 275 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 276 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 277 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 278 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 279 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 280 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 281 "" 1 14 0 0 0 0 0 0 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 282 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 283 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 284 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 285 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 286 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 287 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 288 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 289 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 290 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 291 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 292 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 293 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 294 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 295 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 296 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 297 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 298 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 299 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 300 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 301 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 302 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 303 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 304 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 305 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 306 "" 1 14 0 0 0 0 0 0 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 307 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 308 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 309 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 310 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 311 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 312 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 313 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 314 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 315 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 316 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 317 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{PSTYLE "Normal " -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Heading 1" 0 3 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }1 0 0 0 8 4 0 0 0 0 0 0 -1 0 } {PSTYLE "" 0 256 1 {CSTYLE "" -1 -1 "" 1 16 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {EXCHG {PARA 256 "" 0 "" {TEXT -1 36 "The magnetic field of a \+ current loop" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 526 "We are interested in the calculation of a magnetic field cause d by an electric current loop as it represents a rather fundamental ap plication of the Biot-Savart law. The current loop serves to understan d solenoids and other applications. We will be able to study the magne tic field in detail based on the expressions generated by Maple and ex plain how field lines are calculated. Further applications involve the calculation of particle trajectories in magnetic fields, which is lef t to a subsequent worksheet (MagBottle.mws)." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 176 "We integrate the Biot-Savart l aw to calculate the magnetic field created by a current loop. We pick \+ a plane parallel to the current loop of radius R, displaced by a dista nce a." }}{PARA 0 "" 0 "" {TEXT -1 31 "The Biot-Savart law states that " }}{PARA 0 "" 0 "" {TEXT -1 1 "d" }{TEXT 256 1 "B" }{TEXT -1 30 " = m u0/(4*Pi) *I * crossprod(d" }{TEXT 257 1 "s" }{TEXT -1 1 "," }{TEXT 258 1 "r" }{TEXT -1 5 ")/r^3" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 42 "where I is the current in the conductor, d" } {TEXT 259 1 "s" }{TEXT -1 40 " is a line segment along the conductor, \+ " }{TEXT 260 1 "r" }{TEXT -1 46 " is the position vector to the locati on where " }{TEXT 261 1 "B" }{TEXT -1 341 " is generated taking the se gment location as the origin. The geometry of a loop for the conductor will allow us to perform the line integral in a simple way (integrati ng the polar angle that traces out the loop). The set-up of the proble m requires us to define the line segment and the position vector as a \+ function of the polar angle (phi)." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 264 "We start with the special case of findin g the magnetic field components on a circle of radius R above the loop . This result is needed to understand the attraction/repulsion between two magnets (idealized as current loops). We define the current loop \+ to lie in the " }{TEXT 307 1 "x" }{TEXT -1 1 "-" }{TEXT 308 1 "y" } {TEXT -1 21 " plane. Then we have:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 35 "restart; with(linalg): with(plots):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 35 "ds:=vector([-sin(phi),cos(phi),0]);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 74 "We fix the location where we calcu late the transverse and longitudinal (B_" }{TEXT 311 1 "z" }{TEXT -1 39 ") components of the magnetic field as (" }{TEXT 309 1 "R" }{TEXT -1 3 ",0," }{TEXT 310 1 "a" }{TEXT -1 132 "). The transverse field wil l point along the x-axis, and no magnetic field component exists along y there (no tangential component)." }}{PARA 0 "" 0 "" {TEXT -1 56 "Th e initial and final points of the position vector are:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 38 "P1:=vector([R*cos(phi),R*sin(phi),0 ]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "P2:=vector([R,0,a]); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "assume(R>0); assume(a,r eal);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "rv:=evalm(P2-P1); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "r2:=simplify(add(rv[i]^ 2,i=1..3));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "r3:=r2*sqrt( r2);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "#mu0:=evalf(4*Pi*10 ^(-7));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "dB0:=simplify(cr ossprod(ds,rv));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "Bx:=10^ (-7)*i_L*R*int(dB0[1]/r3,phi=0..2*Pi);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "By:=10^(-7)*i_L*R*int(dB0[2]/r3,phi=0..2*Pi);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "Bz:=10^(-7)*i_L*R*int(dB0[3] /r3,phi=0..2*Pi);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 157 "We have dem onstrated that the field components can be calculated in a straightfor ward way on a circle the size of the current loop which is centered at [0,0," }{TEXT 272 1 "a" }{TEXT -1 2 "]." }}{PARA 0 "" 0 "" {TEXT -1 145 "Before we introduce the general result (which can be calculated a nalogously in Maple 6.0, but not in 5.1) we explore some limits and so me graphs:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "limit(Bx,a=0) ;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "limit(Bx,R=0);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "limit(Bz,a=0);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "series(Bx,a=0,1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "series(Bx,R=infinity,3);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 88 "The following result shows that in leadin g order the B_z component is that of a dipole (" }{TEXT 274 1 "a" } {TEXT -1 30 " plays the role of separation " }{TEXT 273 1 "z" }{TEXT -1 122 "). The area of the current loop times the current is proportio nal to the dipole moment. Note that the displacement in the " }{TEXT 278 1 "x" }{TEXT -1 1 "-" }{TEXT 277 1 "y" }{TEXT -1 53 " plane is fix ed to be a point above the current loop!" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "series(Bz,a=infinity,11);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 92 "We can evaluate the fields numerically once the parameter s are specified. Some examples are:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "evalf(subs(R=0.005,a=0.04,Bz));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "evalf(subs(R=0.005,a=0.04,Bx));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "evalf(subs(R=0.005,a=0.04,diff(Bz,a )));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "Bz1:=evalf(subs(R=0 .005,a=0.04,i_L=1000,Bz));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "Bx1:=evalf(subs(R=0.005,a=0.04,i_L=1000,Bx));" }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 30 "We can generate a mapping for " }{TEXT 276 1 "B" } {TEXT -1 1 "_" }{TEXT 275 1 "x" }{TEXT -1 38 " as a function of height and graph it:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 50 "Bx1a:=una pply(evalf(subs(R=0.005,i_L=1000,Bx)),a):" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 11 "Bx1a(0.04);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "logplot(Bx1a(z),z=0.001..0.2);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 50 "Bz1a:=unapply(evalf(subs(R=0.005,i_L=1000,Bz)),a):" } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "logplot(Bz1a(z),z=0.001..0 .1);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 44 "Note that we have not sta rted the graphs at " }{TEXT 279 1 "a" }{TEXT -1 114 "=0 as the field c omponents diverge at the location of the conductor (which is assumed t o be infinitesimally thin)." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 144 "W e are really interested in both components along a line through the or igin in a plane above the loop. That would allow to draw the field lin es." }}{PARA 0 "" 0 "" {TEXT -1 323 "We repeat the calculation of the \+ field components with a generalized point P2. The integrals are calcul ated by Maple only from version 6.0 on. To show what one can do in suc h a case we define functions that evaluate the parameter integral nume rically (the curve integral has been reduced by parametrizing the curr ent loop)." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "P2:=vector([Q ,0,a]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "rv:=evalm(P2-P1) ;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "r2:=simplify(add(rv[i] ^2,i=1..3));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "r3:=r2*sqrt (r2);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "dB0:=simplify(cros sprod(ds,rv));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 147 "We fix the loo p radius as 0.005, the current at 1000 A, and wish to vary a and Q. Th e remaining parameter integral will be carried out numerically." }} {PARA 0 "" 0 "" {TEXT -1 96 "We also substitute numerical values for t he current and radius so that we can graph the results." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 81 "Bx:=unapply(subs(R=0.005,i_L=1000,1 0^(-7)*i_L*R*Int(dB0[1]/r3,phi=0..2*Pi)),Q,a);" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 19 "evalf(Bx(0.,0.01));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "evalf(Bx(0.01,0.01));" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 22 "evalf(Bx(-0.01,0.01));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 46 "We define the z-component in an analogous way:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 81 "Bz:=unapply(subs(R=0.005,i_L =1000,10^(-7)*i_L*R*Int(dB0[3]/r3,phi=0..2*Pi)),Q,a);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 279 "On the surface it looks as if numerical \+ integration is not much different from knowing the answer in terms of \+ special functions. We show later that we pay a price in computational \+ speed. We perform some simple explorations of the field components usi ng the numerical integration." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{SECT 1 {PARA 3 "" 0 "" {TEXT 281 34 "Exploring B_x and B_y \+ by 2d graphs" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 65 "L1:=[seq([(i -10.5)/10*0.02,Bx((i-10.5)/10*0.02,0.005)],i=1..20)]:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 57 "plot(L1,title=\"B_x as a function of x (above th e wire)\");" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 66 "L1:=[seq([(i -10.5)/10*0.02,Bx((i-10.5)/10*0.02,-0.005)],i=1..20)]:" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 57 "plot(L1,title=\"B_x as a function of x (below \+ the wire)\");" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 379 "Note the change in sign: above the wire and below the wire the transverse component o f the magnetic field has opposite sign! This is the first step towards understanding that the field lines are closed curves around the wire. We can also show that the strength of the B_x component falls off wit h height. Due to the divergence of the function at z=0 we do not conne ct the points." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 67 "L1:=[seq( [(i-10.5)/10*0.005,Bx(0.005,(i-10.5)/10*0.005)],i=1..20)]:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 90 "plot(L1,style=point,symbol=cross,title=\"B_ x as a function of height (crossing the wire)\");" }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 8 "For the " }{TEXT 280 1 "z" }{TEXT -1 11 "-component :" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 65 "L1:=[seq([(i-20.5)/20* 0.04,Bz((i-20.5)/20*0.04,0.005)],i=1..40)]:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 57 "plot(L1,title=\"B_z as a function of x (above the loo p)\");" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 142 "We obtain a strong z-c omponent for the magnetic field at the center of the loop. Outside of \+ the current loop the direction of B_z is reversed." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 63 "L1:=[seq([(i-20.5)/20*0.01,Bz((i-20.5)/20*0 .01,0.0)],i=1..40)]:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 85 "plot(L1,sty le=point,symbol=cross,title=\"B_z as a function of x (crossing the loo p)\");" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 46 "In the immediate vicini ty of the current wire " }{TEXT 266 1 "B" }{TEXT -1 1 "_" }{TEXT 265 1 "z" }{TEXT -1 55 " diverges and changes sign, which is in analogy to the " }{TEXT 264 1 "B" }{TEXT -1 1 "_" }{TEXT 263 1 "x" }{TEXT -1 40 " component's behaviour as a function of " }{TEXT 262 1 "x" }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 53 "At the center the field the field is nearly constant." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 66 "L1: =[seq([(i-20.5)/20*0.02,Bz((i-20.5)/20*0.02,-0.001)],i=1..40)]:" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 62 "plot(L1,title=\"B_z as a function o f x (just below the loop)\");" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 65 "L1:=[seq([(i-20.5)/20*0.01,Bz(0.005,(i-20.5)/20*0.01)],i=1..40)] :" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 60 "plot(L1,title=\"B_z as a funct ion of z (crossing the wire)\");" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 65 "L1:=[seq([(i-20.5)/20*0.01,Bz(0.001,(i-20.5)/20*0.01) ],i=1..40)]:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 62 "plot(L1,title=\"B_z as a function of z (slightly off center)\");" }}}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 163 "Given that we know how to calculate the components \+ we should be able to draw vectors. We need a procedure that generates \+ a plot of arrows based on the functions B_" }{TEXT 316 1 "x" }{TEXT -1 1 "(" }{TEXT 315 1 "x" }{TEXT -1 1 "," }{TEXT 314 1 "z" }{TEXT -1 8 ") and B_" }{TEXT 317 1 "z" }{TEXT -1 1 "(" }{TEXT 313 1 "x" }{TEXT -1 1 "," }{TEXT 312 1 "z" }{TEXT -1 188 "). The Maple function arrowpl ot is used in the next subsection to generate such graphs. The present ation is not very esthetic and one can understand why physicists prefe r field line plots." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {SECT 1 {PARA 3 "" 0 "" {TEXT 267 36 "Exploring B_x and B_y by arrow p lots" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "with(plottools);" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 60 "l2 := arrow([10,10], vector ([0,10]), .2, .4, .1, color=red):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "s:=0.05; # a scale factor" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 149 "L0:=[seq(arrow([(i-10.5)/10*0.01,0.001],vector([s* Bx((i-10.5)/10*0.01,0.001),s*Bz((i-10.5)/10*0.01,0.001)]), .0002, .001 , .1, color=green),i=1..20)]:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 148 "L1:=[seq(arrow([(i-10.5)/10*0.01,0.005],vector([s*Bx((i-10.5)/1 0*0.01,0.005),s*Bz((i-10.5)/10*0.01,0.005)]), .0002, .001, .1, color=b lue),i=1..20)]:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 147 "L2:=[se q(arrow([(i-10.5)/10*0.01,0.003],vector([s*Bx((i-10.5)/10*0.01,0.003), s*Bz((i-10.5)/10*0.01,0.003)]), .0002, .001, .1, color=red),i=1..20)]: " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 74 "PL1:=plot([[-0.005,0],[ 0.005,0]],style=point,color=magenta,symbol=circle):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 87 "display(PL1,L0,L1,L2,view=[-0.015..0.015, -0.006..0.01],axes=boxed,scaling=constrained);" }}}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 88 "Given \+ how clumsy this presentation is we should investigate how to draw the \+ field lines." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 293 "In Maple 6.0 the above integrals for Bx and Bz can be calculat ed in closed form (it takes a about 200 secs on a PII-300). We provide the results of the analytic integration so that Maple 5 users can do \+ the work (expressions transferred by hand!). We start by defining some auxiliary variables." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "Qp :=(Q+R)^2+a^2: Qm:=(Q-R)^2+a^2:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "Qr:=2*sqrt(Q*R/Qp);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 83 "Bxex:=i_L*a/(5*10^(6))/(sqrt(Qp)*Q)*((R^2+Q^2+a^2)*EllipticE(Qr)/Q m-EllipticK(Qr));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 46 "Bxa:=u napply(subs(i_L=1000,R=0.005,Bxex),Q,a):" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 58 "a is the height above the loop, and Q is the displacement ." }}{PARA 0 "" 0 "" {TEXT -1 95 "We compare the previous definition b ased on numerical integration with the new analytic result:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "evalf(Bx(0.002,0.003));" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "evalf(Bxa(0.002,0.003));" }} }{EXCHG {PARA 0 "" 0 "" {TEXT -1 32 "Wonderful! Let's repeat for the \+ " }{TEXT 282 2 "z-" }{TEXT -1 10 "component:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 77 "Bzex:=i_L/(5*10^(6))/sqrt(Qp)*(EllipticE(Qr)*(R^ 2-Q^2-a^2)/Qm+EllipticK(Qr));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 46 "Bza:=unapply(subs(i_L=1000,R=0.005,Bzex),Q,a):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "evalf(Bz(0.002,0.003));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "evalf(Bza(0.002,0.003));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 235 "Marvellous! Does the analytic result wor k faster? (We could also accelerate the numerical integration by selec ting options, such as 10 Digits and _Dexp, but would need to re-define the mapping so that evalf(Int,...) is called directly)" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "t1:=time():" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 38 "seq(evalf(Bz(0.002,0.001*i)),i=1..10);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "time()-t1;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "t1:=time():" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "seq(evalf(Bza(0.002,0.001*i)),i=1..10);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "time()-t1;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 97 "We have 10 times faster results now! Let us attempt a \+ plot of the strength of the magnetic field:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 287 "PL1:=plot([[-0.005,0],[0.005,0]],style=point,colo r=blue,symbol=circle): PL2:=contourplot(evalf(sqrt(Bxa(x,z)^2+Bza(x,z) ^2)),x=-0.04..0.04,z=-0.04..0.04,grid=[50,50],scaling=constrained,cont ours=[0.0005,0.001,0.002,0.005,0.01,0.02,0.05,0.1],filled=true,colorin g=[white,green],axes=boxed):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "dis play(PL1,PL2);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 142 "The magnetic f ield strength is largest at the center. Will this be true also if we i ncrease the radius of the loop? Try it out as an exercise!" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 55 "Let us incorporate an algorithm that plot s field lines:" }}{PARA 0 "" 0 "" {TEXT -1 1280 "In the case of the el ectric field we used a simple algorithm to use the direction of the fi eld to step from location (x_i,y_i) to (x_i+1,y_i+1) in such a way tha t the field line 'trajectory' would have the property that the field v ector form always a tangent to the field line. The stepping was done b y multiplying the field vector by a step-size dt and using x_i+1 = x_i + dt*E_x(x_i,y_i) and likewise for the y-position. This numerical tec hnique amounts to an explicit Euler (extrapolation) method for solving a pair of first-order differential equations for the field line 'traj ectory' [x(t),y(t)]. Note that we put the word 'trajectory' in quotes, as the field lines are fictitious objects: in the electric field case they indicate the direction of the acceleration, i.e., they are not r eal trajectories, as for any real (charged-particle) trajectory the ve locity vector forms a tangent. For magnetic field lines the 'trajector y' does not even point in the direction of acceleration of the charged particle, as the Lorentz force is orthogonal to the magnetic field ve ctor (and the velocity of the particle). Therefore, dt is not a time-s tep, but merely the step for the advancement along the fictitious fiel d line 'trajectory'. So we can think of it as a fictitious time-step. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 820 "For \+ the magnetic field line case the method fails due to an accumulation o f errors along the circular field lines (they become spirals in the nu merical stepping technique). One remedy would be to use a very small s tep dt. This would cost an exorbitant amount of computer time and memo ry, and would eventually lead to other numerical problems. Another rem edy would be to code explictly a higher-order method (implicit, or exp licit-implicit (i.e., predictor-corrector), or a multi-step method suc h as Runge-Kutta). Alternatively we can try to use Maple's dsolve[nume ric] technique. It has the advantage of using an adaptive time-step, a nd carries out error-checking (it reduces the time-step and repeats ca lculations if necessary, or increases dt when desirable) in a way that is hidden from the user (black-box approach)." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 81 "The differential equation s for the components of the field-line 'trajectory' are:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 66 "FE:=diff(xf(t),t)=Bxa(xf(t),zf(t)), diff(zf(t),t)=Bza(xf(t),zf(t)):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 81 "sol:=dsolve(\{FE,xf(0)=0.004,zf(0)=0\},\{xf(t),zf(t)\},numeric ,output=listprocedure):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 " X:=subs(sol,xf(t)): Z:=subs(sol,zf(t)):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "[X(0.01),Z(0.01)];" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 174 "We need to figure out how much fictitious time is needed to ad vance the 'trajectory' for a closed loop. We pick a fixed external val ue of dt to generate a sequence of points:" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 89 "Rt:=[]: dt:=0.005: for it from 1 to 100 do: t_i:=it *dt: Rt:=[op(Rt),[X(t_i),Z(t_i)]]: od:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 123 "PL3:=plot(Rt,style=point,symbol=cross,scaling=constr ained,axes=boxed,view=[-0.01..0.02,-0.01..0.01]): display(PL1,PL2,PL3) ;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 166 "We can add more field lines by generating solutions with different inital conditions. This time w e start outside of the current loop and increase the number of steps: " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 80 "sol:=dsolve(\{FE,xf(0)= 0.01,zf(0)=0\},\{xf(t),zf(t)\},numeric,output=listprocedure):" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "X:=subs(sol,xf(t)): Z:=subs( sol,zf(t)):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 89 "Rt:=[]: dt:= 0.005: for it from 1 to 150 do: t_i:=it*dt: Rt:=[op(Rt),[X(t_i),Z(t_i) ]]: od:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 127 "PL4:=plot(Rt,st yle=point,symbol=cross,scaling=constrained,axes=boxed,view=[-0.01..0.0 2,-0.01..0.01]): display(PL1,PL2,PL3,PL4);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 366 "It is apparent that the density of field lines is higher where the field is stronger. In the region of stronger field a single step dt (of fictitious time) takes as further than in the region wher e the field is weak. Let us add a few more lines (note that we could e asily draw them in different colours as the lines are drawn one at a t ime). We increase the step dt." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 81 "sol:=dsolve(\{FE,xf(0)=0.013,zf(0)=0\},\{xf(t),zf(t)\},numeric ,output=listprocedure):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "X:=subs( sol,xf(t)): Z:=subs(sol,zf(t)):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 88 " Rt:=[]: dt:=0.01: for it from 1 to 260 do: t_i:=it*dt: Rt:=[op(Rt),[X( t_i),Z(t_i)]]: od:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 101 "PL5: =plot(Rt,style=point,symbol=cross,scaling=constrained,axes=boxed,view= [-0.01..0.02,-0.01..0.01]):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 81 "sol:=dsolve(\{FE,xf(0)=0.016,zf(0)=0\},\{xf(t),zf(t)\},numeric,out put=listprocedure):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "X:=subs(sol, xf(t)): Z:=subs(sol,zf(t)):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 88 "Rt:= []: dt:=0.02: for it from 1 to 500 do: t_i:=it*dt: Rt:=[op(Rt),[X(t_i) ,Z(t_i)]]: od:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 135 "PL6:=plo t(Rt,style=point,symbol=cross,scaling=constrained,axes=boxed,view=[-0. 01..0.02,-0.01..0.01]): display(PL1,PL2,PL3,PL4,PL5,PL6);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 15 "The main ideas:" }}{PARA 0 "" 0 "" {TEXT -1 67 "1) the magnetic field lines form closed loops around the conduc tor;" }}{PARA 0 "" 0 "" {TEXT -1 86 "2) the density of the field lines is indicative of the strength of the magnetic field." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 71 "We should explore what happens when we combine current loops to look at" }}{PARA 0 "" 0 "" {TEXT -1 103 "1) a solenoid (approximated by a sequence of current loo ps spaced from each other by a small distance);" }}{PARA 0 "" 0 "" {TEXT -1 273 "2) a pair of Helmholtz coils (to show that if two loops \+ with currents going in the same direction are placed in parallel separ ated by a distance equal to the radius, then a homogeneous field arise s at the center of the set-up). We leave these applications for a subs ection." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{SECT 1 {PARA 3 "" 0 "" {TEXT 268 40 "A pair of current loops: Helmholtz coils " }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 253 "We consider an arrangement of two current loops that are in parallel. We place one loop at height z 0, and the other at height -z0. The fields point in the same direction . Note that the radius of the current loop is 0.005 m as chosen in the main section." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 115 "PL1:=plo t([[-0.005,-0.0025],[0.005,-0.0025],[-0.005,0.0025],[0.005,0.0025]],st yle=point,color=blue,symbol=circle): " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 65 "BHH:=(x,z,z0)->[Bxa(x,z-z0)+Bxa(x,z+z0),Bza(x,z-z0)+B za(x,z+z0)]:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 214 "PL2:=conto urplot(evalf(sqrt(BHH(x,z,0.0025)[1]^2+BHH(x,z,0.0025)[2]^2)),x=-0.01. .0.01,z=-0.01..0.01,grid=[45,45],scaling=constrained,contours=[0.01,0. 02,0.05,0.1,0.2],filled=true,coloring=[white,green],axes=boxed):" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "display(PL1,PL2);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 370 "Assignment: generate contourplots for the magnitudes of the z- and x-components of the magnetic field t o demonstrate that the B_x component vanishes in-between the coils, wh ich is required for homogeneity. The uniform colouring of the field st rength plot at the center then implies that the z-component is uniform there, which is confirmed by the respective contourplot " }}{PARA 0 " " 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 194 "#PL 3:=contourplot(evalf(sqrt(BHH(x,z,0.0025)[1]^2)),x=-0.01..0.01,z=-0.01 ..0.01,grid=[50,50],scaling=constrained,contours=[0.01,0.02,0.05,0.1,0 .2],filled=true,coloring=[white,green],axes=boxed):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "#display(PL1,PL3);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 127 "We draw the field lines for this case to demonstrate the homogeneity of the field in an area enclosed by the two current loops ." }}{PARA 0 "" 0 "" {TEXT -1 135 "We have to avoid the points x=0,z=0 (they could be calculated by taking limits); this is done by adding a small numerical displacement." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 87 "BHH(0.00,0.002,0.0025); #we can't pick x=0 or z=0, we can fake it by adding a small nr." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 86 "FE:=diff(xf(t),t)=BHH(xf(t),zf(t),0.0025)[1],diff(zf(t),t)=BHH(xf( t),zf(t),0.0025)[2]:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 87 "sol :=dsolve(\{FE,xf(0)=0.002,zf(0)=-0.0025\},\{xf(t),zf(t)\},numeric,outp ut=listprocedure):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "X:=su bs(sol,xf(t)): Z:=subs(sol,zf(t)):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 88 "Rt:=[]: dt:=0.002: for it from 1 to 40 do: t_i:=it*dt: Rt:=[op(Rt),[X(t_i),Z( t_i)]]: od:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 123 "PL3:=plot(Rt,style= point,symbol=cross,scaling=constrained,axes=boxed,view=[-0.01..0.01,-0 .01..0.01]): display(PL1,PL2,PL3);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 171 "Note how straight the field line is in the region between the \+ coils. This is a consequence of the vanishing transverse (x-) componen t of the magnetic field in this region." }}{PARA 0 "" 0 "" {TEXT -1 417 "Also note that the contours display strength of the magnetic fiel d. They become complicated outside of the two coils as the transverse \+ component of the magnetic field becomes non-zero, while the longitudin al z-component becomes weaker. These are not equipotential lines (we h ave not introduced the magnetic vector potential at all so far), and t hus there is no need for the field lines to cross them at a right angl e." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 31 "We \+ add a number of field lines:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 87 "sol:=dsolve(\{FE,xf(0)=0.001,zf(0)=-0.0025\},\{xf(t),zf(t)\},num eric,output=listprocedure):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "X:=s ubs(sol,xf(t)): Z:=subs(sol,zf(t)):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 88 "Rt:=[]: dt:=0.002: for it from 1 to 40 do: t_i:=it*dt: Rt:=[op(Rt) ,[X(t_i),Z(t_i)]]: od:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 101 "PL4:=plo t(Rt,style=point,symbol=cross,scaling=constrained,axes=boxed,view=[-0. 01..0.01,-0.01..0.01]):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 89 "sol:=dso lve(\{FE,xf(0)=0.00001,zf(0)=-0.0025\},\{xf(t),zf(t)\},numeric,output= listprocedure):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "X:=subs(sol,xf(t )): Z:=subs(sol,zf(t)):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 88 "Rt:=[]: \+ dt:=0.002: for it from 1 to 40 do: t_i:=it*dt: Rt:=[op(Rt),[X(t_i),Z(t _i)]]: od:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 102 "PL5:=plot(Rt,style=p oint,symbol=cross,scaling=constrained,axes=boxed,view=[-0.01..0.01,-0. 01..0.01]): " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 87 "sol:=dsolve(\{FE,xf (0)=0.003,zf(0)=-0.0025\},\{xf(t),zf(t)\},numeric,output=listprocedure ):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "X:=subs(sol,xf(t)): Z:=subs(s ol,zf(t)):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 88 "Rt:=[]: dt:=0.002: fo r it from 1 to 40 do: t_i:=it*dt: Rt:=[op(Rt),[X(t_i),Z(t_i)]]: od:" } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 101 "PL6:=plot(Rt,style=point,symbol=c ross,scaling=constrained,axes=boxed,view=[-0.01..0.01,-0.01..0.01]):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 87 "sol:=dsolve(\{FE,xf(0)=0.004,zf(0 )=-0.0025\},\{xf(t),zf(t)\},numeric,output=listprocedure):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "X:=subs(sol,xf(t)): Z:=subs(sol,zf(t)):" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 88 "Rt:=[]: dt:=0.002: for it from 1 to 40 do: t_i:=it*dt: Rt:=[op(Rt),[X(t_i),Z(t_i)]]: od:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 102 "PL7:=plot(Rt,style=point,symbol=cross,scaling=c onstrained,axes=boxed,view=[-0.01..0.01,-0.01..0.01]): " }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 37 "display(PL1,PL2,PL3,PL4,PL5,PL6,PL7);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 149 "This demonstration shows that the field is homogeneous in a wide region between the coils, as long as o ne does not move too far away from the center." }}{PARA 0 "" 0 "" {TEXT -1 189 "Note that in a real-life set-up one does not use a singl e current loop (with, e.g., 1 kA current as modeled here), but uses ma ny turns instead with typically up to a few amperes of current." }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 12 "Assignmen ts:" }}{PARA 0 "" 0 "" {TEXT -1 161 "1) Look at the case where the coi ls are displaced by an amount different from the radius of the loop.Qu alitatively compare the homogeneity to the Helmholtz case." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 257 "2) Consider the \+ case when the current is reversed in one of the coils compared to the \+ other. It is straightforward to reverse the sign on one of the [Bx,Bz] pair, but some work is required to figure out good initial values for the field line 'trajectories'." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 65 "BHH:=(x,z,z0)->[ Bxa(x,z-z0)-Bxa(x,z+z0),Bza(x,z-z0)-Bza(x,z+z0)]:" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 115 "PL1:=plot([[-0.005,-0.0025],[0.005,-0.0025] ,[-0.005,0.0025],[0.005,0.0025]],style=point,color=blue,symbol=circle) : " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 214 "PL2:=contourplot(eva lf(sqrt(BHH(x,z,0.0025)[1]^2+BHH(x,z,0.0025)[2]^2)),x=-0.01..0.01,z=-0 .01..0.01,grid=[45,45],scaling=constrained,contours=[0.01,0.02,0.05,0. 1,0.2],filled=true,coloring=[white,green],axes=boxed):" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 17 "display(PL1,PL2);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 62 "Right in the middle there is a region where the fields ca ncel." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 86 "FE:=diff(xf(t),t)= BHH(xf(t),zf(t),0.0025)[1],diff(zf(t),t)=BHH(xf(t),zf(t),0.0025)[2]:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 85 "sol:=dsolve(\{FE,xf(0)=0. 002,zf(0)=0.001\},\{xf(t),zf(t)\},numeric,output=listprocedure):" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "X:=subs(sol,xf(t)): Z:=subs( sol,zf(t)):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 88 "Rt:=[]: dt:= 0.002: for it from 1 to 40 do: t_i:=it*dt: Rt:=[op(Rt),[X(t_i),Z(t_i)] ]: od:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 123 "PL3:=plot(Rt,sty le=point,symbol=cross,scaling=constrained,axes=boxed,view=[-0.01..0.01 ,-0.01..0.01]): display(PL1,PL2,PL3);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{SECT 1 {PARA 3 "" 0 "" {TEXT 269 41 "A sequence of current loops: the solenoid" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 210 "We can use the results for the current l oop to understand the magnetic field of a solenoid. This is only true \+ approximately, as the winding of the wire in a solenoid makes the inte rsection of the wire with the " }{TEXT 271 1 "x" }{TEXT -1 1 "-" } {TEXT 270 1 "z" }{TEXT -1 458 " plane left-right asymmetric. The inter sections on the left should be half a spacing higher (or lower) than t he ones on the right. Nevertheless, we should be able to obtain the ma in features. Note that we have a freedom to choose the spacing, as our current loop is idealized as being generated by an arbitrarily thin c onductor. In practice, for the conductor has to have some cross sectio n to be able to carry a decent amount of current without overheating. " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "Nturn:=6;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "d_s:=0.001;" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 42 "LL:=[seq((i-Nturn/2-0.5)*d_s,i=1..Nturn)];" }} }{EXCHG {PARA 0 "" 0 "" {TEXT -1 117 "We define the two field componen ts separately, and displace the argument by a tiny number to avoid the singularities:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "eta:=eva lf(10^(-Digits)):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 69 "BSOx:= (x,z)->evalf(simplify(add(Bxa(x+eta,z-LL[i]+eta),i=1..Nturn)));" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 69 "BSOz:=(x,z)->evalf(simplify( add(Bza(x+eta,z-LL[i]+eta),i=1..Nturn)));" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 19 "BSOx(-0.005,0.002);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 313 "We show an alternative to the contourplot: we generate a dataset and create a surface plot of the data (this technique can be \+ used also for numerical data imported into Maple). It is faster than u sing contourplot, but it generates 3d graphs as opposed to contourplot . We need to adjust our pointplots accordingly." }}{PARA 0 "" 0 "" {TEXT -1 110 "Suppose we wish to superimpose field lines on a graph of B_z. First we generate a data list of [x,z,B_z(x,z)]:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 88 "DL:=[seq([seq([ix*0.0005,iz*0.0005, BSOz(ix*0.0005,iz*0.0005)],ix=-20..20)],iz=-20..20)]:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 58 "DL[1][21]; # DL is a list of lists \+ of triples (also lists)" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 113 "PL1:=pointplot3d([seq(op([[-0.005,LL[i],0],[0.005,LL[i],0]]),i=1..Ntu rn)],style=point,color=blue,symbol=circle): " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 131 "PL2:=surfdata(DL,contours=[0.02,0.05,0.1,0.2,0. 5],style=patchcontour,shading=z,axes=boxed,labels=[x,z,B_z],orientatio n=[-90,0.01]):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "display(P L2);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 83 "Instead of displaying the points that correspond to the conductor crossings of the " }{TEXT 285 1 "x" }{TEXT -1 1 "-" }{TEXT 284 1 "z" }{TEXT -1 768 " plane we us e the shading algorithm to display as red-blue coding the height of th e surface. The color coding is tricked by the very large (positive and negative) values of the B_z component near the wires (displaying the \+ surface by draging the graph helps to visualize this). The different c olor coding of the field near the conductor crossings for x=R and x=-R is an artificial result caused by the displacement of the mesh by eta . As one approaches a conductor crossing from the left and right (eith er at x=R, or at x=-R) the B_z component blows up with a branch going \+ to positive infinity inside the coil, and a branch going to negative i nfinity outside the coil. In reality the field is finite, as the condu ctor has a finite radius. Note that we cannot constrain " }{TEXT 286 1 "x" }{TEXT -1 5 " and " }{TEXT 287 1 "z" }{TEXT -1 117 " to be displ ayed using the same scale, as the scaling=constrained option works on \+ all three coordinates in 3d graphs." }}{PARA 0 "" 0 "" {TEXT -1 0 "" } }{PARA 0 "" 0 "" {TEXT -1 336 "We leave it as an exercise to draw nega tive contour lines for B_z, and to perform graphs for B_x (positive an d negative). The latter graphs require a careful interpretation. It ma y help to choose a grid in such a way that one stays away from the con ductor as much as possible, so that the color-coding helps in understa nding the height." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 403 "The calculation of field lines in analogy to the case of two current loops is very slow. This must be c aused at least in part by repeated calculations of the field in Maple, and also by the attempt at very high accuracy in dsolve[numeric]. We \+ can try to get faster results with a fixed-step algorithm, but have to be nervous about the accuracy. We could also try different algorithms in dsolve[numeric]." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }} }{EXCHG {PARA 0 "" 0 "" {TEXT -1 172 "We define our own Runge-Kutta pr ocedure. For a simple one-variable version consult: a) Numerical Metho ds texts for the theory behind the algorithm, and b) Robert Israel's: \+ " }{TEXT 283 22 "Calculus the Maple Way" }{TEXT -1 398 " for an implem entation in Maple. Our procedure works with an argument that contains \+ a list [t,y1,...,yn] where x is the independent variable, and yn the d ependent variables, n=1..N. N has to be specified, as well as a starti ng value of the independent variable (called t1), and a fixed step-siz e h for stepping t. f is a procedure that calculates the right-hand si des of the differential equations." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 65 "RKn:=proc(f,ic:: list,N,t1,h) local tn,yn,ynew,m1,m2, m3,m4,ii,nn;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "tn:=op(1,ic):" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "yn:=[]:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "for nn from 1 to N do:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "yn:=[op(yn),op(1+nn,ic)]: od:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "for ii from 1 to round((t1-tn)/h) do:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "m1:=[]:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "for nn f rom 1 to N do:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "m1:=[op(m1),evalf (f(tn,yn)[nn])]; od:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "m2:=[]:" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "for nn from 1 to N do:" }}{PARA 0 " > " 0 "" {MPLTEXT 1 0 55 "m2:=[op(m2),evalf(f(tn+h/2,evalm(yn+h/2*m1)) [nn])]; od:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "m3:=[]:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "for nn from 1 to N do:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 55 "m3:=[op(m3),evalf(f(tn+h/2,evalm(yn+h/2*m2))[nn])]; o d:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "tn:=tn+h;" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 7 "m4:=[]:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "for nn from 1 to N do:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 49 "m4:=[op(m4),eva lf(f(tn,evalm(yn+h*m3))[nn])]; od:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "ynew:=[]:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "for nn from 1 to N \+ do:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 83 "ynew:=[op(ynew),evalf(yn[nn] +h/6*(m1[nn]+2*(m2[nn]+m3[nn])+m4[nn]))]; od: yn:=ynew;" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 3 "od:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "[tn,o p(ynew)];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "end:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 306 "The procedure defining the RHS is straightforw ard: A list is expected with the derivatives, and we have no direct de pendence on the independent variable t (just the implicit dependence t hrough the field line 'trajectory'). Note that we make a single call t o [BSOx(x,z),BSOz(x,z)] per evaluation of the RHS." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "fn:=proc(t,yn) global BSO;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 38 "[BSOx(yn[1],yn[2]),BSOz(yn[1],yn[2])];" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "end:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 419 "The procedure RKn returns a list which contains the independent a nd dependent variables. We can define a loop to store the intermediate results. In contrast to our previous calculations based on dsolve[num eric] we should check the dependence of the results on the choice of d t! We could, in fact choose a smaller value of dt and store only every jth value (if we think that dt is too large for an accurate integrati on)." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 163 " Implementation details: x_i, and z_i hold the initial values for each \+ Runge-Kutta step; at the end of the RK step they are updated for the n ext cycle (as is t_i). " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 181 "Rt:=[]: dt:=0.002: x_i:=0.004: z_i:=-0.002: for it from 1 to 120 do: \+ t_i:=(it-1)*dt: sol:=RKn(fn,[t_i,x_i,z_i],2,t_i+dt,dt); x_i:=sol[2]: z _i:=sol[3]: Rt:=[op(Rt),[x_i,z_i,0.]]: od:" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 69 "PL3:=pointplot3d(Rt,style=point,symbol=cross,axes=b oxed,color=white):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 181 "Rt:= []: dt:=0.001: x_i:=0.002: z_i:=-0.002: for it from 1 to 120 do: t_i:= (it-1)*dt: sol:=RKn(fn,[t_i,x_i,z_i],2,t_i+dt,dt); x_i:=sol[2]: z_i:=s ol[3]: Rt:=[op(Rt),[x_i,z_i,0.]]: od:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 69 "PL4:=pointplot3d(Rt,style=point,symbol=cross,axes=box ed,color=white):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 180 "Rt:=[] : dt:=0.001: x_i:=0.001: z_i:=-0.002: for it from 1 to 80 do: t_i:=(it -1)*dt: sol:=RKn(fn,[t_i,x_i,z_i],2,t_i+dt,dt); x_i:=sol[2]: z_i:=sol[ 3]: Rt:=[op(Rt),[x_i,z_i,0.]]: od:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 69 "PL5:=pointplot3d(Rt,style=point,symbol=cross,axes=box ed,color=white):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 181 "Rt:=[] : dt:=0.001: x_i:=0.003: z_i:=-0.002: for it from 1 to 100 do: t_i:=(i t-1)*dt: sol:=RKn(fn,[t_i,x_i,z_i],2,t_i+dt,dt); x_i:=sol[2]: z_i:=sol [3]: Rt:=[op(Rt),[x_i,z_i,0.]]: od:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 69 "PL6:=pointplot3d(Rt,style=point,symbol=cross,axes=box ed,color=white):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 180 "Rt:=[] : dt:=0.001: x_i:=0.00: z_i:=-0.002: for it from 1 to 100 do: t_i:=(it -1)*dt: sol:=RKn(fn,[t_i,x_i,z_i],2,t_i+dt,dt); x_i:=sol[2]: z_i:=sol[ 3]: Rt:=[op(Rt),[x_i,z_i,0.]]: od:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 69 "PL7:=pointplot3d(Rt,style=point,symbol=cross,axes=box ed,color=white):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 182 "Rt:=[] : dt:=0.001: x_i:=-0.001: z_i:=-0.002: for it from 1 to 100 do: t_i:=( it-1)*dt: sol:=RKn(fn,[t_i,x_i,z_i],2,t_i+dt,dt); x_i:=sol[2]: z_i:=so l[3]: Rt:=[op(Rt),[x_i,z_i,0.]]: od:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 69 "PL8:=pointplot3d(Rt,style=point,symbol=cross,axes=box ed,color=white):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "display (PL2,PL3,PL4,PL5,PL6,PL7,PL8);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 124 "Of course, the open-ended field lines do close as the right-most \+ one does. We started the field lines with equal spacing in " }{TEXT 288 1 "x" }{TEXT -1 77 ". They remain equally spaced inside the soleno id on account of the fact that " }{TEXT 290 1 "B" }{TEXT -1 1 "_" } {TEXT 289 1 "x" }{TEXT -1 57 " is very small there. We suspect that th e field strength " }{TEXT 291 1 "B" }{TEXT -1 1 "_" }{TEXT 292 1 "z" } {TEXT -1 4 " at " }{TEXT 293 1 "x" }{TEXT -1 168 "=0 can not vary too \+ much inside the solenoid, or the field would not be as homogeneous as \+ it appears to be. Let us check by calculating and plotting the two com ponents." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 56 "DL1:=[seq([iz*0 .0001,BSOz(0.,iz*0.0001)],iz=-100..100)]:" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 59 "DL2:=[seq([iz*0.0001,BSOz(0.003,iz*0.0001)],iz=-100 ..100)]:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "LL1:=[seq([LL[i ],0.],i=1..nops(LL))]:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 173 " PL0:=plot(LL1,style=point,color=blue,symbol=circle): PL1:=plot(DL1,col or=red): PL2:=plot(DL2,color=green): display(PL0,PL1,PL2,axes=boxed,ti tle=\"B_z(x0,z) inside the coil\");" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 57 "We see that the strength of the magnetic field component " } {TEXT 295 1 "B" }{TEXT -1 1 "_" }{TEXT 294 1 "z" }{TEXT -1 104 " does \+ rise inside the coil. In other words, the field is not as uniform as s uggested by the field lines." }}{PARA 0 "" 0 "" {TEXT 298 1 "B" } {TEXT -1 1 "_" }{TEXT 299 1 "z" }{TEXT -1 111 " as calculated off-axis is stronger inside the coil, and somewhat weaker outside than the on- axis result (red, " }{TEXT 300 1 "x" }{TEXT -1 206 "=0). Presumably fo r a longer solenoid a homogeneous field can be guaranteed inside the c oil. We leave it as an exercise to increase the number of current loop s, and to repeat the calculations for that case." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 12 "How well is " }{TEXT 297 1 "B" }{TEXT -1 1 "_" }{TEXT 296 1 "x" }{TEXT -1 143 " expelled from t he inside of the solenoid? Let us calculate it at heights in-between t he current loops beginning near the edge of the solenoid " }}{PARA 0 " " 0 "" {TEXT -1 30 "and moving towards the center:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 59 "DL1:=[seq([ix*0.0001,BSOx(ix*0.0001,0.002)] ,ix=-100..100)]:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 59 "DL2:=[s eq([ix*0.0001,BSOx(ix*0.0001,0.001)],ix=-100..100)]:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 60 "DL3:=[seq([ix*0.0001,BSOx(ix*0.0001,-0.00 1)],ix=-100..100)]:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 210 "PL0 :=plot([[-0.005,0],[0.005,0]],style=point,color=blue,symbol=circle): P L1:=plot(DL1,color=red): PL2:=plot(DL2,color=green): PL3:=plot(DL3,col or=magenta): display(PL0,PL1,PL2,PL3,axes=boxed,title=\"B_x(x,z0)\"); " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 190 "We see that the transverse c omponents of the magnetic fields from neighbouring current loops do no t cancel each other perfectly near the edge of the model solenoid, but do so at the center (" }{TEXT 301 1 "z" }{TEXT -1 311 "0=0). Neverthe less, to put things in perspective: the chosen locations are very clos e to the conductor, and strong fields have been subtracted from each o ther. To understand the cancellation one can compare the cancelling co ntributions from loops 1 and 2 (e.g., at the top) with the sum from th e next few loops:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 91 "Bxa(0. 005,-0.0005),Bxa(0.005,0.0005),Bxa(0.005,0.0015)+Bxa(0.005,0.0025)+Bxa (0.005,0.0035);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 90 "We see that th e edge effects, i.e., the inhomogeneities are caused by the lack of ba lance." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 245 "We learn that the field inside the solenoid is not very homogeneo us. Our naive argument, where we have taken equally spaced initial con ditions for the field line trajectories, coupled with the observation \+ that they remain parallel has misled us." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 111 "We conclude the workshet with a f urther analysis of properties of the magnetic field for a simple curre nt loop." }}}{SECT 1 {PARA 3 "" 0 "" {TEXT 306 37 "div B and curl B fo r the current loop" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 180 "We have sta ted above that the two components of the magnetic field are really the transverse and longitudinal components respectively. Thus, in cylindr ical coordinates we have the " }{TEXT 303 1 "z" }{TEXT -1 54 "-compone nt as defined. and what was calculated as the " }{TEXT 302 1 "x" } {TEXT -1 241 "-component is really the component along the radial dire ction. Due to the symmetry of the field (circular current loop) there \+ is no phi-component of the magnetic field. We re-define our previously calculated components, and use the variable " }{TEXT 304 1 "r" } {TEXT -1 189 " to specify the cylindrical radial variable (often denot ed by rho, to set it apart from the spherical radial coordinate). We d o not specify the amount of current, or the radius of the loop " } {TEXT 305 1 "R" }{TEXT -1 1 "." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 35 "restart; with(linalg): with(plots):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "Qp:=(Q+R)^2+a^2: Qm:=(Q-R)^2+a^2:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "Qr:=2*sqrt(Q*R/Qp);" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 83 "Brex:=i_L*a/(5*10^(6))/(sqrt(Qp)*Q)*((R^2+Q^2+a^2)* EllipticE(Qr)/Qm-EllipticK(Qr));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "Bra:=unapply(Brex,Q,a):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 77 "Bzex:=i_L/(5*10^(6))/sqrt(Qp)*(EllipticE(Qr)*(R^2-Q^2-a^2)/Qm+Ellipti cK(Qr));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "Bza:=unapply(Bzex,Q,a): " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 244 "The first property we wish t o demonstrate is the fact that there are no magnetic charges, i.e., th at the B field is divergence free. The divergence in cylindrical coord inates is given as follows [it is part of the linalg package loaded be fore]:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 103 "B := vector([Br( r,z), 0, Bz(r,z)]): v := vector([r, phi, z]):\ndivB:=diverge(B, v, co ords=cylindrical);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 87 "Here we hav e made use of the fact that there is no phi-component of the magnetic \+ field." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 105 "Let us see what the calculation tells us about the divergence of \+ the magnetic field for the current loop." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 63 "divBcl:=simplify(subs(Br(r,z)=Bra(r,z),Bz(r,z)=Bza(r, z),divB));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 190 "Indeed, the magnet ic field for the current loop is divergence-free. The student is encou raged to look at the result before the simplify command is applied to \+ see how the cancellation occurs." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 386 "We can continue with a calculation of th e curl. According to Maxwell's equations the curl of the vector field \+ B should be related to the rate of change of electric fields, and the \+ current density. If we assume that we have no electric field present, \+ and if we stay away from the current loop (assumed to be of infinitesi mal extent), then we should calculate that the field is curl-free." }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 92 "B := vector([Br(r,z), 0, Bz (r,z)]): v := [r, phi, z]:\nrotB:=curl(B, v, coords=cylindrical);" }} }{EXCHG {PARA 0 "" 0 "" {TEXT -1 117 "The reader is encouraged to look at the expression in the general case with non-vanishing phi-componen t of the field." }}{PARA 0 "" 0 "" {TEXT -1 150 "For our special case \+ of the current loop we have the following [note that the subs command \+ has to substitute into a vector quantity, thus the op()!] :" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 67 "rotBcl:=simplify(subs(Br(r,z )=Bra(r,z),Bz(r,z)=Bza(r,z),op(rotB)));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 74 "It is worthwhile to look at the individual parts that get cancelled below." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 54 "simpli fy(diff(Bra(r,z),z))-simplify(diff(Bza(r,z),r));" }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 476 "We can arrive at a more general conclusion: whene ver the situation is as simple as discussed here from a symmetry point of view (vanishing phi-component), the two statements (divergence-fre e, and curl-free properties of the magnetic field; the first statement is always true, the second requires no time-varying electric fields, \+ and no current density in the spatial region considered) can be combin ed to relate variations in the radial and transverse components of the field." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 179 "We finish with the remark that the analy tic expressions for the magnetic field components of the current loop \+ are used in MagBottle.mws to calculate charged-particle trajectories. " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{MARK "0 0 0" 6 } {VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }