# Multi-Scale Concurrent Topology Optimization Based on BESO, Implemented in MATLAB
## 4 BESO Implementation of Concurrent Treatment of the Multi-Scale Problem  
The BESO approach is a discrete-based approach that uses a specified value for each element as an indicator of the element's existence. This indicator is generally called sensitivity number and is based on the element's sensitivity. In this section, the general idea of the soft-BESO approach will be presented first, and then it will be expanded for the concurrent multi-scale TO formulation. In the general representation, the indicator \(x\) will be used as an indicator for the material densities due to the classic form of the TO problem formulation. The general form of the sensitivity number of an element \(a\) of the soft version of BESO is obtained following the expression of Equation (16). \[a_{e}=-\frac{1}{p}\cdot\frac{\partial C}{\partial x_{e}} \tag{16}\]  
whereas described in the previous section, the term \(\partial C/\partial x_{e}\) refers to the sensitivity of the objective function and the term \(p\) refers to the penalty factor. Due to BESO being a discrete approach for the TO problem, material densities \(x\) are allowed to only take the values of zero or one. The mapping of the material densities is achieved using the sensitivity numbers of each finite element. A threshold value \(a_{x}\) for the sensitivity numbers is usually used in the mapping procedure. Thus, utilizing the sensitivity numbers as well as the threshold value, \(a_{x}\) the mapping procedure follows the expression of Equation (17). \[x_{e}= \begin{cases}1&for\quad a_{e}\geq a_{x}\\ 0&for\quad a_{e}<a_{x}\end{cases}  \tag{17}\]  
The specification of the value of the sensitivity number threshold \(a_{x}\) is achieved using the expression of Equation (17) and performing a search for the threshold value that satisfies the volume constraint imposed onto the classic TO optimization problem. The elemental Young's modulus can be obtained by combining the modified SIMP approach [35] and the expression of Equation (17). Hence, the mapping of the Young's modulus using the threshold sensitivity number follows the expression of Equation (18). \[E_{e}= \begin{cases}(E^{0}-E_{min})&for\quad a_{e}\geq a_{x}\\ E_{min}&for\quad a_{e}<a_{x}\end{cases}  \tag{18}\]  
Thus, using the modified SIMP approach, there is no element removal during the optimization procedure. Alternatively, elements with zero-valued material densities are assigned with a very small Young's modulus, making the optimization procedure more stable. To stabilize the optimization procedure even more in general the volume constraint is not applied at once. In contrast, the volume constraint is gradually imposed onto the optimization procedure, with the target volume usually initializing at 100% and gradually decreasing at every optimization step. The rate of decrease is generally a parameter of the optimization procedure and can affect the stability of the optimization. Moving to the presented formulation, the general idea of the soft-BESO implementation remains the same as in the classic TO formulation presented above. In this case, due to the two sets of material densities and by extension sensitivities of the objective function and constraints, the BESO implementation is basically applied separately at each set. Thus, the sensitivity numbers are obtained by applying the expression of Equation (16) to the new formulation and following the expressions of Equation (19). \[ \begin{split} a_{e}&=-\frac{1}{p}\cdot\frac{ \partial C}{\partial x_{e}}\\ a_{el}&=-\frac{1}{p}\cdot\frac{\partial C}{ \partial y_{el}}\end{split}  \tag{19}\]  
Due to the two different volume constraints (one for each scale), the threshold for the sensitivity numbers is two \(a_{x}\) for the macro-scale and \(a_{y}\) for the micro-scale. As described in the general implementation of the soft-BESO approach, the values of the two threshold numbers are obtained using the two different volume constraints and the expression of Equation (17) implemented for the material densities \(x\) and \(y\).