You are on page 1of 40

Scripting in Maxwell 2D for

Computationally Efficient FEA with


Optimization Algorithms

Gennadi Sizov and Peng Zhang

Marquette University
1

2011 ANSYS, Inc.

November 23,
2014

Electrical and Computer Engineering


advisors: Professors Demerdash and Ionel

Overview
Introduction
Model-based optimization
difficulties
choice of a modeling approach

Computationally Efficient Finite


Element Analysis (CEFEA)
Electric circuit symmetry
vector potentials, flux linkages, induced
voltages
Magnetic circuit symmetry
core loss calculation
Torque calculation

Design Optimization
Objective function selection (single weighted
function vs. multi-objective)
Optimization algorithm
Differential Evolution
2

2011 ANSYS, Inc.

November 23,
2014

Optimization of 9-slot, 6-pole


IPM Motor
Design objectives
Optimization study (10,000 candidate designs)
eleven independent stator and rotor
variables
significant design improvements are
achieved

Scripting Maxwell 2D
RMxprt geometric primitives
Simple interfacing of Maxwell 2D to Matlab
Optimization of Toyota Prius IPM motor

Introduction
Model-based optimization of electric machinery
Difficulties:

Complex geometries (large number of geometric variables)


Nonlinear material properties
Multi-domain (physics) modeling (electromagnetic, thermal, stress, etc.)
Multiple design objectives
Population based design is problematic
Search of large design spaces

Choice of modeling approach


Tradeoffs
Speed vs. Accuracy
Analytic/Lumped Parameter (MEC) vs. FEA

Computationally Efficient FEA [Trans. on IA 2010/2011, ECCE 2010, IEMDC 2011]


Fast simulation of synchronous machinery
Accurately estimates EMFs, average torques, cogging torque, on-load torque ripple, and
core losses.

2011 ANSYS, Inc.

November 23,
2014

Difficulties in Optimization of Interior-PM Machines


Maximum Torque per Ampere MTPA

Maximum Torque per Ampere MTPA


Optimum operating point depends on design

variables
Every design requires additional model evaluations
increasing computational time

Average torque [Nm]

20

MTPA

15

10

MTPA
0
0

30

60

90

120

150

180

Torque angle, [deg. el.]

Field Weakening Operation


1.25

Field Weakening Operation


increasing computational time
Computational savings are possible by employing
solutions from MTPA search

Torque [pu]

Depends on design variables.


Requires further design evaluations

1
0.75
0.5
0.25
0
0

3
Speed [pu]

2011 ANSYS, Inc.

November 23,
2014

Computationally Efficient Finite Element Analysis


(CEFEA)
1

)]

25

Torque Ripple [%]

loss

30

