# Technical LibraryArticle: JMAG A to Z

## Issue 3 Shortening Calculation Time from A to Z

Have you mastered JMAG? JMAG continues to evolve with each passing day. There may be functions in JMAG that even those who are already using it will learn for the first time, as well as some useful procedures that are not yet well known. Why don't we aim at making operations more efficient by becoming familiar with new functions that we haven't discovered yet? In this series, we introduce "Things that we should know" in JMAG.

### Overview

Designers are under constant pressure to meet tight timelines and deliver results as quickly as possible. At the same time, however, they cannot sacrifice accuracy in the pursuit of results. There are also those who worry that a huge amount of calculation time will be required to carry out a large volume of highly accurate calculations.
JMAG has continued to improve its high speed solver functionality and parallel solvers in order to help our customers solve these kinds of obstacles. In this issue, we look at how to shorten calculation time by examining JMAG's functions and introducing methods of creating analysis models. By all means, take this opportunity to try them out for yourself.

### Using the solver's high-speed functions

JMAG has high speed solver functions that can substantially reduce calculation times. In this section we will cover five: The high speed solver for nonlinear iterations, the time period explicit error correction method, the steady-state approximate transient analysis option, the A-phi method, and the surface impedance method.

#### High speed solver for nonlinear iterations

This is a function that allows you to shorten calculation time when using a nonlinear material in a transient response analysis. When using this feature, we have seen approximately a threefold improvement in analysis speed compared to when it is not used (fig. 1). This function is not recommended for either an analysis involving motion where the displacement per step is large, or for an analysis that does not use a current source in the circuit or the current condition. The procedure is as follows:

1. Display [Nonlinear Calculation] under [Study Properties].
2. Click the [Use High Speed Solver] check box.

#### Time period explicit error correction method

This is an effective feature for those who would like to calculate a steady state instead of a transient state. It uses the temporal periodicity of a time varying field in a magnetic field analysis, shortening the time required to calculate a steady state solution (fig. 2). It works well for synchronous machines, reactors, transformers, and induction machines that have a voltage power supply. The procedure is as follows:

1. Display [Solver Calculation Control] under [Study Properties].
2. Click the [Time Period Explicit Error Correction] check box.
3. Select the type of period and enter the frequency.

Fig. 1 A comparison of analysis times when using the high speed
solver for nonlinear iterations

Fig. 2 A comparison of analysis times until a steady state is reached
in an induction motor analysis, when applying and not applying
the time period explicit error correction method

#### The steady-state approximate transient analysis option

Like the time period explicit error correction method mentioned above, this is a useful function for those who would like to calculate a steady state. First, use this function to calculate a trial steady state that assumes a single frequency, and then use the result to run a transient calculation. When you do this, the simulation will require less time to reach steady state operation (fig. 3).
This works best for simulations with a long transient period such as induction motors that use a voltage power supply, or with stationary devices like transformers and reactors. It is also possible to use this function with the time period explicit error correction method. The procedure is as follows:

1. Display [Solver Calculation Control] under [Study Properties].
2. Click the [Steady-State Approximate Transient Analysis] check box.
3. Select the analysis target.
4. Enter the slip when the analysis target is an induction machine.

Fig. 3 A comparison of the time until a steady state is reached
in an induction motor analysis, when applying and not applying

#### A-phi method

The ICCG's convergence can deteriorate when it handles models with eddy currents. However, the A-phi method, which is one of ICCG's options, improves convergence by adding electric scalar potential to the conductor region as an unknown to be solved for. This works best in situations where a conductor region is a significant portion of the analysis target. That is why the A-phi method is recommended for use in 3D analysis with eddy current generation.
JMAG has two A-phi methods: A-phi method 1 and A-phi method 2. In most cases, A-phi method 2 does a better job of improving calculation efficiency. The procedure is as follows:

1. Display [ICCG] under [Study Properties].
2. Select [A-phi Method 2 (Recommended)] from [Calculation Method].

#### Surface impedance method (SIBC)

When performing a frequency response analysis with a high frequency and shallow skin depth in the conductor, reproducing eddy currents with the skin depth function can make the calculation scale too big. This is where SIBC helps. SIBC carries out calculations that account for current that flows only on the conductor's surface, making it possible to shorten calculation time by reducing the scale of the calculation. The procedure is as follows:

1. Click the [Use SIBC] check box in the [Electric Properties] group box.

### Using your hardware's full calculating ability

This section introduces examples of using a parallel solver and GPUs (Graphic Processing Units) to enhance speed.

#### Parallel solvers

A parallel solver improves speed by dividing the processing load between several cores (CPUs) or machines. JMAG has two parallel solvers: a shared memory multiprocessor (SMP), and a distributed memory multiprocessor (DMP). Calculation speed differs greatly between CPUs when using the finite element method (FEM), so the hardware environment needs to be taken into account when deciding which parallel solver to choose (fig. 4). See the operating environments on our Website for more details. The degree of parallelism can be set as 2, 4, or 8. However, be careful because each degree of parallelism requires an additional SMP license. The procedure is as follows:

1. Display [Solver Calculation Control] under [Study Properties].
2. Select the type and degree of parallelism in [Parallel Computing].

Fig. 4 A performance comparison of parallel solvers in an IPM motor analysis

#### GPU

JMAG is working toward improved calculation speeds by incorporating high performance GPUs in parallel computing (fig. 5). This function is provided to those users who wish to use it. There is a select number of GPUs that can use it, so be sure to review the operating environments on our website. The procedure is as follows:

