# Topology Optimization of Multi-Materials Compliant Mechanisms
## 2 The Topology Optimization Model for Multi-Material Compliant Mechanisms
### Topology Optimization Model and Sensitivity Analysis of Multi-Material Compliant Mechanisms  
Compliant mechanisms often have the requirement of output specific displacement, Figure 2 shows the design model of multi-material compliant mechanisms. The design domain of the mechanism is composed of three materials, which need to produce displacement \(u_{out,i}\) to clamp the target under the action of force \(F_{1}\).  
Based on the generalized SIMP material interpolation model, taking the least square difference between the actual displacement and the target displacement of each output index point as the optimization objective, the mathematical model for topology optimization of multi-material compliant mechanisms is shown in Equation (4):  
\[\begin{array}{c}\min:C(x)=\sum\limits_{i=1}^{M}a_{i}(u_{out,i}-u^{*}_{out,i} )^{2}=\sum\limits_{i=1}^{M}a_{i}(\sum\limits_{e=1}^{N}x^{p}_{e}\bar{u}^{T} \overline{k}\overline{\epsilon}u-u^{*}_{out,i})^{2}\\ \text{s.t.}:\left\{\begin{array}{c}K\text{{U}}=F\\ K\overline{\text{{U}}}=L\\ V_{x1}=\sum\limits_{i=1}^{N}x_{1,0}v_{1}<V_{10}\\ V_{x2}=\sum\limits_{i=1}^{N}x_{1,1}v_{2}<V_{20}\\ 0<x_{\min}<x_{1,0}<x_{\max}<1\\ 0<x_{\min}<x_{1,1}<x_{\max}<1\end{array}\right.\end{array} \tag{4}\]  
where \(C(x)\) is the objective function; \(U\) and \(U\) are the displacement fields of the mechanism under the driving load \(F\) and the virtual adjoint load \(L\) respectively; \(K\) is the global stiffness matrix of the multi-material mechanism; and \(V_{x1}\) and \(V_{x2}\) are the optimized volume of materials \(V_{10}\) and \(V_{20}\), respectively.  
The sensitivity analysis is generally used in SIMP-based optimization problem solving, which refers to the objective function's responsiveness to the design variables. The objective function sensitivity of the multi-material density separately derivation. The sensitivity of the objective function of the first material is as following:  
\[\begin{array}{c}\frac{\partial C}{\partial x_{1,0}}&=F^{T}K^{-1}(\frac{ \partial F}{\partial x_{1,0}}-\frac{\partial K}{\partial x_{1,0}}U)\\ &=-\overline{U}^{T}\frac{\partial K}{\partial x_{1,0}}U\end{array} \tag{5}\]  
Figure 2: The design model of multi-material compliant mechanisms.  
The sensitivity of the objective function to the second material can be formulated as:  
\[\begin{array}{ll}\frac{\partial\mathcal{C}}{\partial x_{1,1}}&=F^{T}K^{-1}( \frac{\partial F}{\partial x_{1,1}}-\frac{\partial K}{\partial x_{1,1}}U)\\ &=-\overline{U}^{T}\frac{\partial K}{\partial x_{1,1}}U\end{array} \tag{6}\]  
\(\partial C/\partial x_{1,0}\) and \(\partial C/\partial x_{1,1}\) are expanded as follows:  
\[\begin{array}{ll}\frac{\partial k_{c}}{\partial x_{1,0}}=px_{1,0}^{p-1}(x_{ 1,1}^{p}E_{2}+(1-x_{1,1}^{p})E_{1}-E_{0})\frac{k_{c}}{E(x_{1,0}x_{1,1})}\\ \frac{\partial k_{c}}{\partial x_{1,1}}=px_{1,0}^{p}x_{1,1}^{p-1}(E_{2}-E_{1}) \frac{k_{c}}{E(x_{1,0}x_{1,1})}\end{array} \tag{7}\]  
The process of topology optimization of the multi-material compliant mechanisms is shown in Figure 3. Firstly, the design domain is initialized. secondly, the finite element mesh is divided, the equivalent stiffness matrix and elastic modulus are calculated, then the topology optimization mathematical model of the multi-material material compliant is established and sensitivity analysis is performed, and the design variables are updated by the Globally Convergent Method of Moving Asymptotes (GCMMA ) method; finally, whether convergence is achieved or not is judged, and if convergence is achieved, the optimal result is output otherwise the iteration continues.