Goodness [Nm/sqrt(W

35

20
15
10
5
0

10,000 designs in less than 51 hours!


6 static FE solutions (20 seconds/per design)
CE-FEA (seconds) vs. time-stepping FE (minutes)
several days vs. months!
large scale FEA-based optimization studies

2011 ANSYS, Inc.

November 23,
2014

20
15
10
Shaft Torque [Nm]

25

0.9
0.8
0.7
0.6
0.5
0.4

The fundamentals of CE-FEA


fully exploits symmetries of electric and
magnetic circuits to reduce simulation time
minimum number of magnetostatic solutions,
correlated with the maximum order of
significant field harmonics
one-to-two orders of magnitude reduction of
simulation time
suitable for most types of synchronous
machines.

Computationally Efficient Finite Element Analysis


(CEFEA)
What is not included in CE-FEA?
Why is time-stepping (transient) FEA still needed?
PM loss
Eddy currents in conductors
Current regulation in unconventional controllers (which may
require coupled simulations with Simplorer)
Motor-drive-controller simulations
Fault conditions
Unbalanced operation
Machine asymmetries, for example due to tolerances, e.g. airgap eccentricity
More detailed space (i.e. multiple points) and time (e.g. PWM
switching) info for core losses

2011 ANSYS, Inc.

November 23,
2014

Computationally Efficient Finite Element Analysis


(CEFEA)
CE FEA

CE-FEA is applicable to design and analysis of both


surface-PM and interior-PM machines.
Assumptions:

Determination of number of
solutions and rotor positions

iR () iY () iB ()

mech

Machine model is excited by instantaneous values of a set of

balanced three-phase sinusoidal currents.


Assumption is well justified in motor-drive systems with well tuned
current regulators.

Principle:
2-D magnetostatic finite element formulation is utilized:
1 A 1 A

= J J PM
+

x x y y

Instantaneous values of rotor position, mech, phase currents, iR, iY, iB,
are inputs to the model and the magnetic vector potentials (MVPs),
A, are the outputs used in the post-processing stage to extract fluxdensities, flux-linkages, energies (energy/co-energy).

2011 ANSYS, Inc.

November 23,
2014

FEA 2-D (static)

A
Post Processing:

Flux linkages, emfs

Flux densities

Energies
(energy/co-energy)

Torques

Losses

Computationally Efficient Finite Element Analysis


(CEFEA)
Principle (flux linkages and back emfs):
Symmetry of electric circuit results in the following:
AR + ( + 60

) = AY + ( )
AR + ( + 120 o ) = AB + ( )
o

AB+
AY+

where, A, is the average MVP in the coil side. Similar


expressions can be developed for all the other coil
sides.

AR+

From the coil side MVPs tooth fluxes, , and phase flux
linkages, , can be estimated as follows:

R ( ) = l Fe ( AR + ( ) AR ( ))

R ( ) = N ph R ( )
where, lFe, is the effective stack length and, Nph, is the
number of series turns per phase.

2011 ANSYS, Inc.

November 23,
2014

ARR
AR+

Computationally Efficient Finite Element Analysis


(CEFEA)
Principle (flux linkages and back emfs):
Flux linkages, , can be written in Fourier series form as:
M

R ( ) = cos( + )
=1

Accordingly, resulting back emfs, e, can be written in Fourier series


form as:
M
dR d
= sin ( + )
eR ( ) =
d dt
=1
Here, the maximum harmonic order, vM, is related to the number of
magnetostatic FE solutions, s, as follows:
M = 3s 1

Note: due to aliasing, the minimum number of FE solutions is limited


by the highest harmonic present in the flux linkage waveform.

2011 ANSYS, Inc.

November 23,
2014

Computationally Efficient Finite Element Analysis


(CEFEA)
Principle (flux linkages and back emfs):
Coil side MVP, AR+

AB+

AR + ( + 60 o ) = AY + ( )

AY+

AR + ( + 120 o ) = AB + ( )

R
AR+

0.01
0.0100
0.008
0.0080
0.006
0.0060

[Wb/m]

0.004
0.0040
0.002
0.0020
1.2E-17
0.0000

R+
R+

-0.002
-0.0020

Y+
Y+

-0.004
-0.0040

B+
B+

-0.006
-0.0060
-0.008
-0.0080
-0.01
-0.0100
00

20
20

40
40

60

80
80

100 120
120 140
140 160
160180180
100

[deg.el.]
el.]
[deg.

Five
Onemagnetostatic
magnetostaticFE
FEsolutions
solution

10

2011 ANSYS, Inc.

November 23,
2014

Computationally Efficient Finite Element Analysis


(CEFEA)
Principle (flux linkages and back emfs):
Coil side MVP, AR+

5 - solutions
Assuming lack of even order harmonics (half-wave symmetry)
0.0100
0.0080
0.0060

[Wb/m]

0.0040
0.0020
0.0000
-0.0020
-0.0040
-0.0060
-0.0080
-0.0100
0

60

120

180

240

300

360

[deg.el.]

Five magnetostatic FE solutions

Single magnetostatic FE solution yields six equally spaced points on MVP waveform!
Using five static FE solutions yeilds thirty samples of MVP Flux EMF!
11

2011 ANSYS, Inc.

November 23,
2014

Computationally Efficient Finite Element Analysis


(CEFEA)

EMF Harmonic Magnitude, |ea| [V]

Principle (flux linkages and back emfs):


250

Estimated from 5 solutions

225
200
175

No significant
harmonic
content
beyond 13th
order
no aliasing

150
125
100
75
50
25
0

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Harmonic Order

Selection of the number of static solutions


Has to be chosen to avoid aliasing in Fourier series
Example 9-slot, 6-pole IPM with 5-static FE solutions (no aliasing)
Spectrum of back emf, eR
Rated-load, 3600 r/min
12

2011 ANSYS, Inc.

November 23,
2014

Computationally Efficient Finite Element Analysis


(CEFEA)
Principle (flux linkages and back emfs):
Verification (5-solutions):
With respect to time-stepping FE
Phase flux-linkage, R, and back emf, eR
Open-Circuit, 3600 r/min
Rotor Position, [el. deg.]
120
180
240

60

300

Flux Linkage, R , [Wb]

0.1

TSFE
eq. (2)

0.15
0.1
0.05

0.05

-0.05

-0.05

-0.1

-0.1

-0.15

-0.15

-0.2
0.00

2.78

5.56

8.33
11.11
Time, [ms]

13.89

R ( ) = cos( + )
=1

13

2011 ANSYS, Inc.

November 23,
2014

-0.2
16.67

60

Rotor Position, [el. deg.]


120
180
240

300

360

200

300
TSFE
eq. (3) 200

100

100

300

0.2

0.2
0.15

360

EMF, eR , [V]

0
-100

-100

-200

-200

-300
0.00

2.78

5.56

8.33
11.11
Time, [ms]

13.89

-300
16.67

M
dR d
= sin ( + )
eR ( ) =
d dt
=1

Computationally Efficient Finite Element Analysis


(CEFEA)
Principle (flux linkages and back emfs):
Verification (5-solutions):
With respect to time-stepping FE
Phase flux-linkage, R, and back emf, eR
Rated-load, 3600 r/min
Rotor Position [el. deg.]

Rotor Position [deg. el.]


0

60

120

180

240

300

0.2

0.2

0.1

TSFE

0.15

Samples (5 solutions)

0.1

eq. (2)

0.05

0.05

-0.05

-0.05

-0.1

-0.1

-0.15

-0.15

-0.2

-0.2
0.00

0.93

1.85

2.78

3.70

4.63

Time [ms]

R ( ) = cos( + )
=1

2011 ANSYS, Inc.

November 23,
2014

5.56

Induced Voltage, ea [V]

Flux Linkage, a [Wb]

0.15

14

360

60

120

180

240

300

360

300

300

200

200

100

100

-100

-100

-200

TSFE
eq. (3)

-300
0.00

-200
-300

0.93

1.85

2.78
Time [ms]

3.70

4.63

5.56

M
dR d
= sin ( + )
eR ( ) =
d dt
=1

Computationally Efficient Finite Element Analysis


(CEFEA)
Principle (stator core flux densities):
Magnetic circuit symmetry

Symmetry of magnetic circuit [PAS 1981, IAS 2011] results in the following
relationships for elemental radial and tangential components of stator core fluxdensities at different rotor positions:

Br ,t t + s , r , = Br ,t (t , r , + k s )

where, k, is a positive integer, s, is the slot-pitch in electrical measure.


15

2011 ANSYS, Inc.

November 23,
2014

Computationally Efficient Finite Element Analysis


(CEFEA)
Principle (stator core flux densities):
Magnetic circuit symmetry
0

60

Rotor Position, [el. deg.]


120
180
240

300

1.5

Flux Density, [T]

1.5

e2

1
0.5
0

360

1
0.5

e1

e3

-0.5

-0.5

-1

-1

2s

-1.5

-1.5
-2

-2
0.00

2.78

5.56

8.33
11.11
Time, [ms]

13.89

16.67

Using the same magnetostatic solutions used for estimation of flux-linkages and
back emfs and assuming the lack of even order harmonics (half-wave symmetry),
Fourier series of elemental flux densities can be created:
M

Br ,t ( ) = B cos( + )
=1

Radial and tangential components of elemental flux densities will be used for
estimation of stator core losses (efficiency).
16

2011 ANSYS, Inc.

November 23,
2014

Computationally Efficient Finite Element Analysis


(CEFEA)
Principle (stator core flux densities):

Magnetic circuit symmetry


Verification (5-solutions):
With respect to time-stepping FE
Flux densities at locations: 1, 2
Full-load, 3600 r/min

3
4

Rotor Position [el. deg.]


0

60

120

180

240

Rotor Position [el. deg.]


300

1.5

0.5

0.5

-0.5

-0.5
B r TSFE magnify x10
B r eq. (11) magnify x10
B t TSFE
B t eq. (11)

-1.5
-2

-1
-1.5
-2

0.00

2011 ANSYS, Inc.

0.93

1.85

2.78

3.70

4.63

5.56

60

120

180

240

300

1.5

0.5

0.5

-0.5

-0.5

-1

-1
B t TSFE
B t eq. (11)

B r TSFE
B r eq. (11)

-1.5
-2

-1.5
-2

0.00

0.93

1.85

2.78

3.70

4.63

Time [ms]

Time [ms]

Location 1 (Yoke)

Location 2 (Tooth-Yoke Junction)

November 23,
2014

360
2

1.5

Flux Density [T]

Flux Density [T]

1.5

17

360
2

-1

5.56

Computationally Efficient Finite Element Analysis


(CEFEA)
Principle (stator core flux densities):

Magnetic circuit symmetry


Verification (5-solutions):
With respect to time-stepping FE
Flux densities at locations: 1, 2
Full-load, 3600 r/min

3
4

Rotor Position [el. deg.]


0

60

120

180

240

Rotor Position [el. deg.]


300

360

2.5

0.5

0.5

0
-0.5

B r TSFE

-1

-1

B t TSFE magnify x10

-1.5

-1.5

B r eq. (11)

-2

B t eq. (11) magnify x10

-2.5

-2
-2.5

0.00

2011 ANSYS, Inc.

0.93

1.85

2.78

3.70

4.63

5.56

240

360
2.5
2
1.5

0.5

0.5

-0.5

-0.5

-1

-1

-1.5

B r TSFE

-2

-1.5

B t TSFE

B r eq. (11)

B t eq. (11)

-2.5

-2
-2.5

0.00

0.93

1.85

2.78

3.70

Time [ms]

Time [ms]

Location 3 (Tooth)

Location 4 (Tooth Tip)

November 23,
2014

300

1.5

Flux Density [T]

Flux Density [T]

180

1.5

120

60

2.5

1.5

18

0
2.5

-0.5

4.63

5.56

Computationally Efficient Finite Element Analysis


(CEFEA)
Principle (torque calculation):
Creating a Fourier series of the energy stored in the magnetic
circuit:
W
Wstored ( m ) =

W cos( N

cog

m + )

=1

Taking the derivative:

W
dWstored
= N cog W sin N cog m +
d m
=1

Using flux-linkages obtained earlier the electromagnetic torque


can be estimated using the following expression:
alignment and reluctance

Tem =

cogging

dWstored
P dR
d
d
+ iY Y + iB B
iR
d
d
dmech
2 d

M
M
M

P
o
= iR ( ) sin ( + ) + iY ( ) sin ( ( 120 ) + ) + iB ( ) sin ( ( 240o ) + )
2
=1
=1
=1

W sin (

=1

19

2011 ANSYS, Inc.

November 23,
2014

mech

+ )

Computationally Efficient Finite Element Analysis


(CEFEA)
Principle (torque calculation):
Cogging torque
With respect to time-stepping FE
Open-circuit, 3600 r/min
3
2.5
2
1.5
1
0.5
0
-0.5
-1
-1.5
-2
-2.5
-3

2011 ANSYS, Inc.

November 23,
2014

20

30

40

50

60
17.4
17.3
17.2
17.1
17
16.9

Cogging - TSFE

Cogging - eq. (8)

Energy (5 solutions)

Energy - eq. (5)

16.8
16.7

20

10

10

20
30
40
Rotor Position [el. deg.]

50

60

Stored Energy [J]

Cogging Torque [Nm]

Computationally Efficient Finite Element Analysis


(CEFEA)
Principle (torque calculation):
On-load
With respect to time-stepping FE
Electromagnetic torque
Open-circuit, half-load, rated-load (3600 r/min)
0

60

120

180

240

300

360

20

20

Torque [Nm]

eq. (8)
TSFE
15

15

10

10

-5

-5
0

21

2011 ANSYS, Inc.

November 23,
2014

60

120
180
240
Rotor Position [el. deg.]

300

360

Computationally Efficient Finite Element Analysis


(CEFEA)

Average torque estimation error [%]

Principle (torque calculation):


5.5
5
4.5
4
3.5
3
2.5
2
1.5
1
0.5
0
-0.5
-1
1

10

Number of magnetostatic FE solutions, s

Average torque calculation


Error in estimation of the average torque as a function of number of static FE
solutions.
Compared to TSFE (based on Maxwell Stress Tensor)

22

2011 ANSYS, Inc.

November 23,
2014

Design Optimization

Model-based optimization:
Conflicting requirements on the modeling approach used for optimization

(accuracy vs. execution time).


Need for search of very large design spaces to find optimum design.
Large number of design variables (geometry, materials, etc.)
CE-FEA can be used for fast and accurate evaluation of very large number of
candidate designs.

23

2011 ANSYS, Inc.

November 23,
2014

Design Optimization
Objective function selection:
Single weighted objective function:
N

f1 =

n f n (x)

n =1

Pros: simple implementation


Cons: choice of weights, wn, conflicting vs. non-conflicting objectives

Multi-Objective (Pareto-based Optimization)


minimize : f1 = Tem ( pk pk )
Tem
maximize : f 2 =
PCu + PFe

min(Torque Ripple)
max(Goodness)
measure of average electromagnetic
torque with respect to total losses

Pros: meaningfully accounts for tradeoffs between multiple design

24

2011 ANSYS, Inc.

goals, no weights, results in a family of best compromise designs


Cons: implementation
November 23,
2014

Optimization of 9-slot, 6-pole IPM Motor

9-slot, 6-pole IPM:


11 geometric variables
Only outer diameter is fixed
7Arms/mm2, 0.3 slot fill factor
Search of MTPA for every design
25

2011 ANSYS, Inc.

November 23,
2014

x = [ D Si , g, wT , l S , d S , d T , T , w PM , h PM , P , wq ]

Optimization of 9-slot, 6-pole IPM Motor

M-1: High Specific Torque


M-2: Compromise between
Specific Torque and
Ripple
M-3: Low Ripple

Typ

Typ: Machine of Normal


Proportions
M-1
M-3

M-2

Optimization results:
Generations = 100, Population = 100
Total of 10,000 candidate design evaluations
51 hours on a single core (single license)
Search of maximum torque per amp (MTPA ) for every design
26

2011 ANSYS, Inc.

November 23,
2014

Optimization of 9-slot, 6-pole IPM Motor


Optimized machines:

max. Bmid-tooth = 1.75T,


min. BPM = 0.76T

max. Bmid-tooth = 1.71T,


min. BPM = 0.75T

M-1:
High Specific Torque

M-2:
Compromise
Specific Torque
and Ripple

max. Bmid-tooth = 1.65T,


min. BPM = 0.73T

max. Bmid-tooth = 1.67T,


min. BPM = 0.78T

Typ:
Machine of Normal
Proportions

M-3:
Low Ripple

27

2011 ANSYS, Inc.

November 23,
2014

Optimization of 9-slot, 6-pole IPM Motor


Electromagnetic Torque at Rated-Load (MTPA):
Verified with time-stepping FEA (2nd order elements)
Electro magnetic torque [Nm]

22

M-1 Tem = 20.84Nm, Ripple = 4.93%

21
20

M-2 Tem = 18.55Nm, Ripple = 2.72%

19
18

M-3 Tem = 15.79Nm, Ripple = 0.45%

17
16
15

Typ Tem = 15.21Nm, Ripple = 10.64%

14
0

10

20

30

Position [deg. el.]

28

2011 ANSYS, Inc.

November 23,
2014

40

50

60

Optimization of 9-slot, 6-pole IPM Motor


Electromagnetic Torque at Open-Circuit (Cogging):
Verified with time-stepping FEA (2nd order elements)

Electro magnetic torque [Nm]

1.00
0.75
0.50
0.25
0.00

-0.25

M-1 Tpk-pk = 0.41Nm


M-2 Tpk-pk = 0.29Nm
M-3 Tpk-pk = 0.19Nm
Typ Tpk-pk = 1.87Nm

-0.50
-0.75
-1.00
0

10

20

30

Position [deg. el.]

29

2011 ANSYS, Inc.

November 23,
2014

40

50

60

Optimization of 9-slot, 6-pole IPM Motor


Axial length
1
0.75

1.5

7.5Hp rating (15Nm,


3600
1.00 r/min)
0.96
1.25
0.82
0.73axial-length is

1.25

scaled to achieve the desired rating


1
PM Mass [pu]

Axial Length [pu]

1.25

PM Mass

0.5
0.25

1.05

0.93

0.75
0.5
0.25

M-1

M-3

M-2

Typ.

M-1

M-2

Total Machine Mass [pu]

Total Mass
1.25
0.92

1
0.75

2011 ANSYS, Inc.

1.00

0.81

0.75
0.5
0.25
0
M-1

30

1.00

November 23,
2014

M-2

M-3

Typ.

M-3

Typ.

Optimization of 9-slot, 6-pole IPM Motor


Separation of Losses
7.5Hp rating (15Nm, 3600 r/min)
Equal split between copper and core losses for optimized designs

Power Loss [W]

350

347.6W

337.9W

354.8W

300
250

164.9

170.5

184.0

373.3W

167.2

200

Copper

150
100

Core
182.7

167.4

170.8

M-1

M-2

M-3

206.1

50
0
Typ.

Note a 9.5% reduction of losses


with optimized machine M-2!

31

2011 ANSYS, Inc.

November 23,
2014

Scripting Maxwell 2D

RMxprt geometric primitives

Large number of predefined parameterized

geometries:
Stator slot shapes
Rotor topologies (various interior-PM and
surface-PM layouts)
Primitives are accessible through scripting
Custom geometries can be created through lowlevel primitives such as lines, arcs, etc.

Simple interfacing of Maxwell 2D to third


party software

Communicates to any software that uses

Common Object Module (COM)


Matlab, MS Office Excel, Visual Basic, etc.

Optimization exercise for Toyota Prius IPM


type motor

48-slot, 8-pole, V-shaped IPM rotor topology


Three parameters:
PM width, PM length, V depth

32

2011 ANSYS, Inc.

November 23,
2014

Scripting Maxwell 2D
Advice/hint:
Use Tools\Record Script To File to get an idea of how to write your own script!
ENABLE Record Script To File PERFORM the functions using Graphical User
Interface (GUI)
THEN look at the recorded text file to get an idea how to script.

Opening Maxwell from Matlab environment


Create COM object, open Maxwell, start new Maxwell 2D project, select transient
solver

% Maxwell COM object:


iMaxwell=actxserver('AnsoftMaxwell.MaxwellScriptInterface');
Desktop=iMaxwell.GetAppDesktop();
% remove set from the object definitions
Desktop.RestoreWindow
% Create project in Maxwell or open an existing project
Project=Desktop.NewProject;
invoke(Project,'Rename','C:\Users\labadmin\Desktop\Optimization
Project\Scripting\ANSOFT\Scripting\IPM2.mxwl',true)
invoke(Project,'InsertDesign','Maxwell 2D','Design1','Transient','')
Design=Project.SetActiveDesign('Design1');
invoke(Design,'SetSolutionType','Transient','XY')
Editor=Design.SetActiveEditor('3D Modeler');
invoke(Editor,'SetModelUnits',{'NAME:Units Parameter','Units:=','mm','Rescale:=',false}) %
Setup units [mm]

33

2011 ANSYS, Inc.

November 23,
2014

Scripting Maxwell 2D
Execution of Maxwell models from Matlab environment

Changing Maxwell params. from Matlab


% Input parameters
Imax=250; % Imax: the magnitude of
Thet_deg=20;
% Thet_deg:
O2=7.28; % O2: Distance form duck
TM=6.48; % TM: Magnet thickness
WM=32;
% WM: Total width of all

phase currents
the load angle in degree, initial value: 20deg
bottom to shaft surface
magnet per pole

Passing values to Maxwell using invoke/ChangeProperty commands


Make sure to add units to all dimensions (using Matlabs strcat function).
Also change all numerical values to strings (using Matlabs num2str function) before passing
them to Maxwell.
O2S=strcat(num2str(O2),'mm');TMS=strcat(num2str(TM),'mm');WMS=strcat(num2str(WM),'mm');
% Change these 5 parameters:
invoke(Design,'ChangeProperty',{'NAME:AllTabs',{'NAME:LocalVariableTab',{'NAME:PropServers','LocalVariab
les'},...
{'NAME:ChangedProps',{'NAME:Imax','Value:=',num2str(Imax)}}}})
invoke(Design,'ChangeProperty',{'NAME:AllTabs',{'NAME:LocalVariableTab',{'NAME:PropServers','LocalVariab
les'},...
{'NAME:ChangedProps',{'NAME:Thet_deg','Value:=',num2str(Thet_deg)}}}})
invoke(Design,'ChangeProperty',{'NAME:AllTabs',{'NAME:LocalVariableTab',{'NAME:PropServers','LocalVariab
les'},...
{'NAME:ChangedProps',{'NAME:O2','Value:=',num2str(O2S)}}}})
invoke(Design,'ChangeProperty',{'NAME:AllTabs',{'NAME:LocalVariableTab',{'NAME:PropServers','LocalVariab
les'},...
{'NAME:ChangedProps',{'NAME:TM','Value:=',num2str(TMS)}}}})
invoke(Design,'ChangeProperty',{'NAME:AllTabs',{'NAME:LocalVariableTab',{'NAME:PropServers','LocalVariab
les'},...
{'NAME:ChangedProps',{'NAME:WM','Value:=',num2str(WMS)}}}})

34

2011 ANSYS, Inc.

November 23,
2014

Scripting Maxwell 2D
Execution of Maxwell models from Matlab environment
Running the simulation
% Run program:
invoke(Design,'Analyze','Setup1');

Extracting results (Post-processing)


% Create reports of flux linkages, energy and torque:
Module=Design.GetModule('ReportSetup');
% Create the report of three phase flux linkages:
invoke(Module,'CreateReport','XY Plot 1','Transient','Rectangular Plot','Setup1 :
Transient',{'Domain:=','Sweep'},...
'Time:=',{'All'},'Poles:=',{'Nominal'},'Speed_rpm:=',{'Nominal'},'Thet_deg:=',{'Nominal'},'Imax:=',{'Nominal
'}},...
{'X Component:=','Time','Y
Component:=',{'FluxLinkage(PhaseA)','FluxLinkage(PhaseB)','FluxLinkage(PhaseC)'}},{})
invoke(Module,'RenameReport','XY Plot 1','FluxLinkages')
% Create the report of torque:
invoke(Module,'CreateReport','Torque','Transient','Rectangular Plot','Setup1 :
Transient',{},{'Time:=',{'All'},'Poles:=,{'All'},'Speed_rpm:=',{'All'},'Thet_deg:=',{'All'},'Imax:=',{'All'
}},{'X Component:=','Time','Y Component:=',{'Moving1.Torque'}},{})
% Calculate the energy:
Module=Design.GetModule('FieldsReporter');
invoke(Module,'EnterQty','Energy')
invoke(Module,'EnterVol','AllObjects')
invoke(Module,'CalcOp','Integrate')
invoke(Module,'AddNamedExpression','WEnergy','Fields')
% Create the report of energy:
invoke(Module,'CreateReport','XY Plot 2','Fields','Rectangular Plot','Setup1 :
Transient',{'Domain:=','Sweep'},...
{'Time:=',{'All'},'Poles:=',{'Nominal'},'Speed_rpm:=',{'Nominal'},'Thet_deg:=',{'Nominal'},'Imax:=',{'Nomina
l'},
'O2:=',{'Nominal'},'TM:=',{'Nominal'},'WM:=',{'Nominal'}},{'X Component:=','Time','Y
Component:=',{'WEnergy'}},{})
invoke(Module,'RenameReport','XY Plot 2','Energy')

35

2011 ANSYS, Inc.

November 23,
2014

Scripting Maxwell 2D
Execution of Maxwell models from Matlab environment

Saving results
% Export all data to .csv files:
invoke(Module,'ExportToFile','FluxLinkages','C:\Users\labadmin\Desktop\Optimization
Project\Scripting\ANSOFT\Scripting\Fluxlinkages.csv') % The file path can be changed
invoke(Module,'ExportToFile','Energy','C:\Users\labadmin\Desktop\Optimization
Project\Scripting\ANSOFT\Scripting\Energy.csv') % The file path can be changed
invoke(Module,'ExportToFile','Torque','C:\Users\labadmin\Desktop\Optimization
Project\Scripting\ANSOFT\Scripting\Torque.csv') % The file path can be changed

These basic step summarize show how to:

36

Create a Maxwell 2D model using RMxprt primitives


Change model parameters from Matlab environment
Solve using Maxwell
Extract the results

2011 ANSYS, Inc.

November 23,
2014

Optimization exercise
Toyota Prius IPM type motor:
Objective function:

PM length

Single objective function:

maximize : f1 =

Tem
Mass PM

PM depth

Single constraint maintain torque of 243Nm


Goal reduce PM usage while maintaining same torque!

Differential Evolution Optimizer Settings


Three design variables (rotor only)

37

2011 ANSYS, Inc.

PM length, PM width, V-depth


Strategy DE/best/1 with jitter, F = 0.85, Cr = 1
Np = 15 candidates per population
Ng = 10 generations
Total candidate design evaluations = Ng*Np = 150 designs
Simulation time approximately 30 minutes
November 23,
2014

Optimization exercise

38

2011 ANSYS, Inc.

November 23,
2014

Optimization exercise
Toyota Prius IPM type motor:
Original (Toyota)

min. BPM = 0.65 T

Optimization results
Original motor (Toyota)
PM mass = 2.1 kg @ 243Nm
Optimized motor
PM mass = 1.75 kg @ 245Nm
Possible reduction of up to 20% of PM mass
39

2011 ANSYS, Inc.

November 23,
2014

Optimized

min. BPM = 0.61 T

References

40

1.

F. A. Fouad, T. W. Nehl, and N. A. O. Demerdash, Magnetic field modeling of permanent


magnet type electronically operated synchronous machines using finite elements, IEEE Trans.
on PAS, vol. PAS-100, no. 9, pp. 4125-4133, 1981

2.

D. M. Ionel and M. Popescu, Finite element surrogate model for electric machines with
revolving field - application to IPM motors, IEEE Trans on Ind. Apps., vol. 46, no.6, pp. 24242433, Nov/Dec 2010.

3.

G. Y. Sizov, D. M. Ionel, and N.A.O. Demerdash, Modeling and design optimization of PM AC


machines using computationally efficient finite element analysis, IEEE Energy Conversion
Congress and Exposition ECCE, pp. 578-585, Atlanta, Georgia, September 2010, updated version
accepted for publication at IEEE Transactions on IES.

4.

G. Y. Sizov, D. M. Ionel, and N.A.O. Demerdash, Multi-Objective Optimization of PM AC


Machines Using Computationally Efficient - FEA and Differential Evolution, IEEE International
Conference on Electric Machines and Drives IEMDC, pp. 1537-1542, Niagara Falls, Canada, May
2011.

5.

G. Y. Sizov, D. M. Ionel, and N.A.O. Demerdash, A Review of Efficient FE Modeling Techniques


with Applications to PM AC Machines, IEEE Power and Energy Society General Meeting (PES2011), Detroit, Michigan, July 24-28 2011.

6.

G. Y. Sizov, P. Zhang, D. M. Ionel, N.A.O. Demerdash, and M. Rosu, Automated Multi-Objective


Design Optimization of Integral-MW Direct-Drive PM Machines Using CE-FEA, IEEE Energy
Conversion Congress and Exposition ECCE 2011, Phoenix, Arizona, September 2011.

7.

K. V. Price, R. M. Storn, and J. A. Lampinen, Differential Evolution - A Practical Approach to


Global Optimization, Springer-Verlag Berlin Heidelberg, 2005.

2011 ANSYS, Inc.

November 23,
2014

You might also like