Laminate Optimization

Structural Optimization
Computer Exercise
Laminate Optimization
Benjamin Schl¨apfer
[email protected]
www.structures.ethz.ch
z,w
y,v
Ny
θ
x,u
Nx
Nxy
Mx
My
Nxy
Mxy
Version 1.0
Centre of Structure Technologies
Mxy
LAMINATE OPTIMIZATION
1
Problem
This exercises focuses on the optimization of a simple laminate under constant loads.
Different options, in terms of optimization techniques and algorithms, are presented. The
major objective of the exercise is to demonstrate the benefits and drawbacks of the different
methods for laminate optimization.
The exercise requires both, a MATLAB- and a ANSYS-installation. All codes that are
needed to solve the problems are available on the website of the institute.
2
Tasks
2.1
Optimization with Classical Lamination Theory
Open the file main_MP.m in the folder laminate optimization clt. It contains a predefined environment for the optimization of the function minimal_compliance.m. The
function returns the minimal compliance (and its gradients), which is a expression for
stiffness (the smaller the compliance, the stiffer the structure), for a given load array
line_load=[Nx Ny Nxy Mx My Mxy ]T and a design variable array x, which here contains
the orientation angles. Open the function minimal_compliance.m and try to understand
what is calculated there. Consider that it contains another function abd_matrix.m which
calculates the ABD-matrix (and also its gradients). Define the load vector in order to apply
a unidirectional tension load in x-direction (Nx =1000 and all others equal to zero). Additionally, define a start design variable array x0 with size 8 randomly (in degree). Ensure,
that all the entries are between -90 and 180 degrees (use MATLAB-function rand()). We
know that for the applied loadcase, the structure has maximal stiffness (minimal compliance) if all orientation angles are equal to 0. Consequently, it does not really make sense to
optimize it. However, we want to see how close we come to the globally optimal solution.
1. The interior-point fmincon-algorithm is based on the conjugated-gradientmethod (for more information consult the MATLAB Help Menu). Perform a few
optimizations and see if you can obtain the optimal solution (if known, the globally
optimal solution can be entered with xglobopt). Additionally, note the time elapsed
and the number of function evaluations for each run. Why is it usually not possible
to find the globally optimal solution?
2. The interior-point fmincon-algorithm requires gradient information which is calculated numerically by default. However, the gradients can also be provided by the
objective function (second function output). The gradients are calculated analytically in the function minimal_compliance.m. Their application can be activated by
setting the option options.GradObj = ’on’. Run the optimization again and note
the elapsed time and the number of function evaluations again. Why is the number
of needed function evaluations significantly lower?
3. Define the start array in which all entries are 90 degrees (x0 = 90*ones(1,8)’;),
which is the worst solution for the given load. Start the optimizations again and
explain.
4. The problem of getting stuck in a local optima can be mitigated by using stochastic
algorithms, e.g. a Genetic Algorithm. Open the script main_GA.m. Define the same
line load again. Consider that here, no start vector but the number of variables
is defined (gaproblem.nvars = 8;). Run the optimization and consider again the
1
ETHZ¨
urich IMES-ST
LAMINATE OPTIMIZATION
solution quality, the elapsed time and the number of function evaluations. Compare
to the algorithm of the class of mathematical programming.
5. If your computer has multiple cores, the evaluations can be execute in parallel by
setting the parameter useparallel = true. You will see a significant difference in
time if you increase the number of variables. The time can additionally be reduced by
restricting the search space. The allowable step size for the feasible orientation angles
can be set to discrete values. For instance, if only 45 degree steps are allowed, the
following variable can be set: discreteStep = 45;. Compare again solution quality,
time and function evaluations.
2.2
Optimization with Classical Lamination Theory
Open the script main_LP.m in the folder laminate optimization lp. It contains the implementation of laminate optimization with lamination parameters for in-plane loadcases
and symmetric laminates only. Consequently, only lamination parameters V1A and V3A are
considered. The resulting constraints
V2A = V4A = 0
ViB = 0
ViD = 0
− 1 ≤ V1A ≤ 1
2(V1A )2 − 1 ≤ V3A ≤ 1
are already implemented. The corresponding feasible search space is shown in the Figure
below. In fact, only two parameters are optimized even if all 12 lamination parameters are
(904)S
(±752)S
(0/903)S
1
VA 3
(03/90)S
(0/45/902)S (02/45/90)S
(45/903)S
(03/45)S
(0/452/90)S
−1
(04)S
(02/902)S
(452/902)S
V A1
(02/452)S
(±602)S (453/90)S (0/453)S
(±152)S
1
(±302)S
−1 (±452)S
implemented.
1. Define again the variable line_load with a uniaxial load in x-direction or y-direction
or with pure shear. Run the optimization and note the time elapsed several times.
Taking advantage of the Figure above, determine the optimal laminate. Why does
the algorithm always find the same optimal solution (which was not the case before)?
2. What is the optimal laminate for a load Nx = 1000 and Ny = 500?
2
ETHZ¨
urich IMES-ST
LAMINATE OPTIMIZATION
2.3
Optimization with a FEM-model
Finally, the same problem is solved with help of a FEM model. Due to the simple loadcase,
it basically does not make sense to apply the FEM here. However, the idea is to demonstrate the advantages and drawbacks of using a FEM model. Open the file main_GA.m in the
folder laminate optimization fem. It is basically organized the same as the equivalent file
before. Additionally, open the objective function file objective_function_parallel.m.
In here, you can see the organization of the communication between MATLAB and ANSYS. First, the ANSYS-input-file is generated. Consequently, the run is performed and
finally the results are read of the output-file. Here, the stiffness is simply measured on the
maximal displacement umax.
Since MATLAB must know the current ANSYS installation, the variable version has to
be set to the installed ANSYS-version in top of the file main_GA.m. Also here, parallelcomputing can be applied. However, for each function evaluation a ANSYS-license is needed. Consider that the number of licenses available at ETH is restricted. As soon as
the maximal number of available licenses is achieved, the optimization may become problematic. Moreover, using to much licenses may cause telephone calls from other angry
ANSYS-users (The number of parallel processes can be reduced to for instance 2 by setting
(matlabpool open local 2).
1. In order to optimize the laminate with FEM, the parameter model can be set to
model=’plate.apdl’. The model contains a simple rectangular plate under uniaxial load which corresponds to the loadcase used before (see Figure above). Set the
parameters PopulationSize and Generations to moderate numbers (≤ 5) in order
to keep the time low. How is the performance compared to the optimization before?
Y
Z
X
2. *Obviously, using FEM-models for the optimization of simple laminates is rather
stupid. However, homogeneous loadcases and geometrically simple structures are
rather rare. Consider the example shown in the Figure (plate with hole). Even if it is
still easy, it cannot be optimized without using. Perform this optimization by setting
model=’platewhole.apdl’.
Y
Z
11 X
3. *The optimization with FEM can also be carried out with algorithms of mathematical programming (main_MP.m). Here, the calculation of analytical sensitivities is not
possible anymore. A numerical evaluation of the gradients with n design variables
needs at leas n + 1 function evaluations. However, it might still be more efficient
than the GA (presumed that the variables are continuous).
3
ETHZ¨
urich IMES-ST