Version : 0.3

Introduction

This example consists in the creation of a set of racetrack and circular coils, plotting the coil geometry and the magnetic field produced. This geometry corresponds to a 4T superconducting wiggler presently in operation at the ESRF. It is assumed that the reader has some experience with Mathematica and that he has successfully run Example #1.
Evaluate sections in the order of presentation: "Load and Initialize Radia" followed by "Build the Geometry", "Plot the Geometry", "Plot the Magnetic Field" and "Plot the Field Integrals".
If successful, try to modify some parameters (see the Reference Guide for the explanations on the Radia functions) and re-execute the corresponding section. All sections must be evaluated in the order of presentation. A section may be evaluated several times with the same or different parameters if the previous sections have been evaluated before. The only limitation is memory. The Radia.exe memory can be re-initialized by re-executing the section entitled "Load and Initialize Radia". The Kernel memory can be re-initialized by calling Exit[] and then re-executing all sections of this example. If the Front-End is running out of memory, close some windows or close the Front-End and start it again. Note that if by mistake any section is executed before the previous ones are executed, it may be necessary to exit the Kernel and re-start everything from the very beginning.

Load and Initialize Radia

The following instruction loads the Radia package and returns the Radia version number.

 

<<Radia`;
[Graphics:Example2gr2.gif][Graphics:Example2gr1.gif]
[Graphics:Example2gr2.gif][Graphics:Example2gr3.gif]

Build the Geometry

These instructions define 4 racetrack coils and one circular coil together with their mirror symmetric counterparts. j1 and j2 are current densities in the coils.

 

RadUtiMem[];

(* Current Densities in A/mm^2 *)
j1=128;j2=256;

(* Coil Presentation Parameters *)
n1=3;n2=6;c2={1,0,0};c1={0,1,1};thcn=0.001;

(* Create 5 Coils *)
Rt1=radObjRaceTrk[{0.,0.,38.},{9.5,24.5},{120.,0.},36,n1,j1];
radObjDrwAtr[Rt1,c1,thcn];
Rt3=radObjRaceTrk[{0.,0.,76.},{10.,25.},{90.,0.},24,n1,j1];
radObjDrwAtr[Rt3,c1,thcn];
Rt2=radObjRaceTrk[{0.,0.,38.},{24.5,55.5},{120.,0.},36,n1,j2];
radObjDrwAtr[Rt2,c2,thcn];
Rt4=radObjRaceTrk[{0.,0.,76.},{25.,55.},{90.,0.},24,n1,j2];
radObjDrwAtr[Rt4,c2,thcn];
Rt5=radObjRaceTrk[{0.,0.,60.},{150.,166.3},{0.,0.},39,n2,-j2];
radObjDrwAtr[Rt5,c2,thcn];

Grp=radObjCnt[{Rt1,Rt2,Rt3,Rt4,Rt5}];

(* Define Mirror Coils *)
RadTrfZerPara[Grp,{0,0,0},{0,0,1}];

Plot the Geometry

These instructions plot the geometry of coils previously created.

 

(* Special Options for the Plot[]*)
RadPlot3DOptions[];

(* Save the Geometry in "dr" *)
dr=radObjDrw[Grp];

(* Draw the Geometry *)
Show[Graphics3D[dr
,PlotLabel->FontForm["SCW",{"Times",14}]
,DefaultFont -> {"Times",10}]];

[Graphics:Example2gr2.gif] [Graphics:Example2gr4.gif]

Plot the Magnetic Field

The magnetic field vertical component profile is plotted along the y axis.

 

RadPlotOptions[];
Plot[radFld[Grp,"Bz",{0,y,0}],{y,0,300}
,AxesOrigin->{0,0}
,FrameLabel->{"Y [mm]","Bz [T]","X = Z = 0",""}];

[Graphics:Example2gr2.gif] [Graphics:Example2gr5.gif]

Plot the Field Integrals

This plots the vertical field integral along y for the transverse coordinates x varying from -400 to 400 mm.

 

Plot[radFldInt[Grp,"inf","ibz",{x,-300,0},{x,300,0}]
,{x,-400,400}
,FrameLabel->{"X [mm]","IBz [T mm]","Z = 0",""}];

[Graphics:Example2gr2.gif] [Graphics:Example2gr6.gif]