Professional Documents
Culture Documents
Topology Optimization
Topology Optimization
Implement SIMP-based topology optimization using your own code to solve the optimization problem, see slide
19 (“Quardratic penalty-based algorithm for equality constrained minimum compliance problem”). You will
have to augment your existing optimization code with the ability to handle bound constraints (chapter 13.3.2),
since they are needed on all design variables. The volume equality constraint is implemented using the penalty
method. The implementation should include filtering and projection. Try to also increase the penalty factor for
the volume constraint when beta is increased.
The finite element code from the Andreassen paper is available on Black Board as ‘fea88.m’. It takes the
arguments
(nelx,nely,x,penal,ft,rmin,beta,eta)
where nelx and nely are the number of elements in the x and y directions, x is the vector of nelx*nely design
variables, penal is the penalty exponent in SIMP (usually penal=3), ft is the filtering/projection strategy (ft=2:
Only filtering, ft=3: Filtering and projection, ft=any other value: Neither filtering nor projection. Use ft=3.),
rmin, beta, and eta are the parameters of the filter and projection operations.
‘fea88’ returns
[c,dc,v,dv,xPhys,xFil]
where c is the strain energy, dc is the gradient of the strain energy, v is the used volume, and dv is the gradient
of the volume constraint function. xPhys and xFil are the respectively the physical (filtered+projected) and the
filtered densities (different from x if filtering and/or projection is used).
function [c0,v0,c,v,xPhys]=TopOpt(Nx,Ny,pars)
where ‘Nx’ and ‘Ny’ are the number of ‘pixels’ in the x and y directions. ‘pars’ is a ‘struct’ with the following
fields:
1. The ‘TopOpt.m’ file with the ‘TopOpt’ function (note the case).
2. Any additional functions your code depends on (excluding ‘fea88.m’).
Hint 2: It is often handy to plot the design during the process, for example using
function plotDesign(x,beta,eta,Nx,Ny,pars)
colormap(gray);
caxis([0 1]); axis equal; axis off;
[c,~,v,~,xPhys,xFil]= fea88(Nx,Ny,x,pars.p,3,pars.rfilter,beta,eta);
subplot(3,1,1);
I=1-cat(2, fliplr(reshape(x,[Ny Nx])), reshape(x,[Ny Nx]) );
imagesc(I);
axis image;
title('design variables');
subplot(3,1,2)
F=1-cat(2, fliplr(reshape(xFil,[Ny Nx])), reshape(xFil,[Ny Nx]) );
imagesc(F);
axis image;
title('filtered variables');
subplot(3,1,3)
P=1-cat(2, fliplr(reshape(xPhys,[Ny Nx])), reshape(xPhys,[Ny Nx]) );
imagesc(P);
axis image;
title('projected variables (physical design)');
drawnow;
end