# Magnetic Field Map (Axisymetric geom)

In this example, we will compute the "ideal" magnetic field produced by a test insert described using MagnetTools format.

## 1. Running the case

To run this example on MSO4SC portal see this section.

### 1.1. Magnet Geometry

 To get the geometry, you can use: ``B_Map --gnuplot HL-31.d > geom.dat`` Edit `geom.dat` and keep only lines between: ``````PolyHelices data for HL-31.d ... ... UnifMagnets data for HL-31.d ...`````` Plot the geometry with `gnuplot`: ``````gnuplot> set size ratio -1 gnuplot> set style data li gnuplot> plot "HL-31-geom.dat" title "PolyHelices", "HL-31-Bitter-geom.dat" title "Bitters" gnuplot> set xrange [0:0.7] gnuplot> set yrange [-0.4:0.4]``````

### 1.2. Magnet Field

To compute the magnetic field:

``B_map --interactive HL-31.d``

then enter the data for:

• Helix input current,

• Bitter input current,

• and eventually Supra outsert input current.

and set the ranges for the plot:

• $r_0$, $r_1$,

• $z_0$, $z_1$

and the number of points in each direction

• $n_r$, $n_z$

 Watchout default unit is set to meter for the position range.

The result is stored in `HL-31_FieldMap.dat`.

 On first run, you will need to enter some more parameters before entering the currents and plot ranges data if you don’t have an `eps_params.dat` file in your directory. On MSO4SC Data Catalogue this file is already included in the dataset.

For instance using the default current params, you get the following magnetic field $B_z$ profile along $Oz$ axis.

There are others usefull options to carry out calculation on list of points and so on.

See here for details.

## 2. Data files

The data files may be retreived from Data Catalogue. See the dataset HL-31 in Lncmi collection.

The gzipped archive tarball `HL-31-ana.tgz` contains all the files needed.

### 2.1. Magnet Cfg file

• `HL-31.d`

## 3. Outputs

The value of Magnetic Field in cylindrical coordinates at $(r=0,z=0)$ is: $(0,37.8622880853634)$

To view the result with `gnuplot` in the remote desktop, type the following command:

``plot "HL-31_FieldMap.dat" using 2:4``