1. Display [Solver Calculation Control] under [Study Properties].
2. Click the [Use GPU] check box.

Fig. 5 The time shortening results of using GPUs in a magnetic head analysis

### Creating an analysis model for efficient calculation

Up to this point I have been introducing functions for JMAG solvers that reduce calculation time, but now I would like to switch to model creation methods that can improve the calculation speed. The methods that I would like to introduce are the S-characteristic correction method for section analyses and BH curves, and a mesh creation method.

#### Section Analysis

With JMAG, it is possible use what is called the Section Analysis Function to extract a cross-section from a 3D geometry like CAD and analyze it in 2D. This 2D model analysis is achieved by actually creating a section analysis study. The conditions and materials that were set to the 3D model are also transferred to the section analysis study, so it is possible both to shorten the calculation time and to reduce the time and effort of creating a separate model. The method of creating a section analysis study is as follows:

1. Right-click [Study] under 3D Model and select [New Section Study].

#### Correcting the BH curve

A typical steel sheet has a nonlinear relationship between its magnetic flux density and magnetic field. JMAG uses the Newton-Raphson method for nonlinear iteration analyses, so when there is a point of inflection on the BH curve (from here on, the part of the curve near a point of inflection is called an S-shape), conversion can become difficult, thus increasing the calculation time. This method corrects the S-shaped part of the BH curve to form a straight line, thereby improving convergence (fig. 6). However, be careful because the analysis results are affected if the model's operating point is in the adjusted part of the curve.

Fig. 6 An example of S-shape adjustment

#### Creating a mesh model that meets the analysis objective

Calculation time increases with the number of elements when using the finite element method, so one needs to create a mesh model that has the minimum number of elements necessary. The mesh required for an accurate analysis also changes depending on the physical quantities being evaluated, making it vital to take them into account and separate mesh usage accordingly.
Below is an example simulating a motor's induced voltage and cogging torque (fig. 7). As you can see, the resolution of the local magnetic flux density distribution improves when the mesh is more detailed. It does not really influence the induced voltage waveform that much, but the cogging torque is greatly affected.

Fig. 7 Differences in outcomes depending on the mesh model
(top: induced voltage, bottom: cogging torque)

### Using a remote system

There is an increasing trend of running multi-case calculations, such as in a parametric analysis. To go with this trend, there has been a corresponding rise in demand for enhanced speed through the use of machine resources. One effective technique when processing a large number of calculations is to use remote systems, whose performance improves with the number of machines in operation. A remote system is a system that runs a job on a separate machine. However, be careful because licenses for the number of calculations to be run are required. The installation manual provides more details on this feature:

• The installation folder inside of the JMAG installation directory

### Reducing the number of calculation setbacks

It is best to avoid having to redo calculations because of a mistake in the analysis settings, particularly when carrying out large scale calculations. For this reason, I would like to introduce the restart function and monitoring function as options that can get a handle on setting mistakes early on.

#### The restart function

This function carries out an analysis by using the results from a completed analysis as the initial values. It is useful when you want to run a calculation, see how things progress after a certain amount of time, and confirm the results. You can carry out the subsequent calculations after confirming that there are no problems with the initial results. The procedure is as follows:

1. Display [Restart Control] under [Study Properties].
2. Specify the type of restart.

#### The monitoring function

The monitoring function is a function that displays a graph of the results mid-analysis, allowing you to confirm whether or not there is a mistake in settings before the analysis is finished. The procedure is as follows:

1. Right-click [Customize Monitor] in the [Run Analysis] dialog box.
2. Select the check boxes of the types of results that you want to display in the [Customize Monitor] dialog box and then click [OK].
3. Click the tab for the types of results displayed in the [Run Analysis] dialog box.

### In Closing

This issue focused on shortening calculation time, and I took this opportunity to introduce high speed functions for JMAG's solver, parallel solvers, tips for creating a model, and methods for checking results before finalizing a simulation. From the standpoint of enhancing speed, however, it is always important to use a computer with good performance. There is still potential for shortening calculation time even further, whether it is by using improved computers or JMAG's features. Everyone's experience will be different, though, so please try the features that we discussed today and see how they affect your simulation.
Next time I plan to introduce an A to Z for meshes. Be sure not to miss it.

(Mayumi Warita)

# Mini CornerHow Do I Fix Problems With JMAG?

Has anyone here ever experienced a problem when using JMAG? What do you do in those situations? You may be using independent methods such as asking a JMAG user nearby, asking customer support, just thinking about it, or maybe even giving up. We here at JMAG provide various types of support services to help solve any problems that you may be experiencing. I would like to introduce support services that you should know for every situation that you encounter when using JMAG.

Problems when you are taking on a new analysis target
You understand JMAG's basic operations. Now you actually have to grapple with your own challenges. Where do you go from here?
We have prepared "Application Notes" for those who are taking on new analysis targets in JMAG.
They are technical documents that explain things like analysis target specifications, analysis steps, condition settings, and mesh generation. The procedure for setting up the application notes is as follows:

• Start Menu > JMAG-Designer > Documents > Application Notes
• JMAG-Designer's Menu bar > Help > Application Notes
• JMAG Website > Support > Application Notes

We are also conducting intermediate seminars for those who would like to learn from an instructor instead of doing it on their own. See the JMAG Website for more information on the contents and schedule.

JMAG Website:http://www.jmag-international.com/