Notes


1. Subdivision

After you have properly described your geometry and before solving the problem, you have to pay a special attention to the subdivision of the volumes into number of sub-volumes.

Why the subdivision is needed?

The computation method used by Radia assumes uniform magnetization in each volume. This is not a problem for a piece of permanent magnet which permeability is close to 1 and for which the magnetization is rather uniform over the volume. However, this is a drastic assumption for iron (or any linear or non-linear material with large permeability) in which the magnetization is known to be non-uniform depending on the geometry. To avoid this difficulty, one must segment the iron into smaller volumes by calling the function radObjDivMag[...]. As a result, the iron volumes will be segmented into a number of smaller volumes in which the magnetization will be assumed uniform. Iron pieces do normally require much stronger subdivision than permanent magnet blocks (this does not mean that permanent magnets should not be subdivided at all).

On the other hand, please take into account that in 3D, the number of volumes after subdivision grows very quickly, and the size of Interaction Matrix needed for the solution scales proportionally to square of the number of these volumes. So it could be a good strategy to try to perform computation with minimal subdivision needed for a desired accuracy.  

How to choose the optimal subdivision?

In the current version of Radia, no mechanism for automatic subdivision is provided. A user has to make a number of iterations by specifying different subdivision parameters for the geometry, solving, checking the magnetic field in some control point(s), changing the subdivision parameters, etc. The iterations should stop when the magnetic field in the control point(s) is stable at the desired accuracy level. We recommend to tune the subdivision numbers for different directions separately: for example, first find the sufficient subdivision in horizontal direction with no or minimal subdivision in longitudinal and vertical directions, then find the sufficient subdivision in longitudinal direction with the previously found subdivision value for horizontal direction, etc. The subdivision can be applied at once to the whole geometry (i.e. to the container in which all the objects are present) or to different parts of the geometry separately. The latter case is favorable when different parts actually require different subdivision. To have a visual representation of the subdivided object obj, call Show[Graphics3D[radObjDrw[obj]]]. The subdivision will be shown by lines on the object surface.


2. Relaxation

The Relaxation is an important step of solving a problem. The purpose of the Relaxation is to find the magnetization values for all the volumes, that satisfy, at a given accuracy level, the given geometry and material relations. The Relaxation is executed by the function  radRlxAuto[intrc, prec, maxiter] which requires reference to the Interaction Matrix (intrc), absolute accuracy with respect to magnetization (prec) and maximum number of iterations allowed to be done while trying to reach the specified absolute accuracy (maxiter). We note that the radRlxAuto function is automatically called by the function RadSolve[obj, prec, maxiter], the latter requiring a reference to the object describing the geometry (obj) rather than the corresponding Interaction Matrix (the Interaction Matrix is created by this function automatically). Both functions have the same output: a list of four numbers {AvPrec, Mmax, Hmax, Niter}, where AvPrec is an average absolute change in magnetization after last iteration over all non-subdivided objects participating in the relaxation, Mmax is maximum absolute value of magnetization over all the objects, Hmax is maximum absolute value of magnetic field strength over central points of all the objects, Niter is actual number of iterations done.

It is very important:

(a) to set a proper absolute precision level (prec) and maximum number of iterations (maxiter) when calling the function radRlxAuto[...] or RadSolve[...]. For a field of 1 T, a typical value of prec is 0.0001 T and a typical value of maxiter is 1000. Do not hesitate to reduce/enlarge prec further in order to check that the field is sufficiently stable. The smaller prec the more accurate is the field.

(b) to ensure that, in the output of the function radRlxAuto[...] and RadSolve[...],  the parameters:   AvPrec is smaller than prec and Niter is smaller than maxiter.  If not, the relaxation should be declared unsuccessful. There are two main cases for which relaxation can be unsuccessful. It can either be that maxiter is set to a too low value or that there is a problem in the geometry and segmentation resulting in some divergence during the relaxation. We have faced the problem of unsuccessful relaxation in some cases.

 



Known Problems


1. Unsuccessful relaxation

In most of the cases tested, the automatic relaxation function radRlxAuto[intrc, prec, maxiter, meth :3] gives good results. The signs of successful relaxation are: (1) average absolute change in magnetization between the last two iterations over all the objects participating in the relaxation (the first number in the function return list) is smaller then the value of the prec variable; (2) actual number of iterations done (the last number in the function return list) is smaller than the value of the maxiter variable.

However it may happen that the function radRlxAuto[...] gives no signs of successful relaxation. This may occur when the object under relaxation has an unfavorable shape, such as one dimension being much smaller or larger than the other two.

Try to change subdivision parameters or re-structure the objects in order to obtain closer dimensions for each of the (sub-) objects.


2. Memory not fully recovered

