# Multi-Scale Concurrent Topology Optimization Based on BESO, Implemented in MATLAB
## 6 Numerical Results
For the integration of the second [PERSON]'s modulus, if the modified SIMP expression is not replaced with Equation (23), then the only change in both codes is the introduction of the variable \(E2\) which replaces variable \(E_{min}\). If the modified SIMP expression is replaced with Equation (23), then _Lines_ 85 and 113 of the 2D and 3D codes, respectively, are replaced with the following _Lines_ presented in Listing 20. ```
1E=y*E0+(1-y)*E2;
2 dE=ones(nly,nlx)*(E0-E2);%2 DDimplementation
3 dE=ones(nly,nlx,nlx)*(E0-E2);%3 DDimplementation
```

Regarding the modified volume constraint, _Lines_ 121 and 150 of the 2D and 3D codes, respectively, are replaced with the following _Line_ for the 2D presented in Listing 21. ```
1 ifsum(y(:)+(1-y(:))*r)>voly*nlx*nly,11=lmid;else,12=lmid;end
```

And the following _Line_ for the 3D presented in Listing 22. ```
1 ifsum(y(:)+(1-y(:))*r)>voly*nlx*nly*nlx,11=lmid;else,12=lmid;end
```

where variable \(r\) refers to the ratio of the densities of the two phases. In the presented code implementations, the target volume fractions for the macro and micro-scale are considered as a parameter of the optimization problem. Using different combinations of these two target volumes can result in different objective function volumes. To find the optimal combination of the two target volumes, the two volume constraints can be combined into a single one, which is then imposed into the optimization procedure. Thus, similarly to the constraint presented in [24], the single volume constraint follows the expression of Equation (26). Figure 1:2

where the term \(V(y)\) follows the expression of Equation (25). The implementation of the single constraint can be achieved by modifying the BESO update step inside the optimization procedure. Hence, _Lines_ 109-122 and 138-152 of the 2D and 3D implementations, respectively, are replaced with the following update scheme presented in Listing 23. ```
19%SOFT-BESOUPDATEOFDESIGNVARIABLES
211a=min(dc(:));11b=min(dcy(:));11=min(11a,11b);
312a=max(dc(:));12b=max(dcy(:));12=max(12a,12b);
4 while(12-11)/(11+12)>1e-3
5 lmid=0.5*(12+11);
6x=max(0.001,sign(dc-lmid));
7y=max(0.001,sign(dcy-lmid));
8 ifsum(x(:))/nlex/nely*sum(y(:)+(1-y(:))*r)/nlx/nly>vol,11=lmid;else,12=lmid;end%for2D
9 ifsum(x(:))/nele*sum(y(:)+(1-y(:))*r)/nlx/nly/nlx>vol,11=lmid;else,12=lmid;end%for3D
```

**Listing 20** Modified expressions for the Youg's modulus for the two-phase composite microstructure

### Formulation Comparisons

In this part of the study, two test cases comparing the three different implementations are presented. These implementations include the use of cellular material, composite material, and the single volume constraint. Thus, the following notation is used subsequently for denoting the 3 formulations: _Formulation I_ denoting the multi-scale concurrent formulation with cellular material and two volume constraints; _Formulation II_ denoting the multi-scale concurrent formulation with composite two-phase material and two volume constraints; and _Formulation III_ denoting the multi-scale concurrent formulation with composite two-phase material and a single volume constraint. The first test case considered refers to a cantilever beam, as illustrated in Figure 1:3

For this test case, the total volume target for all three implementations was considered equal to 25%. This target volume is then divided into 50% for the macro-scale and 50% for the micro-scale. Thus, the volume ratio in the case of the two volume constraints is manually set, whereas for the case of the single constraint, the optimization algorithm will decide it. The parameter setup for the long cantilever test case considered is formulated following Listing 24. ```
1[c,ch,x,y]=ConTopOptBESO (2,1,80,40,50,0,5,0.5,3,3.0,2.0,0.02,p);
```

The Young's modulus considered was set equal to 2 for the main material and 1.5 for the secondary material, with a Poisson's ratio of 0.3 for both. In addition, the second material was considered to have a lower by eight times density than the main material.