16.12.2012 Views

Computer Algebra Recipes

Computer Algebra Recipes

Computer Algebra Recipes

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

4.2. SECOND-ORDER MODELS 177<br />

component is allowed to vary with z according to a hyperbolic cosine function.<br />

The function Bz is taken to be constant inside the region z = ¡0:5 to0:5 and<br />

allowed to grow linearly stronger outside this region.<br />

> Br:=piecewise(z(t)>1,cosh(z(t)),z(t) Bz:=piecewise(abs(z(t)) B1:=subs(fx(t)=x,z(t)=z,y(t)=0g,B[1]):<br />

B3:=subs(fx(t)=x,z(t)=zg,B[3]):<br />

She uses the fieldplot command to represent the direction and magnitude<br />

of the ¯eld with thick red arrows. A cross-sectional plot of the symmetrical<br />

magnetic ¯eld is shown in Figure 4.8. Note that the size of the arrows is an<br />

indication of ¯eld strength, bigger arrows for stronger ¯elds. The ¯eld con¯guration<br />

shown in the ¯gure should allow magnetic bottle behavior.<br />

> fieldplot([B3,B1],z=-1.5..1.5,x=-1..1,arrows=THICK,grid=<br />

[15,15],color=red,scaling=constrained,tickmarks=[3,3]);<br />

x<br />

1<br />

–1 0<br />

1<br />

z<br />

–1<br />

Figure 4.8: Magnetic ¯eld con¯guration to produce a magnetic bottle.<br />

To animate the motion of a charge in her magnetic bottle, Vectoria chooses the<br />

nominal mass and charge values m =1andq = 1 and the initial conditions

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!