Situations may be encountered where the memory is not fully recovered following the execution of radUtiDel[...] or RadSolve[...]. Such situations may occur when a number of iterations in which a geometry is created and relaxed are made, and the newly-created objects are not deleted after use.

To eliminate this problem, call the function radUtiDelAll[] to free all memory in Radia.exe each time the geometry is re-created. After calling radUtiDelAll[], all the required objects, materials, transformations, interaction matrix, etc., need to be re-created as well. If still in doubt, reload Radia.exe by executing <<Radia` again, which results in the most drastic initialization.


3. Intermittent division zero by zero

Each object producing magnetic field can be represented as a volume limited by polygons. For example the object created by radObjRecMag[...] is a parallelepiped limited by 6 rectangles. If one computes the magnetic field at a point which is exactly in the same plane as one of these rectangles, the computation may result in division of zero by zero, and an error is reported. To remove these indeterminations, a randomization of the position and dimensions of the objects has been implemented. At creation, the position and the dimensions of all the objects are slightly changed in a random fashion. The amount of randomization is controlled by the function radFldLenTol[abs, rel, zero :0].  This function is called when the Radia.m is loaded, with parameters abs, rel, zero optimal for the geometries in the scale of several meters. However, if you are going to solve the problems in strongly different scale of lengths, you may still face the problem in question.

Try to call the radFldLenTol[abs, rel, zero :0] function with parameters more suitable to the problem. For a detailed explanation of the function action, please refer to the Reference Guide.


4. "Artificial" discontinuity of the field components inside subdivided objects and poor field precision outside the objects very close to their surfaces

With the field computation method used, any non-subdivided object created by radObjRecMag[...] or radObjThckPgn[...] or radObjPolyhdr[...] is treated as the one having constant magnetization inside. Any subdivided object consists of a number of non-subdivided sub-objects. After the relaxation of a subdivided iron object, the magnetizations inside the sub-objects are set to values corresponding to the minimum of the total interaction energy. However, these values are still treated as being constants within the sub-objects. As a result of this: (a) the computed field from the general subdivided object has artificial discontinuities at the borders between any adjacent sub-objects, (b) the field computed outside, yet very close to the surface of the subdivided object, may appear disturbed according to the particular subdivision.

The situation outside the subdivided objects (b) can be improved by increasing the subdivision. Normally, the field disturbance disappears at a distance from the object border larger than average size of the sub-objects. Further improvements to the field computation method are planned.


5. Corrupted graphics

From time to time, graphical presentation of 3D objects created by the Mathematica-Radia commands  Show[Graphics3D[radObjDrw[...]]] may appear slightly corrupted (like small pieces of faces are missing or extra lines are shown). Typically, this may happen when subdivided volumes are presented. The reason for this corruption is, probably, a kind of inconsistency between the drawing method used by Mathematica and randomization of objects' coordinates applied by Radia to avoid field computation problems.

One way to improve the graphical presentation is to execute the command radFldLenTol[abs, rel] with abs=rel=0 before creating and drawing the geometry. However, this may result in run-time errors at any field computation done with the geometry created this way. So, before making any computation after the above trick was applied, one has to either exit and re-load Radia or execute the command radFldLenTol[abs, rel] with the values of abs and rel adequate to the geometry under study, and re-create the geometry. We note that when Radia is loaded, the function radFldLenTol[abs, rel] is called from init.m file with the default values abs=rel=10^(-9). More detailed information about the function radFldLenTol[abs, rel] and optimal values of the parameters abs and rel can be found in the Reference Guide.

 



Frequently Asked Questions


1. How can I define and use my own material ?

A linear anisotropic material with different susceptibilities in directions parallel and perpendicular to easy magnetization axis can be defined by the function radMatLin[{ksipar,ksiper}, {mrx,mry,mrz}];  a nonlinear isotropic material can be defined by the function radMatSatIso[{ms1,ms2,ms3},{ks1,ks2,ks3}].  You may need to perform a numerical fitting in order to represent the Magnetization vs Field Strength dependence of your material by the function supported by Radia. See the Reference Guide for information on the Radia material functions (radMat*).  If you intend to use your material frequently, you can define the corresponding function in Mathematica. This function should call radMatLin or radMatSatIso with proper parameters. See how this is done for RadMat* functions in the Radia init.m file.


2. What is the difference between radTrfOrnt and radTrfMlt ?

radTrfOrnt[obj,trf] simply orients the object obj by applying the transformation trf to it once; radTrfMlt[obj,trf,mlt] being applied with mlt>1, preserves the original orientation of the object obj and creates mlt-1 its symmetry "childs".  Normally, mlt should be 2 in the case of a plane symmetry and can be >= 2  in the case of a rotation.