6. Finer optimization

advertisement
Grenoble-INP, ENSE3 14 January 2014
1
Practical work Team25_b (Optimization of Die Press Model)
Screening, Response surface, Optimization (4 hours)
_______
1. Purpose of this practical work
The purpose of this practical work is to make the design of an electromagnetic
device using a numerical simulation software.
This design takes place in four steps:
- Step 1: Screening in order of removing the non-influential parameters of
sizing (for reducing the cost of optimization).
- Step 2: Construction of a response surface giving the criterion to be optimized
according to the influential parameters (non-influential parameters are fixed
arbitrarily).
- Step 3: Determination of the values of the influential parameters by
optimization on the response surface surrogate.
- Step 4: Finer optimization.
For comparison, a direct optimization will also be attempted.
2. Presentation of the system to be optimized
The device to be optimized is a mold with its electromagnet for orienting magnetic
powder. It is used for producing anisotropic permanent magnets. The mold and the
core of the electromagnet are made of steel. The poles of the electromagnet are
shaped to obtain a distribution of radial magnetic flux. The magnetic powder is
inserted into the cavity. The device, with a depth of 100 mm, can reasonably be
assumed two-dimensional during the optimization phase. Its cross-section is shown
in Figure 1.
The magnetic field is produced by a DC coil by 4253 AT.
The purpose of sizing is to obtain the shape of the poles of the mold which ensures a
good distribution of the magnetization in the cavity. Along the line ef (radius 11.75,
angle 0-45°), the desired magnetic induction should look as follows:
Bx o  0.35 cos (T)
B y o  0.35 sin  (T)
Grenoble-INP, ENSE3 14 January 2014
2
The criterion to be optimized is :

f   Bx k  Bx k o   By k  By k o 
10
2
k 1
2

