# Multi-Scale Concurrent Topology Optimization Based on BESO, Implemented in MATLAB
## 3 Sensitivity Calculations for Concurrent Multi-Scale Expressions  
In this part of the study, the sensitivity analysis of the concurrent multi-scale TO formulation is presented. Due to the two different sets of material densities, the sensitivity of the compliance is obtained through two different expressions. Hence, the sensitivity of the objective function with respect to the two sets of material densities \(x\) and \(y\) follows the expressions of Equation (8).  
\[\begin{split}\frac{\partial C}{\partial x_{e}}&=- U_{e}^{T}\cdot\frac{\partial k}{\partial x_{e}}\cdot U_{e}\\ \frac{\partial C}{\partial y_{el}}&=-\sum_{e=1}^{ N_{e}}U_{e}^{T}\cdot\frac{\partial k}{\partial y_{el}}\cdot U_{e}\end{split} \tag{8}\]  
where the term \(U_{e}\) refers to the displacement field of element \(e\) and the term \(N_{e}\) refers to the number of elements \(e\). For the case regarding the material densities, \(x\) the sensitivity of the objective function requires the sensitivity of the element stiffness matrix \(\partial k/\partial x_{e}\). The sensitivity of the element stiffness matrix is obtained by differentiating the expression of Equation (2) with respect to \(x_{e}\). Hence, the term \(\partial k/\partial x_{e}\) follows the expression of Equation (9).  
\[\frac{\partial k}{\partial x_{e}}=\frac{\partial E}{\partial x_{e}}\cdot k_{e }^{H} \tag{9}\]  
The term \(k_{e}^{H}\) is only a function of, \(y\) and thus is not affected by the differentiation. To obtain the value of the term \(\partial E/\partial x_{e}\), the expression of Equation (3) is differentiated as well. Thus, the term \(\partial E/\partial x_{e}\) is obtained following the expression of Equation (10).  
\[\frac{\partial E}{\partial x_{e}}=p\cdot x_{e}^{p-1}\cdot(1-x_{min}) \tag{10}\]  
Moving to the second set of objective function sensitivities, the sensitivity of the objective function with respect to the \(y\) set of material densities requires the sensitivity of the stiffness matrix \(\partial k/\partial y_{el}\). The term \(\partial k/\partial y_{el}\) can be obtained by differentiating the expression of Equation (2) with respect to \(y_{el}\). Hence, the term \(\partial k/\partial y_{el}\) is obtained following the expression of Equation (11).  
\[\frac{\partial k_{e}}{\partial y_{el}}=E_{e}(x)\cdot\frac{\partial k_{e}^{H}} {\partial y_{el}} \tag{11}\]  
Here, the term \(E_{e}(x)\) is not a function of \(y\) and thus is not affected by the differentiation. The derivative of the homogenized stiffness matrix with respect to \(y\) is obtained by differentiation of the expression of Equation (4). Therefore, the term \(\partial k_{e}/\partial y_{el}\) is obtained following the expression of Equation (12).  
\[\frac{\partial k_{e}^{H}}{\partial y_{el}}=\int_{V_{e}}(B_{e}^{T}\cdot\frac{ \partial C^{H}}{\partial y_{el}}\cdot B_{e})dV_{e} \tag{12}\]The derivative of the homogenized elasticity tensor with respect to \(y\) is obtained by differentiation of the expression of Equation (5). Consequently, the term \(\partial C^{H}/\partial y_{el}\) is obtained following the expression of Equation (13).  
\[\frac{\partial C^{H}}{\partial y_{el}}=\frac{1}{V_{y}}\sum_{i=1}^{n_{el}}\int_{ V_{d}}\left(u_{el}^{0}-u_{el}\right)\cdot\frac{\partial k_{el}}{\partial y_{el}} \cdot(u_{el}^{0}-u_{el})dV_{el} \tag{13}\]  
The derivative of the element stiffness matrix with respect to \(y\) is obtained by differentiation of the expression of Equation (6). Hence, the term \(\partial k/\partial y_{el}\) is obtained following the expression of Equation (14).  
\[\frac{\partial k}{\partial y_{el}}=\frac{\partial E}{\partial y_{el}}\cdot k_{0} \tag{14}\]  
The term \(k_{0}\) is not a function of \(y\) and thus is not affected in the differentiation. The final part of the sensitivity analysis is to obtain the derivative of the material Young's modulus with respect to \(y\). Thus, the term \(\partial E/\partial y_{el}\) is obtained following the expression of Equation (15).  
\[\frac{\partial E}{\partial y_{el}}=p\cdot y_{el}^{p-1}\cdot(E^{0}-E_{min}) \tag{15}\]