# Multi-Scale Concurrent Topology Optimization Based on BESO, Implemented in MATLAB
## 2 Multi-Scale Topology Optimization--Problem Formulation  
Since the optimization problem formulation, involves both scales (structure and periodic unit cell) the design variables, i.e., relative densities are applied in both scales. Thus, similarly to the classic TO formulation, the relative material densities applied to the finite elements discretizing the macro domain (structure) are presented as \(x\), whereas the relative densities applied to the finite elements discretizing the microdomain (periodic unit cell) are presented as \(y\). In addition, to separate the indicators of the two sets of finite elements (of the macro and micro-scale), the indicator for the finite elements discretizing the macro domain is \(e\) whereas the indicator for the finite elements discretizing the microdomain is \(el\). Hence, \(x_{e}\) refers to the relative density of a finite element of the macro domain and \(y_{el}\) refers to the relative density of a finite element of the microdomain. The mathematical formulation of the optimization problem follows the expression of Equation (1). \[\min_{x,y}C(x,y) =F^{T}\cdot U(x,y) \tag{1}\] \[s.t.\] \[F =K(x,y)\cdot U\] \[V(x)/V_{x} =f_{x}\] \[V(y)/V_{y} =f_{y}\] \[0\leq x_{e}\leq 1\] \[0\leq y_{el}\leq 1\]  
where the term \(C(x,y)\) refers to the structural compliance that was chosen as the objective function to be optimized. The terms \(F\) and \(U\) refer to the loading vector and the resulting displacement field, respectively. The equation \(F=K\cdot U\) refers to the equilibrium equation, which is solved using the finite element method (FEM). The terms \(V(x)\) and \(V(y)\) refer to the volumes of the structure and periodic unit cell, respectively. Similarly, the terms \(V_{x}\) and \(V_{y}\) refer to the volumes of the whole structure and periodic unit cell, respectively. The volume fractions for the two scales which are the target volumes for the final optimal designs are referred to as \(f_{x}\) and \(f_{y}\) for the macro and micro-scale, respectively. Lastly, as mentioned at the beginning of this section, \(x_{e}\) and \(y_{el}\) refer to the relative material densities for the macro and micro-scale, respectively. Similarly to the classic TO formulation, the relative densities of both scales are bounded between the values of zero and one. As illustrated in the equilibrium equation, the two groups of material densities have a notable impact on the global stiffness matrix values. This influence stems from the definition of the elemental stiffness matrices denoted as \(k_{e}\) for each individual element \(e\). These element stiffness matrices \(k_{e}\) for each finite element \(e\) conform to the expression provided in Equation (2). \[k_{e}(x,y)=E_{e}(x)\cdot k_{e}^{H}(y) \tag{2}\]  
where term \(E(x)\) refers to the influence of the relative material density \(x_{e}\) and term \(k_{e}^{H}(y)\) refers to the homogenized element stiffness matrix. The influence of the material density \(x_{e}\) is implemented using the modified SIMP approach [35]. Using the modified SIMP approach, the zero-based material densities are assigned a minimum value to avoid zero-valued stiffness matrices. The penalization term has no meaningful effect in our case but is included to keep the expression similar to the modified SIMP. Thus, the term \(E(x)\) follows the expression of Equation (3). \[E_{e}(x)=x_{e}^{p}\cdot(1-x_{min})+x_{min} \tag{3}\]  
where \(x_{min}\) refers to a minimum value for the influence term to avoid zero values and the term \(p\) refers to the SIMP penalization factor. The homogenized element stiffness matrix \(k_{e}^{H}\) is only a function of the material densities \(y\) through the elasticity tensor. Hence, the term \(k_{e}^{H}\) follows the typical expression of a Q4 finite element stiffness matrix, i.e., the expression of Equation (4). \[k_{e}^{H}(y)=\int_{V_{e}}(B_{e}^{T}\cdot C^{H}(y)\cdot B_{e})dV_{e} \tag{4}\]  
where \(B_{e}\) refers to the strain-displacement matrix and \(C^{H}\) refers to the homogenized elasticity tensor.