## 8 Code Validation
### Validation of the Maximum Stress Derivative  
To validate the stress norm derivative of the code provided, its result was compared with the derivative obtained through finite differences. To do so, the design density of the elements located at points A, B, and C (shown in Figure 3) were changed individually, and the value of the maximum stress approximation was used to apply the finite differences. This procedure was repeated for the three elements, considering three different mesh sizes of 3.0 mm, 1.0 mm, and 0.5 mm, each increasing the order of magnitude of the total number of elements by 1, and different design density changes of 0.1, and 0.01. These density changes were chosen to conform with the maximum stiffness element difference allowable by ABAQUS(r). The results obtained are summarized in Table 3.  
It can be observed that the results obtained through finite differences are in good agreement with the derivative obtained by the Python code implemented, especially when the mesh size and the design density decrease.  
Table 4 indicates the average values of \(\frac{\partial\sigma^{PN}(\rho)}{\partial\rho}\) and its components \(\partial\sigma^{PN}_{spf}(\rho)\) and \(\partial\sigma^{PN}_{u}(\rho)\) observed in the L-bracket model as a function of the element mesh size and design density. These data indicated that the approximation proposed in [100] (described at the end of Section 3.4) should not be adopted for the present problem.  
\begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline  & \multicolumn{2}{c}{**CPS4**} & \multicolumn{2}{c}{**CPE4**} & \multicolumn{2}{c}{**S4**} & \multicolumn{2}{c}{**C3D8**} \\ \cline{2-10}  & \(\mathbf{E^{i}_{rr}}\) **(\%)** & \multicolumn{2}{c}{**Int. Points**} & \(\mathbf{E^{i}_{rr}}\) **(\%)** & \multicolumn{2}{c}{**Int. Points**} & \(\mathbf{E^{i}_{rr}}\) **(\%)** & \multicolumn{2}{c}{**Int. Points**} & \(\mathbf{E^{i}_{rr}}\) **(\%)** & \multicolumn{2}{c}{**Int. Points**} \\  & \(\mathbf{E^{i}_{rr}}\) **(\%)** & \multicolumn{2}{c}{**Int. Points**} & \(\mathbf{E^{i}_{rr}}\) **(\%)** & \multicolumn{2}{c}{**\(\mathbf{E^{i}_{rr}}\) **(\%)**} & \multicolumn{2}{c}{**\(\mathbf{E^{i}_{rr}}\) **(\%)**} & \multicolumn{2}{c}{**\(\mathbf{E^{i}_{rr}}\) **(\%)**} & \multicolumn{2}{c}{**\(\mathbf{E^{i}_{rr}}\) **(\%)**} \\ \hline \(\xi_{11}\) & 0.05 & 99.65 & 0.90 & 63.39 & 0.49 & 97.29 & 0.44 & 96.37 \\ \(\xi_{22}\) & 0.15 & 99.55 & 0.97 & 63.31 & 0.44 & 97.60 & 0.44 & 96.37 \\ \(\xi_{33}\) & - & - & - & - & - & 0.44 & 96.37 \\ \(\xi_{12}\) & 0.04 & 99.51 & 0.04 & 99.51 & 1.95 & 32.45 & \textless{}0.01 & 100.0 \\ \(\xi_{13}\) & - & - & - & - & - & - & \textless{}0.01 & 100.0 \\ \(\xi_{23}\) & - & - & - & - & - & - & \textless{}0.01 & 100.0 \\ \(\sigma_{11}\) & 0.00 & 99.88 & 1.85 & 31.74 & 0.61 & 95.89 & 1.45 & 44.81 \\ \(\sigma_{22}\) & 0.15 & 99.65 & 2.00 & 63.41 & 0.61 & 97.29 & 1.45 & 96.36 \\ \(\sigma_{33}\) & - & - & - & - & - & 1.45 & 44.82 \\ \(\sigma_{12}\) & 0.01 & 99.55 & 0.01 & 99.55 & 0.77 & 77.44 & \textless{}0.01 & 100.0 \\ \(\sigma_{13}\) & - & - & - & - & - & \textless{}0.01 & 100.0 \\ \(\sigma_{23}\) & - & - & - & - & - & \textless{}0.01 & 100.0 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Average pondered error between the elements implemented in the code and the ABAQUS® output. The dimensions are represented in millimeters.