scieee AI-readable full text Open interactive document viewer

A Forward Approach for Topology Optimization and Magnetization Direction Optimization of Permanent Magnets

Clénet, Stephane; Korecki, Julien; Igarashi, Hajime; Yin, Shuli; Kong, Xiaohan

Abstract

The paper proposes a forward method to determine the optimal direction of the magnetization of permanent magnets as well as its optimal shape in order to maximize the magnetic flux in a coil. The method can be advantageously used, for example during the design stage of an electrical machine in order to maximize the flux in the stator windings generated by the permanent magnets located on the rotor. The method is first developed in the continuous domain. It appears that the optimal permanent magnet configuration can be determined from the magnetic flux density distribution generated by the coil when it is supplied by a current of 1A. No need to solve any inverse problem to find the optimal configuration since the procedure is explicit. It is shown that this method remains still valid in the discrete domain when the finite element method is applied and can take advantage of this method for topology optimization. Two configurations of permanent magnet magnetization are considered having either a continuously variable direction or made with blocks on which the direction is constant as in an Halbach array. In the same way, for topology optimization, two cases are considered when the magnetization is fixed or considered as a variable to be optimized. A 3D example is treated in order to illustrate the effectiveness of the method.

Full text

A Forward Approach for Topology Optimization and Magnetization Direction Optimization of Permanent Magnets S. Clénet1, J. Korecki1, H. Igarashi2, S. Yin3 and X. Kong4 1 Univ. Lille, Arts et Métiers Institute of Technology, Centrale Lille, Junia, ULR 2697 - L2EP, F-59000 Lille, France 2 Data-Driven Interdisciplinary Research Emergence Department, Hokkaido University, Sapporo 060-0813, Japan 3State Key Laboratory of Electrical Insulation and Power Equipment, School of Electrical Engineering, Xi’an Jiaotong University, 710049, China 4Graduate School of Engineering, Kyoto University, 615-8510, Kyoto The paper proposes a forward method to determine the optimal direction of the magnetization of permanent magnets as well as its optimal shape in order to maximize the magnetic flux in a coil. The method can be advantageously used, for example during the design stage of an electrical machine in order to maximize the flux in the stator windings generated by the permanent magnets located on the rotor. The method is first developed in the continuous domain. It appears that the optimal permanent magnet configuration can be determined from the magnetic flux density distribution generated by the coil when it is supplied by a current of 1A. No need to solve any inverse problem to find the optimal configuration since the procedure is explicit. It is shown that this method remains still valid in the discrete domain when the finite element method is applied and can take advantage of this method for topology optimization. Two configurations of permanent magnet magnetization are considered having either a continuously variable direction or made with blocks on which the direction is constant as in an Halbach array. In the same way, for topology optimization, two cases are considered when the magnetization is fixed or considered as a variable to be optimized. A 3D example is treated in order to illustrate the effectiveness of the method. Index Terms—Finite Element Method, Permanent Magnets, Topology Optimization, Magnetization Direction Optimization. I. INTRODUCTION ERMANENT MAGNETS are more and more used in rotating electrical machines because high performances and compactness can be obtained. Rare earth permanent magnets are preferred because of their high magnetization. However, they are costly and subject to supply risks. During the design of the electrical machine, one tries to limit the permanent magnet volume or at least to maximize some global quantity (torque, flux…) for a given volume. To reach this goal, one way consists in optimizing the magnetization direction in adjacent permanent magnet blocks as in an Halbach array. Moreover, with the progress in permanent magnet manufacturing, the local control of the magnetization direction becomes possible leading to the design of new actuators [1]. Numerous research works have been done on the determination of the optimal direction of the magnetization in electromagnetic devices. In [2-3], global quantities such as electromotive force, electromagnetic torque and cogging torque have been optimized for permanent magnet synchronous machines. In [4], the magnetization direction is chosen in order to minimize the risk of demagnetization. In [5], the field pattern of cylindrical Halbach array is optimized in portable MRI scanner. Another way to limit the amount of material is to optimize the shape of the permanent magnets by parametric and/or topology optimization [6]. In [7], a hybrid approach combining parameter and topology optimizations is applied in order to find the optimal permanent magnets shape and flux barrier topology for a synchronous machine. In [8], the rotor geometry is fully determined by topology optimization but considering the magnetization direction constant. In [9], other applications like magnetic refrigeration system are also considered. In [10,11], topology optimization as well as the magnetization direction optimization are carried out simultaneously in order to maximize the average torque of a surface mounted permanent magnet machine. In [12], a method has been proposed to account for the non linear behavior of a permanent magnet. In [13], a forward method, based on the reciprocity theorem, has been proposed to determine the optimal directions of N permanent magnet blocks. In [14], a forward method is also proposed to optimize the magnetization direction in order to maximize the force. However, in general like in previous cited works [2-12], for both magnetization direction and topology optimization, inverse problems are considered which are solved by applying deterministic methods often based on the adjoint problem to determine the gradient or stochastic methods like genetic algorithms. These methods require many iterative steps where, for example, a finite element model of electrical machines is solved, which is computationally expensive. Consequently, the determination of magnetization direction and/or solution of topology optimization are generally very time consuming. In this paper, we propose to transform the magnetization direction and topology optimization of permanent magnets into a forward problem. We show how this transformation is possible when considering the linkage flux in a coil as the quantity of interest. This method can be really useful during the design stage since the linkage flux is a key quantity when designing an electromagnetic device. For example, the flux in the stator windings created by the permanent magnets located on the rotor are closely related to the torque and the supply voltage. This transformation into a forward problem is based on a relationship expressing the linkage flux in function of the P This article has been accepted for publication in IEEE Transactions on Magnetics. This is the author's version which has not been fully edited and content may change prior to final publication. Citation information: DOI 10.1109/TMAG.2025.3636893 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ magnetization distribution and the magnetic field created by the coil when it is supplied by a current of 1A. It is then shown that magnetization direction and/or the optimal shape can be determined explicitly from the solution of one forward problem. It appears that the relation between the linkage flux and the magnetization distribution remains still valid in the discrete domain when using the finite element method. Moreover, the determination of the optimal magnetization direction or permanent magnet shape can be naturally derived from the finite element solution leading to a very efficient and fast optimization method. First, the magnetostatic problem is described and the relation between the linkage flux with magnetization distribution is given. We show that this relation is conserved once applying the finite element method. Then, we show how the optimal magnetization direction can be determined either when considering a continuous variation of magnetization or an array made of adjacent permanent magnet blocks like Halbach arrays. We show also how topology optimization can be carried by ordering a simple array of weight determined from the relation previously considered. Two test cases are presented, to evaluate the efficiency of the proposed methods. The magnetization directions and topology optimization methods are evaluated on two test cases. To evaluate the effectiveness of the proposed method, we compare the magnetic flux of a rotating machine when the magnetization direction is radial (standard case) and optimized by the proposed method. II. CALCULATION OF THE MAGNETIC FLUX A. Continuous domain Let consider a domain D with a coil C and a permanent magnet PM (see Fig.1). The domain D can contain ferromagnetic material, assumed to have a linear behavior (no magnetic saturation). The magnitude of the magnetization Br(x), also called remanent magnetic flux density, is assumed to be fixed but not the direction, which can vary with the position x. We want to optimize the direction of Br(x) in order to maximize the flux PM created by the permanent magnets in the coil. We want also to find a way to evaluate the contribution to the flux PM of any elementary volume of the permanent magnet in order to carry out a topology optimization. For this, we propose considering a magnetostatic problem describing by the following equations: div𝐁(𝐱)=0 𝐜𝐮𝐫𝐥𝐇(𝐱)=I 𝐍(𝐱) (1) with B(x) the magnetic flux density, H(x) the magnetic field, I the current flowing the coil C and N(x) the current density distribution when the coil is supplied by I=1A. On the domain D, the behavior law can be written under the form: 𝐇(𝐱)=(𝐱)[𝐁(𝐱)−𝐁𝐫(𝐱)] (2) with (x) the reluctivity and Br(x), the remanent magnetic flux density, which is equal to zero outside the permanent magnet region. The boundary conditions on D are given by: 𝐁(𝐱).𝐧(𝐱)=0 (3) with n(x) the outward unit normal vector. Introducing the vector potential A(x) such that B(x)=curl A(x), the problem becomes: 𝐜𝐮𝐫𝐥 ((𝐱)[𝐜𝐮𝐫𝐥𝐀(𝐱)−𝐁𝐫(𝐱)])=I 𝐍(𝐱) (4) with the boundary condition: 𝐀 (𝐱)×𝐧(𝐱) = 𝟎 (5) Fig.1: General problem and description of both considered configurations. In configuration A, the magnetization orientation can change continuously within the permanent magnet. In configuration B (Halbach array), the magnetization orientation can change from a block to another but is constant on each block. The magnetic flux  flowing through the coil is given by [15]: Φ=∫𝐀(𝐱).𝐍(𝐱)𝐝𝐱  (6) We denote by AI(x) the vector potential solution of the magnetostatic problem when Br(x) is equal to zero in the permanent magnets and the current I=1A. In the same way, we denote by APM(x) the vector potential solution of the problem when the current I=0A and the permanent magnets are the only source. By replacing N(x) by its expression in function of AI(x) (see (4) and applying twice the green formula (the surface integrals are always equal to zero due to the boundary conditions (3)), we can show then that: Φ =∫𝐀𝐏𝐌(𝐱).𝐍(𝐱)𝐝𝐱 =∫(𝐱)𝐁𝐫(𝐱).𝐜𝐮𝐫𝐥𝐀𝐈(𝐱)𝐝𝐱  (7) We denote 𝐇𝐈(𝐱)=(𝐱)𝐜𝐮𝐫𝐥𝐀𝐈(𝐱), the magnetic field created by the coil, when it is supplied by a current I=1A. The flux is given by: Φ =∫𝐁𝐫(𝐱).𝐇𝐈(𝐱)𝐝𝐱  (8) B. Discrete domain We consider now our problem discretized by the FE method. We have to verify that the conclusions drawn in the continuous domain, are still valid. In this case, the vector potential 𝐀(𝐱) is discretized in the edge element space and given by a weak form of (4) [15]. The flux is given by the expression (6) with 𝐍(𝐱) discretized in the facet element space. The two vector potentials 𝐀𝐏𝐌(𝐱) and 𝐀𝐈(𝐱) verify the two following weak forms: (𝐱)𝐜𝐮𝐫𝐥[𝐀𝐈(𝐱)].𝐜𝐮𝐫𝐥[𝐰𝐢(𝐱)]𝐝𝐱 = ∫𝐍(𝐱).𝐰𝐢(𝐱)𝐝𝐱  (9.a) (𝐱)𝐜𝐮𝐫𝐥[𝐀𝐏𝐌(𝐱)].𝐜𝐮𝐫𝐥[𝐰𝐢(𝐱)]𝐝𝐱 = ∫(𝐱)𝐁𝐫(𝐱).𝐜𝐮𝐫𝐥[𝐰𝐢(𝐱)]𝐝𝐱  (9.b) Ferromagnetic material Air Coil Domain D PM, B r (x) B(x).n(x)=0 u(x) Configuration A u 1 Configuration B u i u n This article has been accepted for publication in IEEE Transactions on Magnetics. This is the author's version which has not been fully edited and content may change prior to final publication. Citation information: DOI 10.1109/TMAG.2025.3636893 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ With 𝐀𝐈(𝐱)=∑𝐀𝐈 𝐰𝐢(𝐱)   and 𝐀𝐏𝐌(𝐱)=∑𝐀𝐏𝐌 𝐰𝐢(𝐱)   , 𝐰𝐢(𝐱) the interpolation function associated to the edge i, 𝐀𝐈  and 𝐀𝐏𝐌  the circulations on the edge i of the vector potentials 𝐀𝐈(𝐱) and 𝐀𝐏𝐌(𝐱) respectively and Ne the number of edges. If we consider now the expression of the magnetic flux (7), we have: Φ = 𝐀𝐏𝐌(𝐱).𝐍(𝐱)𝐝𝐱 = ∑𝐀𝐏𝐌 ∫𝐰𝐢(𝐱).𝐍(𝐱)𝐝𝐱    (10) Using (9.a), (10) becomes: Φ =𝐀𝐏𝐌 (𝐱)𝐜𝐮𝐫𝐥[𝐀𝐈(𝐱)].𝐜𝐮𝐫𝐥[𝐰𝐢(𝐱)]𝐝𝐱    =  (𝐱)𝐜𝐮𝐫𝐥[𝐀𝐈(𝐱)].𝐜𝐮𝐫𝐥[𝐀𝐏𝐌(𝐱)]𝐝𝐱 = ∑𝐀𝐈∫(𝐱)𝐜𝐮𝐫𝐥[𝐰𝐢(𝐱)].𝐜𝐮𝐫𝐥[𝐀𝐏𝐌(𝐱)]𝐝𝐱    (11) Using (9.b), (11) becomes Φ =𝐀𝐈 (𝐱)𝐁𝐫(𝐱).𝐜𝐮𝐫𝐥[𝐰𝐢(𝐱)]𝐝𝐱 =   ∫(𝐱)𝐁𝐫(𝐱).𝐜𝐮𝐫𝐥[𝐀𝐈(𝐱)]𝐝𝐱=∫𝐁𝐫(𝐱).𝐇𝐈(𝐱)𝐝𝐱  (12) We can see that the expression (8) obtained in the continuous domain is still valid when applying the FE method. We will use this expression in the following to optimize the direction of the magnetization Br(x) as well as the shape of the permanent magnet. C. Calculation of the magnetic flux The standard approach to calculate the flux in a coil created by a permanent magnet is generally based on the solution of a FE problem. To each new distribution of the magnetization Br(x), a new FE problem is solved to calculate the flux Φ. With the expression (8), we can see that, from any magnetisation distribution Br(x), the flux can be calculated directly by integrating the term 𝐁𝐫(𝐱).𝐇𝐈(𝐱) without solving any FE problem except one to calculate 𝐇𝐈(𝐱). We remind that 𝐇𝐈(𝐱) is obtained by solving a FE problem where the magnetization distribution Br(x) is equal to zero and the current I in the coil is equal to 1A. Using the expression (8), the calculation of the flux Φ from any magnetisation distribution Br(x) is very fast and, as we will see in the following, enables to transform problems of optimization, inverse problems by nature, into a forward problem with sometime an explicit expression of the optimal solution. In the following, we will consider two optimization problems, where we will take advantage of the expression (8). The first problem aims at optimizing the direction of the magnetization. In the second, we will carry out a topology optimization of permanent magnets. III. MAGNETIZATION DIRECTION OPTIMIZATION We consider the permanent magnet region DPM. At this stage, we can distinguish two configurations of magnetization distribution in the region DPM (see Fig.1): A-The direction of the magnetization 𝐁𝐫(𝐱) can vary continuously on the region DPM but its magnitude B of 𝐁𝐫(𝐱) is constant. The expression is: 𝐁𝐫(𝐱)= B 𝐮(𝐱) (12) with 𝐮(𝐱) a unit vector. The problem is then to find the direction of the unit vector 𝐮(𝐱) in each point of the DPM which maximizes PM. B-The region DPM is divided into n blocks on which the magnetization has a constant direction given by the unit vector 𝐮. The expression is given by: 𝐁𝐫(𝐱)=B∑I(𝐱)𝐮   (13) with the function I(𝐱) is equal to 1 on the block i and zero elsewhere. The problem is then to find the direction of the unit vectors 𝐮 in order to maximize PM. We find here the wellknown problematic of Halbach array. A. Configuration A If we consider first the configuration A, replacing 𝐁𝐫(𝐱) by its expression in the case of configuration A in (8), we obtain: Φ =B ∫𝐮(𝐱).𝐇𝐈(𝐱)𝐝𝐱  (14) The flux is maximum when the term 𝐮(𝐱).𝐇𝐈(𝐱) is maximum and positive for any position 𝐱, that is to say that the vector 𝐮(𝐱) is colinear and in the same direction to 𝐇𝐈(𝐱). The optimal direction of magnetization is the one of 𝐇𝐈(𝐱) and can be determined directly explicitly. A flow chart describing the different steps to calculate u(x) is given in Fig. 2. When using a FE model, the magnetic field 𝐇𝐈(𝐱) is precalculated assuming that the coil is supplied by a current of 1A and the magnetization Br(x) is equal to zero. Then, on each element of the mesh in the permanent magnet, the optimal magnetization direction is equal to the direction of the magnetic field direction 𝐇𝐈(𝐱). B. Configuration B If we consider now the configuration B, the expression becomes: Φ = BI(𝐱)𝐮   .𝐇𝐈(𝐱)𝐝𝐱  = ∑B∫I(𝐱)𝐮.𝐇𝐈(𝐱)𝐝𝐱    = ∑B𝐮.∫𝐇𝐈(𝐱)𝐝𝐱     (15) The flux Φ is maximum if all the terms 𝐮.∫𝐇𝐈(𝐱)𝐝𝐱   are maximum and positive. The unit vector 𝐮 has the same direction of 𝐦=∫𝐇𝐈(𝐱)𝐝𝐱   , the average of the magnetic field on block i. Here again, we obtain an explicit expression of the optimal direction of the magnetization in each block. A flow chart describing the different steps to calculate the ui’s is given in Fig. 2. On each element of the mesh belonging to the block i, the optimal magnetization direction is equal to the direction of 𝐦 . According to the proposed approach, we can see that in both cases A and B, there is only This article has been accepted for publication in IEEE Transactions on Magnetics. This is the author's version which has not been fully edited and content may change prior to final publication. Citation information: DOI 10.1109/TMAG.2025.3636893 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ one optimal magnetization distribution maximizing the magnetic flux. (a) Calculation of the optimal magnetization orientation (b) Calculation of the optimal shape of the permanent magnet Fig.2: Flow charts to calculate (a) the optimal magnetization orientation in the configurations A and B and (b) the optimal shape of the permanent magnet. IV. TOPOLOGY OPTIMIZATION Now, we will consider a coil and a region D’ of volume VD’. We want to distribute in the region D’ a volume VPM (VPM < VD’) of PM in order to maximize the magnetic flux Φ. The subregion of D’ of volume VPM is denoted DPM. We will consider that the region D’ is divided into R small subregions di of volume vi.. The material can be either a non-magnetic material that is say 𝐇(𝐱)=𝐁(𝐱) or a permanent magnet 𝐇(𝐱)=[𝐁(𝐱)− 𝐁𝐫(𝐱)]. The topology optimization problem consists in selecting M subregions di of indices (i1,…,iM) which material is assigned to be permanent magnet, among the whole R subregions of D’, such that: Φ is maximum with the constraint ∑v   ≤V (16) We remind that the term ∑v   is equal to the volume of permanent magnet in D’ and the index ij, the one of small subregions where the material is a permanent magnet. In the case of the use of the FE method, the simplest choice consists in considering the elements of the mesh as the subregions di. R is then the number of elements of the mesh of the region D’. If the mesh is fine, the number of subregions can be huge. When using an inverse method to solve the topology optimization problem described above, an intractable number of combinations of subregions to create the volume VPM should be considered, preventing the use of such methods. However, we will see in the following that the proposed method based on (8) leads to solve a forward problem so the number of subregions has almost no importance. We introduce the quantity φ associated with the subregion di: φ=∫𝐁𝐫(𝐱).𝐇𝐈(𝐱)𝐝𝐱  (17) In fact, the term φ represents the volumic density of the subdomain di which contributes to the magnetic flux Φ. It is easy to show that: ∫𝐁𝐫(𝐱).𝐇𝐈(𝐱)𝐝𝐱  =∑φv   =Φ (18) Where indices (i1,…,iM) are those of the small subregions dij where the material is a permanent magnet. In the following we will address the two cases: A-the magnetization is assumed to have a constant direction along a unit vector 𝐯 and we have on DPM : 𝐁𝐫(𝐱)= B 𝐯 (19) The idea is then to design the shape of a permanent magnet, on which the magnetization is uniform. B-the direction of the magnetization is free, we have on DPM: 𝐁𝐫(𝐱)= B 𝐯(𝐱) (20) with 𝐯(𝐱)a unit vector which direction depends on the position 𝐱. In that case, the shape of permanent magnet as well as the magnetization direction 𝐯(𝐱) are determined. Case B will lead to a more performant solution however it is more difficult to manufacture and costly. Comparing both enables us to find a tradeoff between performance and cost. A. Case A The magnetization has a constant direction along a vector v. The quantity φ is then given by: φ=∫𝐯.𝐇𝐈(𝐱)𝐝𝐱  (21) This quantity can be calculated on the R subregions of D’, that is to say on each element of mesh included in D’. Then, the indices i of subregions are ranked according to the decreasing value of the φ. It means that a list L=(i1,…,iR) is created such that such that: ∀(j,k) 1≤j≤k≤R φ≥φ (22) In the list L, the index i1 corresponds to the subregion d where φ is the highest and the index iR corresponds to the subregion where φ is the smallest. It can be mentioned that in case A the quantity φ can be negative. The process of optimization is then simple since in order to satisfy the constraint in (16), we just have to select the M first indices of the list L such that: ∑v   ≤V and ∑v   ≥V (23) Solution of the FE problem to calculate H I (x) (Eq. 9.a) (B r (x)=0 and I=1A) Optimal magnetization orientation u(x) (Eq. 12) in the PM is the same as the orientation of H I (x) HI(x) Optimal magnetization direction u(x) Configuration A Solution of the FE problem to calculate H I (x) (Eq. 9.a) (B r (x)=0 and I=1A) Optimal magnetization orientation u i (Eq. 13) in each block i is the same as the orientation of H I (x) Optimal magnetization direction u i on each block Configuration B Solution of the FE problem to calculate H I (x) (Eq. 9.a) (B r (x)=0 and I=1A) In the R subregions, calculation of the quantity (Eq. 21) and the subregion volume v i H I (x) Creation of a list L=(i 1 ,….,i R ) of indices such that the ‘s are ranked from the greatest to the lowest ( ,…, ) (Eq. 22) V = V+v ij j=j+1 V = 0 and j=1 V V PM Yes No The optimal PM is made of the M first subregions of indices (i 1 ,..,i M ) M= j-1 This article has been accepted for publication in IEEE Transactions on Magnetics. This is the author's version which has not been fully edited and content may change prior to final publication. Citation information: DOI 10.1109/TMAG.2025.3636893 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ The magnetic flux Φ is then given by (18) summing only on the indices i j belonging to the list L. We can see that the process of optimization consists in ranking R terms and selecting the M first terms. The flow chart representing the different steps is given in Fig.2.b. We can see that it is based on a forward problem without any iterative process, usually met in optimization. B. Case B In case B, the problem is similar to the case A except that the direction of the magnetization 𝐯(𝐱) is also a degree of freedom. If we want to maximize the flux, the contribution of each quantity φ should be maximum on each subregion d i that is to say that 𝐯(𝐱) should be colinear with 𝐇𝐈(𝐱). It means that the quantity φ is given by: φ=  ∫  (𝐱)    (24) with H(𝐱) the modulus of the vector 𝐇𝐈(𝐱) . The process of optimization to determine the shape of the PM is similar to the one presented in case A by first ranking the indices to set up the list L and then selecting the M first subregions in the list L. The flow chart presented in Fig.2.b can be applied here except that the terms φ are given by (24) instead of (21) and the outputs is also the magnetization orientation on each subregions given by the orientation of 𝐇𝐈(𝐱). V. D ESCRIPTION OF THE PROBLEM A. Description In Fig. 3, we present the geometry of the problem, on which we will evaluate the optimization methods proposed in sections III and IV. The problem consists of an iron core with two teeth supporting two coils placed in series. A region with permanent magnets which are divided into 64 blocks. These blocks can be used to test the method when considering Halbach array. The region, so called region Iron/Air, in contact with the permanent magnets, will be made up of either iron or air in order to consider two different field distributions. The system is held in an air box. The mesh, presented in Fig.3, is composed of 261764 elements and 52777 nodes. B. Study with standard magnetization We consider in the following that the magnetization is uniform in two blocks in the permanent magnet region but in opposite direction. We find here a standard magnetization distribution that can be met in Permanent Magnet Synchronous Machine (PMSM) where you have on the rotor an alternation of poles in opposite directions of magnetization. We will calculate the flux Φ in the coil considering iron (µ =1000µ 0 ) or air (µ =µ 0 ) in the region Iron/Air. These values of flux will be considered as reference and will enable to quantify the improvements obtained with the proposed method of optimization. In Table 1, the values of the magnetic fluxes are reported for the two cases. As expected, we can see that the flux is the highest when the region Iron/Air is made with iron. In Fig. 4, the magnetic flux density distribution obtained with the vector potential formulation. Fig.3: Geometry of the problem studied (top), the mesh (middle) and the dimensions (bottom) µ in the region Iron/Air µ 0 1000µ 0 Value of the magnetic flux 298.5 µWb 489.5 µWb TABLE 1: Value of the magnetic flux created by the permanent magnets in the coil for the two values of permeability of the region Iron/Air. VI. A PPLICATION TO THE MAGNETIZATION DIRECTION OPTIMIZATION In the following, we will focus on the optimization of the magnetization direction as it is described in section III. We will This article has been accepted for publication in IEEE Transactions on Magnetics. This is the author's version which has not been fully edited and content may change prior to final publication. Citation information: DOI 10.1109/TMAG.2025.3636893 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ address first the case when the direction can change continuously (configuration A) and the case of the Halbach array (Configuration B). Using the vector potential formulation, the magnetic field distribution 𝐇𝐈(𝐱) , created by the coil supplied by a current of 1A, is calculated. As presented previously in section III, the optimal direction will be calculated from this distribution. A. Configuration A: Continuous magnetization direction optimization Applying the method described in III.A, the direction of magnetization 𝐁𝐫(𝐱) is determined from the magnetic field distribution 𝐇𝐈(𝐱). In Fig. 5, we give the distributions of the magnetization calculated when we consider in the region Iron/Air either iron or air. We can see that since the distribution of 𝐇𝐈(𝐱) is different in both cases, the magnetization direction differs in both cases. The distribution when the region Iron/Air is made with iron is closer to the standard distribution where the magnetization is constant. In Table 2, we compare the magnetic fluxes obtained with the optimal distribution and the standard magnetization direction (see V.B). We can see clearly an increase of the flux value in both cases which is much more significant when the region Iron/Air is air. In fact, in that case, the magnetization distribution is more different than a standard constant magnetization direction with a large region where the magnetization direction rotates. B. Configuration B: Magnetization direction optimization by block We consider now that the two permanent magnets are each divided into 4 blocks. We assume that the magnetization direction on each block is constant. We then have an Halbach array and we want to determine the direction on each block which maximizes the flux Φ. To calculate these directions, we have applied the method presented in III.B. In Table 3, we compare the magnetic fluxes Φ obtained with the optimal Halbach array distribution and the standard magnetization direction (see V.B). We can see that we have still an improvement especially when the region Iron/Air is made with air with an increasing of 22% of Φ. As expected, the values of the flux remain lower than the one obtained when the magnetization direction varies continuously (configuration A), which corresponds to the maximum that can be reached. In Fig.6, we give the distribution of the magnetization. VII. A PPLICATION TO TOPOLOGY OPTIMIZATION Now we consider now the region D’ of volume V D’ made of the two parallelepipedic blocks related to the permanent magnets presented in Fig.2. A volume V PM made of permanent magnet material is fixed (V PM < V D’ ). We want to distribute this volume in D’ in order to maximize the flux Φ. We will consider the two configurations presented in section IV where: A-the magnetization has a fixed direction equal to the standard direction, B-the magnetization direction can vary and be chosen optimally. In configuration A, we have just to optimize the shape of the permanent magnets. In configuration B, we have to optimize the shape and the direction. Fig.4: Magnetic flux density distribution considering in the region Iron/Air, a permeability equal to  0 (Top) and 1000 0 (Bottom). µ=µ 0 µ=1000µ 0 Fig.5: Optimized magnetization distribution considering in the region Iron/Air, a permeability equal to  0 (Top) and 1000 0 (Bottom) in the configuration A µ in the region Iron/Air µ 0 1000µ 0 Magnetic flux - Standard Magnetization 298.5 µWb 489.5 µWb Magnetic flux - Optimal magnetization 379.4 µWb 536.7 µWb Improvement in % 27% 9,6% TABLE 2: Value of the magnetic flux Φ  created by the standard and optimal permanent magnets distribution in the coil for the two values of permeability of the region Iron/Air This article has been accepted for publication in IEEE Transactions on Magnetics. This is the author's version which has not been fully edited and content may change prior to final publication. Citation information: DOI 10.1109/TMAG.2025.3636893 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ A. Configuration A: Topology optimization with standard magnetization direction Using the method proposed in section V-A, we have determined the evolution of the shape when the percentage VPM/VD’ of the permanent magnet in the domain D’ varies from 50% to 100%. In Fig.7 and Fig.8, we give the shapes of the permanent magnets for percentages equal to 50%, 62.5%, 75% and 87.5% when the region Iron/Air is made of air and iron respectively. We can see first, in both cases, the creation of a gap between the two blocks where the magnetization is in opposite direction. This geometry enables to avoid any magnetic “short circuit” between the permanent magnets and to be sure that the flux created by the permanent magnets will be captured by the coil. However, we can see also that, in the case of iron in the region Iron/Air, the permanent magnet makes a bridge between the air gap and the region Iron/Air for low percentages. It is not the case when the material is air, where the permanent magnet extends its surface in contact with the air gap to be as close as possible to the coil. In Fig. 9, the evolution of the flux Φ in function of the percentage of permanent magnet in the region D’. We can see clearly a decreasing of the slope of the curve, meaning that, for a same volume of permanent magnets, the contribution to the flux Φ is higher for low percentage. µ=µ0 µ=1000µ0 Fig.6: Optimized magnetization distribution considering in the region Iron/Air, a permeability equal to 0 (Top) and 10000 (Bottom) in the configuration B µ in the region Iron/Air µ0 1000µ0 Magnetic flux - Standard Magnetization 298.5 µWb 489.5 µWb Magnetic flux – Optimal Halbach array 363.6 µWb 511.2 µWb Improvement in % 2 2 % 4.2 % TABLE 3: Value of the magnetic flux Φ created by the standard and optimal Halbach array permanent magnet distribution in the coil for the two values of permeability of the region Iron/Air B. Configuration B: Topology optimization with optimal magnetization direction We have applied the method proposed in section V-B to optimize at the same time the shape of the permanent magnets and the direction of the magnetization. We give in Fig. 10 and Fig. 11, the evolution of the shape of the permanent magnet for the two cases where the region Iron/Air is made of air and iron respectively. We can see here again a different behavior for both cases, which are quite similar but more pronounced than the one noticed in the previous case when the direction is fixed. It confirms that the distribution of the soft ferromagnetic material influences significantly the geometry of the permanent magnets obtained by topology optimization. When the material is air in the region Iron/Air, the permanent magnet tends to increase its surface in contact with the air gap. Since the magnetization direction is optimized, there is no need of gap as it was the case when the direction was fixed (see Fig.7, configuration A). When the material is iron in the region Iron/Air, the permanent magnet creates again a bridge between the air gap and the iron to maximize the magnetomotive force created by the permanent magnet. We can notice that it appears a gap between the two blocks because in the region the contribution of the permanent magnet to the flux is small. In Fig.12 and Fig.13, we give the distribution of the magnetization when the region Iron/Air is made of air and iron respectively. In the first case, the magnetization direction varies smoothly. In the second case, the permanent magnet is almost split into two different regions where the magnetization directions are almost constant but with opposite orientation. An exception appears in the bridge where the direction varies significantly. In Fig. 14, the evolution of the flux Φ in function of the percentage of permanent magnet in the region D’ is given for the two cases. We can see that we can get the same value of flux Φ in the standard case (VPM/V=100%) with: -37.5% less of permanent magnet when the region Iron/Air is made of air -19% less of permanent magnet when the region Iron/Air is made of iron. VIII. APPLICATION TO A ROTATING MACHINE We have applied the proposed method to a rotating permanent magnet machine. Half of the geometry is presented in Fig.15. The machine has three phases and two pole pairs. In the original machine, the permanent magnets are radially magnetized. A 2D FE model of the machine has been developed. We have applied the method proposed in VI.A to obtain the magnetization distribution which maximizes the flux in the phases. The simulated optimized magnetization distribution is given in Fig.16. In Fig. 17, we give the evolution of the simulated flux in a phase in function of the position obtained with the radial and optimized distributions. We can see that, with the optimized magnetization distribution, the magnitude of the simulated flux can be improved by 14%. This example shows that performance of the rotating machine can be improved by applying the proposed method. In Fig 18 and 19, we give the magnetic flux density distribution in the airgap (the radial component and the full vector). We can see that the magnitude of the vector is almost the same with a peak value of 0.35T. However, we can see clearly a difference between both in the distribution. The This article has been accepted for publication in IEEE Transactions on Magnetics. This is the author's version which has not been fully edited and content may change prior to final publication. Citation information: DOI 10.1109/TMAG.2025.3636893 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ optimized magnetization enables to reduce the tangential component of the magnetic flux and increases the value of the normal component from 0.26T to 0.31T leading to an increase of the magnetic flux as well. 50% 62.5% 75% 87.5% Fig.7: Optimal shape of the permanent magnet for different percentages of the ratio V PM /V ratio when the region Iron/Air is made of air (µ =µ 0 ). 50% 62.5% 75% 87.5% Fig.8: Optimal shape of the permanent magnet for different percentages of the ratio V PM /V ratio when the region Iron/Air is made of iron (µ =1000µ 0 ). Fig.9: Evolution of the magnetic flux Φ in function of the percentage of the volume V occupied by permanent magnet ( V PM ) when the region Iron/Air is made with iron and air when the region Iron/Air has a permeability equal to  0 (Top) and 1000 0 (Bottom). The magnetization direction is fixed and equal to the standard case. The magnetic flux is an increasing function of the PM volume, but we can see a decrease of the slope showing that the last added percentage volume (PM vol > 90%) contributes less to the increasing of the magnetic flux Φ. IX. C ONCLUSION In this paper, the optimization of the magnetization direction or the shape of permanent magnets in order to maximize the linkage flux in a coil has been considered. We have shown that the optimal permanent magnet configuration can be determined from the magnetic flux density distribution created by the coil when it is supplied by a current of 1A. No need to solve any inverse problem to find the optimal configuration since the solution can be determined explicitly. We have shown that this method remains still valid in the discrete domain when the finite element method is applied. Moreover, the implementation of a topology optimization is quite natural when using the finite element method. A 3D example illustrates the effectiveness of the proposed method. In the next step, we plan to study rotating permanent magnet machines in order to evaluate the proposed method. Future works will focus on extending the proposed method in order to account for the non-linear behavior of soft ferromagnetic materials. Furthermore, experimental set up will be developed in order to validate the proposed method. This article has been accepted for publication in IEEE Transactions on Magnetics. This is the author's version which has not been fully edited and content may change prior to final publication. Citation information: DOI 10.1109/TMAG.2025.3636893 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ 50% 62.5% 75% Fig.10: Optimal shape of the permanent magnet for different percentages of the volume V occupied by permanent magnet ( V PM ) when the region Iron/air is made of air (µ =µ 0 ) 50% 75% 81% Fig.11: Optimal shape of the permanent magnet for different percentages of the volume V occupied by permanent magnet ( V PM ) when the region Iron/air is made of iron (µ =1000µ 0 ). Fig.12: Distribution of the magnetization when the region Iron/Air is made of air for a percentage of permanent magnet of 75%. Fig.13: Distribution of the magnetization when the region Iron/Air is made of iron for a percentage of permanent magnet of 81%. Fig.14: Evolution of the magnetic flux Φ in function of the percentage of the volume V occupied by permanent magnet ( V PM ) when the region Iron/Air is made with iron and air when the region Iron/Air has a permeability equal to  0 (Top) and 1000 0 (Bottom). The magnetization direction is also optimized. The constant curve in orange represents the value of the flux Φ in the standard case. By optimizing the magnetization direction, we can obtain the same flux Φ as the one obtained with a standard magnetization direction but with less PM volume (63% and 80% when the region Iron/air has permeability equal to  0 and 1000 0 ). Fig.15: Half of the geometry of the rotating permanent magnet machine. Fig.16: Optimized magnetization distribution obtained with the proposed method This article has been accepted for publication in IEEE Transactions on Magnetics. This is the author's version which has not been fully edited and content may change prior to final publication. Citation information: DOI 10.1109/TMAG.2025.3636893 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/