(1)
Where index k is for the 10 test points distributed uniformly along the line e-f.
Aux3
Aux2
Aux1
Aux4
Fig. 1 Cross section of the mold to be optimized
(left: whole view; right: enlarged view).
The parameters to be optimized are the dimensions R1, L2, L3, L4, AUX1, AUX2,
AUX3 and AUX4 whose variation ranges are shown in Table I.
Parameter
Initial value
R1 (mm)
L2 (mm)
L3 (mm)
L4 (mm)
AUX1 (mm)
AUX2 (mm)
AUX3 (mm)
AUX4 (mm)
7.2
15.3
14
11.5
180
80
88
9.5
Minimum
value
5
12.6
14
4
170
70
86
9.5
Maximum
value
9.4
18
45
19
190
90
90
11
Table I. Ranges of variation of parameters to be optimized.
Grenoble-INP, ENSE3 14 January 2014
3
3. Available numerical tools. Installation of the simulation server. Launching of
the optimization software.
a) Preliminary
The available numerical tools are:
- Computation of the magnetic field: Flux.
- Screening, response surface and optimization: GOT-It.
Connect a drive, for example O:, on \\fsrv1\coulombjExport$\Got.
All necessary TEAM25 files are in the directory : O:\GOT_Vyyyy-mmdd\Got2\exercises\04_team25.
Create a directory X:\Optim and copy the file 04_team25 (where X: means a
personal drive).
b) Optimization software GOT-It
On ENSE3, the software GOT-It (Version 2.0.beta) starts as follows:
- Open a window on O:\Got
- Launch the file gotit_exec_GOT_Vyyyy-mm-dd.bat
(double click)
- If necessary switch to English language (Tools > Preferences > Language
ENGLISH. Restart GOT-It)
- Open a new project (Project > new) associating a new file team25_8P.gotit
to be created in directory X:/Optim/04_team25 (if necessary overwrite an old
file with the same name).
c) Connection GOT-It  Flux
To establish the connection between GOT-It and Flux, proceed as follows in GOTIt:
- Create a Flux Communicator by Connector > New with the name C1 pointing
to the project X:/Optim/04_team25/Team25_2.F2G. In tab Solver, switch
Console server on YES.
After validation the following items must appear in the data tree:
- 1 Connector C1
- 8 Parameters AUX1, AUX2, …, R1
- 20 functions BX01, BX02, …BX10, BY01, BY02, …, BY10
Modify the initial value, the minimum and maximum values for all of the
parameters. Example for AUX1 :
- The initial value becomes 180
- The minimum value becomes 170
Grenoble-INP, ENSE3 14 January 2014
4
- The maximum value becomes 190
Proceed like that for the 8 parameters (see table I).
There are several ways of introducing the formula of the criterion to be minimized.
Here are two:
- Manually: The formula could be created manually (Function > New >
Formula > Expression. Given the complexity of the formula, this method is not
recommended here.
- Using a dedicated operator: In directory X:\Optim\04_team25 the file
ujlc\configurations\team25.py contains a python method named
team25() used to construct the objective function (examine its contents). If, as
suggested above, the file team25_8P.gotit was created next to the directory
ujlc the method team25() has been loaded automatically. So create in GOT-It, a
formula named F1 with expression team25(locals()) (note : locals() pass to the
function the dictionary that contains local variables among other BX01, BX02,
…). Validate.
Check that the expression of F1 reflects equation (1), the criterion to minimize.
Save (Save) the project.
4. Screening
Problem Team25_2 has 8 parameters R1, L2, L3, L4, AUX1, AUX2, AUX3 and
AUX4. It's not huge, but enough to justify a screening step, because here the finite
element calculations are relatively long. The first step of the design will be to
determine the most influential parameters that will be the only retained thereafter.
This screening is carried out using GOT-It software:
Load in GOT-It (if not already) the file X:\Optim\04_team25\team25_8P.gotit
- Switch in the context Screening.
- Run a screening (Screener > New > Name: SC1 > Original: F1 >
Approximation mode: Q2Screening > Validate > Execute). Note: This will
launch several Flux calculations (check in the server window that calculations
started well) and thus takes some time (a few minutes).
- Save
Study the obtained approximation SC1_F1_1. Justify the choice of the experiments
performed by the software (accumulated experiences required are given by the
command C1 Show).
In expression of SC1_F1_1, explain and justify the change of variables R1 ->
Lin(R1), L2 -> Lin(L2), …?
What mean in the expression of SC1_F1_1 terms like
(-0.048)*(
Grenoble-INP, ENSE3 14 January 2014
5
Lin(AUX1,170,190)*Lin(AUX3,86,90)
+Lin(AUX4,9.5,11)*Lin(L3,14,45)
+Lin(L2,12.6,18)*Lin(R1,5,9.4)
+Lin(AUX2,70,90)*Lin(L4,4,19) )?
After screening, a Screener analyzer was launched automatically. Deduced from the
expression of SC1_F1_1 and/or from the effects shown by the analyzer, the 3
parameters the most influential which should be maintained thereafter.
5. Quadratic approximation and optimization
Now, only three influential parameters may vary. The parameters AUX1, AUX2,
AUX3 and AUX4 will be set to the values defined in the original document, i.e.:
Parameter
AUX1 (mm)
AUX2 (mm)
AUX3 (mm)
AUX4 (mm)
Value
180
80
88
9.5
Table II. Values of the fixed parameters.
The choice of the value of the fifth fixed parameter must be justified.
Construct a quadratic response surface on the three parameters P1, P2 and P3
retained and deduce an approximated optimal. To do this:
- Load in GOT-It (if not already) the file
X:\Optim\04_team25\team25_8P.gotit
- Fix the parameters that are no longer involved, either by reducing their field to
a value (value = minimum value = maximum value), or preferably, by
activating their flag Fixed.
- Save as a new file team25_3P.gotit to be able to find these settings later.
- Switch in the context Model Reduction.
- Perform a polynomial approximation (Surrogate Factory > Polynomial
Factory > Name: SF1 > Original: F1 > Approximation mode: P2Approximator
> Validate > Execute) (wait).
- Save in a new file.
An approximation SF1_F1_1 has been obtained. Justify the choice of the experiment
table made by the software.
Grenoble-INP, ENSE3 14 January 2014
6
Determine the minimum of the response surface. To do this:
- Switch in the context Optimization.
- Construct a Single goal problem named OP1 with SF1_F1_1 as function to be
minimized.
- Construct an Optimizer algorithm SQP named SQP.
- Optimize OP1 with SQP (Optimization named O1) (Post functions : [ F1 ]).
Around the optimum, consider the sensitivity of the approximation SF1_F1_1
regarding the parameters (Analysis tool > Variation plotting > SF1_F1_1 > O1 >
Validate > Execute).
Plot the surfaces SF1_F1_1(P1,P2), SF1_F1_1(P1,P3) et SF1_F1_1(P2,P3) around
the optimum given by O1. Visibly, the function SF1_F1_1 is not a quadratic
function! How can it be? What is the benefit?
Now the question is whether the resulting configuration is satisfactory. Should
therefore compare the value found for F1 with a reference value. Determine (by a
mental calculation) a reference value of F1 assuming a deviation of 1% for each of
the induction modules to the ten points assessment on the arc "ef". Given this
specification, the configuration found (one that minimizes the approximation
SF1_F1_1) is acceptable?
6. Finer optimization
To minimize better, there must be a better approximation of F1. Two strategies to
improve response surfaces are considered: global or local.
a) Global improvement: It is to build a good approximation over the domain. It
is no longer a polynomial approximation, but rather a combination of radial
basis functions (multiquadric or Gaussian) from a relatively dense point
cloud (e.g. a grid 4*4*4 = 64 experiments).
b) Local improvement: It is to repeat the construction and optimization of
simple response surfaces (e.g. quadratic) made in subdomains increasingly
reduced around the minimum found at each iteration.
Here it is the local strategy which will be implemented, not manually by repeating
the operations in question 5, but automatically by means of a suitable optimizer.
For this:
- Reload the configuration with 3 free parameters team25_3P.gotit
- Construct a Single goal problem named OP2 with F1 as function to be
minimized.
- Construct a Sequential surrogate optimizer named SSO (Max iterations: 5).
- Optimise OP2 with SSO (Optimization named O2).
- Save in a new file.
Grenoble-INP, ENSE3 14 January 2014
7
Compared to a target of 1% on the induction module at each point of the arc "ef", the
criterion value F1 does seem acceptable?
Exit optimization software (for free software Flux) and with Flux, consider the field
distribution along the line "ef" for the "optimal" setting found. Is it acceptable?
7. Direct optimisation
The problem Team25_2 has 8 parameters R1, L2, L3, L4, AUX1, AUX2, AUX3 and
AUX4 and simulation times on current computers are quite reasonable. Why not try
a direct optimization?
Reload the problem with 8 free parameters and run an optimization on the objective
function F1 with any optimizer (SQP, GA, Niching ...) ... Result?
8. Conclusion
Synthesize the process.
How is it dependent on Flux software and why is it general?
Download