Example # 7 : ESRF Quadrupole in 2D and 3D using Automatic Triangulation

Version : 0.6 of 13th April 2008  by J. Chavanne, O. Chubar, P. Elleaume
This notebook example requires Mathematica 6.0 and Radia 4.25 or higher to execute. It makes use of the automatic mesh generation of extruded Triangle borrowed from Jonathan Richard Shewchuk (http://www.cs.cmu.edu/~quake/triangle.html).
It computes in 2D and 3D the field from the storage ring quadrupole of the ESRF. The simulation of any other quadrupole can be derived from this notebook by changing the routines / parameters in the "Iron, Coil, Yoke and Build Functions" section. Dipole and sextupole could also be bilt in a similar fashion.
To run, one must first execute all cells of the next section (Iron, Coil, Yoke and Build Functions) which  execute rapidly. Graphics production and field solving as well as post-processing takes more time and are triggered by the execution of the cells in the other sections ("2 - Dimensional Simulation" and "3 - Dimensional Simulation"). Some of the cells may take a lot of time to execute. Take your time to explore this notebook. Start with 2D computation and then move to 3D when you fill at ease. Read all comments written in each cell. This example is longer and quite more involved than any one of the examples 1 to 6.

Iron, Coil, Yoke and Build Functions

Introduction

The quadrupole is defined through the:
- "B vs H" ("M vs H") dependence of the iron type material;
- Coil geometrical parameters;
- Yoke geometrical parameters.
The figure below defines a number of variables used in the following functions to built the quadrupole.

Example7_1.gif

Load and Initialize Radia

Example7_2.gif

Example7_3.png

Example7_4.png

Example7_5.png

Example7_6.png

Example7_7.png

Iron Functions

Defining non-linear "M vs H" dependence for iron-type material

Example7_8.png

Example7_9.gif

Example7_10.gif

Coil Functions

Auxiliary function to be used for the definition of coils

Example7_11.png

Yoke Functions

Auxiliary functions defining the yoke boundary

Example7_12.gif

Draw the contor of the lamination

Example7_13.gif

Example7_14.gif

Build 2D Functions

Defining the "Build" function for 2D Geometry

Example7_15.png

Defining the general "Solve" function and auxiliary functions for 2D case

Example7_16.gif

Build 3D Functions

Defining the "Build" function for 3D Geometry

Example7_17.png

Auxiliary functions for 3D case

Example7_18.gif

2 - Dimensional Simulation

Introduction

To simulate the qaudrupole in 2D, the yoke is created with a single layer of very large thickness.

Show in 2D  

Instantiating the Quadrupole and compute the memory requirement

Example7_19.gif

Example7_20.png

Example7_21.png

Show  the Geometry

Example7_22.png

Example7_23.gif

Example7_24.png

Example7_25.gif

Solve in 2D

Solving

Example7_26.gif

Example7_27.png

Example7_28.png

Example7_29.png

Example7_30.png

Example7_31.png

Example7_32.png

Example7_33.png

Example7_34.png

Example7_35.png

Example7_36.png

Example7_37.png

Example7_38.png

Example7_39.png

Example7_40.png

The following computation assumes a linear magnetic material with relative permeability  mu.  This is usefull to compare with the prediction of the Ampere Theorem. Note that with infinite permeability, the only difference with the Ampere Theorem comes from the multipole content and imperfect segmentation.

Example7_41.gif

Example7_42.png

Example7_43.png

Example7_44.png

Example7_45.png

Post-Processing in 2D

Harmonic Analysis

The Harmonic Analysis to compute the multipole content around an axis requires the calculation of the field at equidistant points over a circle of radius R. The precision depends on the value of the radius R in relation to rint (the inscribed radius of the quadrupole). The optimal precision is reached if one uses R value not in the immediate vicinity of 0 or rint. A value between 1/4 rint and 3/4 rint is safe. One may want to check that the harmonic content weakly depends on R

Example7_46.gif

Example7_47.png

Example7_48.png

Example7_49.png

Example7_50.png

Example7_51.png

Example7_52.png

Example7_53.png

Example7_54.png

Example7_55.png

Field Plot

Example7_56.gif

Graphics:Mid-Plane Vert. Field [T] vs Horiz. Pos.[mm]   Computed Directly (line)   Reconstructed from multipoles (dots)

Gradient Homogeneity

Example7_58.gif

Graphics:Mid-Plane Rel. Gradient Variation   vs Horizontal Position [mm]   Computed Directly (line)   Reconstructed from multipoles (dots)

Field and Magnetization Line Plots

Example7_60.gif

Graphics:None

Graphics:None

Energy and Inductance in 2D

Auxiliary Functions

Example7_63.png

  Energy and Self-Inductance

Example7_64.gif

Example7_65.png

Gradient vs Current in 2D

Example7_66.gif

Example7_67.png

Example7_68.png

Example7_69.png

Graphics: 2D On-Axis Gradient [T/m] vs Current [A]

Example7_71.png

Example7_72.png

Example7_73.png

3 - Dimensional Simulation

Introduction

This part concerns the 3D simulation of the same quadrupole. The yoke is created with its actual length. The extremities of the pole are machined to generate the chamfer. The model is created with a number of layers along the beam axis (longitudinal segmentation). At the end, the multipole expansion is computed as well as the magnetic length of the quadrupole. The accurate computation requires a large longitudinal segmentation and the memory requirement is significant. For this type of computation, the time longer than 10 minutes, as well as memory well above 200 MB are required.

Show in 3D  

Instantiating the Quadrupole and compute the memory requirement

Example7_74.gif

Example7_75.png

Example7_76.png

Show  the Geometry

Example7_77.png

Example7_78.gif

Example7_79.png

Example7_80.gif

Solve in 3D

Solving

The solving time and memory requirement largely depends on nz (the longitudinal segmentation).To debug and accelerate the computation use e.g. nz = {2, 1}, the price is a poor absolute precision. For lmag = 400, some stability of the gradient versus horizontal position as well as magnetic length is obtained with nz = {32, 1}, which need quite some cpu and memory. In practice one must increase nz[[1]] to check the stability of the result.

Example7_81.gif

Example7_82.png

Example7_83.png

Example7_84.png

Example7_85.png

Example7_86.png

Example7_87.png

Example7_88.png

Example7_89.png

Example7_90.png

Example7_91.png

Example7_92.png

Example7_93.png

Example7_94.png

Example7_95.png

Post-Processing in 3D

Harmonic Analysis

The Harmonic Analysis to compute the multipole content around an axis requires the computation of the field on equidistant points over a circle of radius R. The precision depends on the value of the radius R in relation to rint (the inscribed radius of the quadrupole). The optimum precision is reached if one uses a R value not in the immediate vicinity of 0 or rint. A value between 1/4 rint and 3/4 rint is safe. One may want to check that the harmonic content weakly depends on R.

Example7_96.gif

Example7_97.png

Example7_98.png

Example7_99.png

Example7_100.png

Example7_101.png

Example7_102.png

Example7_103.png

Example7_104.png

Example7_105.png

Field Integral Plot

Example7_106.gif

Graphics:Mid-Plane Vert. Field Integral [T.m]   vs Horiz. Position [mm]   Computed Directly (line)   Reconstructed from Multipoles (dots)

Gradient along Horizontal Coordinate

Example7_108.gif

Graphics:Mid-Plane Rel. Gradient Variation   vs Horizontal Position [mm]   Computed Directly (line)   Reconstructed from Multipoles (dots)

Gradient along the Quadrupole

Example7_110.gif

Graphics:Mid-Plane Gradient [T/m]   vs Long. Position [mm]

Field and Magnetization Line Plots near the Pole Boundary

Example7_112.gif

Graphics:None

Graphics:None

Energy and Inductance in 3D

Auxiliary Functions

Example7_115.png

Magnetic Energy and Self-Inductance

Example7_116.gif

Example7_117.png

Gradient vs Current in 3D

If you are ready to wait some ~30 minutes, depending on your CPU, run this section ...

Example7_118.gif

Example7_119.png

Graphics:3D On-Axis Int. Gradient [T] vs Current [A]

Integrated Gradient and Multipole vs. Horizontal Position as a function of Segmentation, Chamfer dimension, Current,  ...

Example7_121.png

Example7_122.png

Example7_123.png

Example7_124.png

Example7_125.png

Example7_126.png

Example7_127.png

Example7_128.png

Example7_129.png

Graphics:  Segmentation : {2, 1}

Created with the Wolfram Language