\chapter{Simulations}
The numerical simulations studied in this section define the main tool for evaluation and validation of the ultrasound technique. It includes assessment of the homogenized coefficient predictions by means of the FEM method under the clinical-range of porosities regarding to standard literature, elastodynamic simulations associated to the experimental device on time-and frequency formulations and the processing of \textit{Lamb}-modes characterizing the material behavior recorded at the receivers. In this context, aspects such as computational costs, fidelity derived from the meshes and instabilities are faced at various degrees of success.
Moreover, \texttt{Python} source code to recreate the results is freely available at the repository \href{www.github.com/PublicMistakes/Codes}{github.com/Reidmen}.

\section{Numerical Solutions to Cell Problems}
Following the developments done before to obtain effective equations governing the macroscopic mechanical behavior of cortical bone, one of the main difficulties to solve is related to the so-called cell problems which contains the non-linear component associated to the homogenized coefficients.
Such a PDE problem is characterized by unique vector-valued solutions $\mathbf{N}^{rs} \in \mathbf{H}^1 (\mathbf{Y})$ for each $r,s \in \{1,\dots, d\}$ satisfying the elliptic PDE system:
\begin{equation}
    \label{CellProblem-System}
    \left \{
    \begin{array}{cc}
        - \partial_{y_j} \big[C_{ijkl}(\mathbf{y}) \mathbf{e}_{kl,y} \big( \mathbf{N}^{rs}(\mathbf{y}) \big)  \big] = \partial_{y_j} \big( C_{ijrs} (\mathbf{y}) \big)& \text{ in } \mathbf{Y} \\
        \big[ C_{ijkl}(\mathbf{y}) \mathbf{e}_{kl,\mathbf{y}}\big( \mathbf{N}^{rs}(\mathbf{y}) \big) \big]n_j = \mathbf{0} &  \forall \mathbf{y} \in \partial \mathbf{Y}
    \end{array}
    \right.
\end{equation}
where it is added the condition
\begin{equation*}
    \int_{\partial Y} \mathbf{N}^{rs}(\mathbf{y}) \, d\mathbf{y} = \mathbf{0}
\end{equation*}
to obtain uniqueness, since the right hand side of (\ref{CellProblem-System}) is constructed to satisfy average equal $\mathbf{0}$.
The variational formulation is derived using integration by parts, in which for $\phi \in \mathbf{H}^1(\mathbf{Y})$ it follows:
\begin{equation*}
    \int_{Y} C_{ijkl}(\mathbf{y}) \mathbf{e}_{kl,\mathbf{y}}(N^{rs}(\mathbf{y})) \partial_{y_j}\phi_i = - \int_{Y}C_{ijrs}(\mathbf{y}) \partial_{y_j} \phi_i + \int_{\partial Y}C_{ijrs}(\mathbf{y}) n_j \phi_i
\end{equation*}

Considering the standard biomechanical literature \cite{Foiret2014}, the bone matrix is mainly made from hydroxyapatite, a material which can be modeled with a linear elastic behavior and inclusion defining the mesoscale composed mainly of saturated fluid, which in this approximation is assumed of static elastic type. Taking axial symmetry along the long axis of bone, the composed material is modeled with transverse isotropy for each component $C^m_{ijkl}$, $C^f_{ijkl}$ of matrix and water phases respectively.
Thus, it follows the elastic tensor $C_{ijkl}$ defined on the cell $\mathbf{Y}$ by
\begin{equation*}
    C_{ijkl} (\mathbf{y}) := C^m_{ijkl} \mathbb{I}_{\{\mathbf{y} \in  \mathbf{Y}_{m}\}} + C^f_{ijkl} \mathbb{I}_{\{ \mathbf{y} \in \mathbf{Y}_{p}\}}
\end{equation*}
Such component-wise elastic behavior can be described explicitly using \textit{Voigt} notation as a $6\times 6$ matrix in the 3-dimensional case by:
\begin{equation*}
    C_{ij}(\mathbf{y}) =
    \begin{bmatrix}
    C_{11}(\mathbf{y}) & C_{12}(\mathbf{y}) & C_{13}(\mathbf{y}) & 0 & 0 & 0 \\
    C_{12}(\mathbf{y}) & C_{11}(\mathbf{y}) & C_{23}(\mathbf{y}) & 0 & 0 & 0 \\
    C_{13}(\mathbf{y}) & C_{23}(\mathbf{y}) & C_{23}(\mathbf{y}) & 0 & 0 & 0 \\
    0 & 0 & 0 & C_{44}(\mathbf{y}) & 0 & 0 \\
    0 & 0 & 0 & 0 & C_{44}(\mathbf{y}) & 0 \\
    0 & 0 & 0 & 0 & 0 & C_{66}(\mathbf{y})
    \end{bmatrix}
\end{equation*}

which is given by the transverse isotropy symmetries of the material components. In particular, it is assumed that $C_{55}(\mathbf{y}) = C_{44}(\mathbf{y})$ and $C_{11}(\mathbf{y}) = C_{22}(\mathbf{y})$.

Simulations are done of the homogenized coefficients in function of the porosity level, i.e. setting the circular inclusion with radius $r(p)$ being $p \in (0,1)$ the set of admissible porosity levels, in the form $ p := \frac{\vert \mathbf{Y}_f \vert }{\vert \mathbf{Y}\vert} $. Moreover, 2-dimensional and 3-dimensional cases are assumed over the microstructure to assess different aspects of symmetry.

Explicitly, an increasing array of possible porosity levels is chosen limited to the range of interest, i.e. it is limited to the $[0, 0.3]$ interval of possible porosities. The numerical solution to the model is obtained using the \texttt{UFL} language implemented within the library \texttt{FEniCS}\footnote{The \texttt{FEniCS} project \cite{logg2012automated} is an international initiative, started in 2013 with the objective to automate the solution of mathematical models based of Partial Differential Equations of the type elliptic as the heat equation, hyperbolic as the wave equation, quasi-hyperbolic equations, etc., using the Finite Element theory and formalism to find such solution. More in general, its capable to find an approximate solution by means of a well-posed general variational formulation. Different use scenarios can be seen at \cite{abali2016computational}.\\
Defined as a set of interdependent base \texttt{C++} libraries such as \texttt{DOLFIN} \cite{LoggWells2010a}, \texttt{FIAT}, \texttt{SFC} to just mention some. \texttt{FEniCS} implements a close-to-abstract coding and procedure to solve PDE problems on interface languages such as the native \texttt{C++} or via wrappers \texttt{Python}. Moreover, such base libraries rely on high-performance libraries for the algebra computations necessary in the FEM, such as \texttt{PETSc} which implements iterative solver of \textit{Krylov} type and a range of preconditioner to find an approximate solution $x \in \mathbb{R}^m$ of $Ax = b$ for $\mathcal{M}_{m \times m}(\mathbb{R})$, $b \in \mathbb{R}^m$ for $m \gg 1$.} to solve PDE's in variational formulation.

In particular, it is used the \texttt{PETScKrylov} solver to solve the matrix system obtained after discretization of the variational formulation by FEM, and over such solver we used the \texttt{GMRES} (Generalized Minimal Residual Method)\footnote{The \texttt{GMRES} method is an efficient algorithm to solve large linear systems. It uses an iterative method associated to the Theory of Krylov subspaces to approximate the solution of the system by reducing the high dimensional problem to a sequence of low dimensional, solved each one by least squares.
Explicitly, given $A \in \mathcal{M}_{m\times m} (\mathbb{R})$, $b \in \mathbb{R}^m$ for $m\gg 1$, the \texttt{GMRES} algorithm solves the problem $A x = b$ by solving the problems
\begin{equation*}
    \underset{x \in \mathcal{K}_n}{\text{ min }} \Vert b - Ax \Vert_2
\end{equation*}
for increasing values of $n \in \mathbb{N}$, knowing $\mathcal{K}_n = \mathcal{K}_n(A,b)$ the Krylov space of order $n$ defined by
\begin{equation*}
 \mathcal{K}_n(A,b) = \text{span }\{ b, Ab, \dots, A^{n-1}b \} \subset \mathbb{R}^m
\end{equation*}
At each iteration, its computed the residual by least squares, where under reasonable assumptions of symmetry of the matrix, the residual will be sufficiently small for $n \ll m$.} with preconditioner given by \textit{iLU} (incomplete LU factorization). Such consideration where done to tackle numerical instabilities and non-convergence results, assembling a sparse linear system with better properties for numerical inversion.

Predictions are then compared with the approximation of the homogenized coefficients for cortical bone using the same input coefficient tensor of \textit{Parnell} and \textit{Grimal} (PG), whom by means of a multipolar approximation to the solution of problem (\ref{CellProblem-System}), obtained semi-analytic approximate expressions \cite{Parnell2008}, thus enabling in this case a comparison to a FEM method proposed here to solve each of the cell problems involved in the homogenized coefficient description.

It is important to emphasize that PG solutions define the standard reference used in literature and a relevant comparison study must be done to test validity and robustness under different configurations.

\subsection{2-Dimensional Models}
Taking into account the symmetry condition assumed for the microstructure described as repetition along the long axis of bone, motivates the usage of $d = 2$ with a unit square microstructure domain, i.e. $\mathbf{Y} = (0,1)^2$, being the porosity of circular type.

Figure (\ref{MainHomCoeffsSquare}) contains the predictions of the diagonal homogenized elastic coefficients by means of the FEM, compared to the results obtained from PG.
It is shown a close behavior for the results in the two different mesh sizes. The representative isotropic values, shows differences with a error percentages $< 5 \%$ validating the numerical solutions.

\begin{figure}[!h]
	\centering
	\includegraphics[scale=.5]{images/CellsProb/CellProb_MainHomCoeffsCircular.pdf}
	\caption{Main diagonal elastic homogenized coefficients in \textit{Voigt} notation. They describe an transverse isotropic behavior, spanned in the figure on the biomedical range of $(1,30) [\%]$ cortical porosity. The characteristic microstructure in this case is of unitary square. The blue, orange lines describe the FEM predictions at different mesh sizes, whereas the green line describes the PG approximation.}
	\label{MainHomCoeffsSquare}
\end{figure}

Similarly, figure (\ref{OtherHomCoeffsSquare}) shows the non-diagonal homogenized coefficients that describe the shear behavior again compared to the PG reference case.
It shows a lower percentage error in all the coefficients describing the mechanical behavior related to the axial plane (in this case $C_{55}^{hom}, C_{23}^{hom}$), whereas the $C_{66}^{hom}$ that describes full shear interaction on the anti-axial plane, shows a clear difference toward bigger porosity values with $> 5\%$ percentage errors.

Such failure in the prediction can be attributed to errors regarding to the boundary conditions \textit{Neumann} conditions being imposed, and moreover to the assumption on the characteristic microstructure. Nevertheless, as the PG predictions for the $C_{66}^{hom}$ are validated with respect to experimental data results under an error percentages of $> 5 \%$, the solutions found for such coefficient cannot be rejected since the predictions in are in the same range of error.

\begin{figure}[!h]
	\centering
	\includegraphics[scale=.5]{images/CellsProb/CellProb_OthersHomCoeffsCircular.pdf}
	\caption{Other diagonal elastic homogenized coefficients in \textit{Voigt} notation. They describe an transverse isotropic behavior, spanned in the figure on the biomedical range of $(1,30) [\%]$ cortical porosity with unitary square characteristic microstructure.}
	\label{OtherHomCoeffsSquare}
\end{figure}

The explicit results of error percentages associated to the predictions for the complete homogenized elastic tensor are shown in table (\ref{HomCoeffSquareTable}).
It describes the clear correspondence between coefficients associated to the axial plane with errors $< 0.1\%$, whilst differences over all anti-axial coefficients such as $C_{12}^{hom}, C_{66}^{hom}$.
\begin{table}[!h]
\centering
    \begin{tabular}{ |p{2.2cm}||p{2cm}|p{2cm}|p{2cm}|p{2cm}| }
    \hline
    \multicolumn{5}{|c|}{\textbf{Homogenized Coefficients}} \\
    \hline
    \textbf{Error} [\%] & $\phi = 5 \%$ & $\phi = 10 \%$ & $\phi = 15 \%$ & $\phi = 20 \%$ \\
    \hline
    $C^{hom}_{22}$ & 0.6 \% & 1.3 \% & 1.3 \% & 1.5 \% \\
    $C^{hom}_{33}$ & <0.1 \% & <0.1 \% & <0.1 \% & <0.1 \% \\
    $C^{hom}_{55}$ & <0.1 \% & <0.1 \% & <0.1 \% & <0.1 \% \\
    $C^{hom}_{66}$ & 1.4 \% & 3.3 \% & 6.3 \% & 9.0 \% \\
    $C^{hom}_{12}$ & <0.8 \% & 1.5 \% & 3.3 \% & 5.9 \% \\
    $C^{hom}_{23}$ & 0.4 \% & <0.1 \% & 0.3 \% & 1.0 \% \\
    \hline
    \end{tabular}
    \caption{Percentage errors of the homogenized coefficient with respect to the PG reference case. The tensors are written in \textit{Voigt} notation and microstructure is defined by a 2-dimensional unitary square with periodic perforation as porosity as shown schematically in (\ref{HomBasicScheme}).}
    \label{HomCoeffSquareTable}
\end{table}

To assess the high error percentage obtained from (\ref{HomCoeffSquareTable}) shown on the non-axial related coefficients within the 2-dimensional domain, its proposed to study a hexagonal type domain following the idealization proposed from \cite{Parnell2008}. In this sense, it's expected corrections over the cell-problems that could contribute to such assumption.

In the following, it will be considered a 2-dimensional hexagonal polygon domain with porosity inclusion of circular type. As before, simulations are done using the same solver proposed for the square case, the linear system derived from the governing system (\ref{CellProblem-System}) is solved preconditioned using an iterative solver.

Figure (\ref{MainHomCoeffHexa}) describe the predictions results for the diagonal coefficients in this case by the FEM method, compared to the reference results. It shows a clear prediction on the two main diagonal coefficients, being the isotropic values with percentage errors $< 1 \%$, thus a best prediction in this cases.
\begin{figure}[!h]
	\centering
	\includegraphics[scale=.5]{images/CellsProb/CellProb_MainHomCoeffsCircularHexa.pdf}
	\caption{Main diagonal elastic tensor coefficients in \textit{Voigt} notation. The figure shows the prediction values over the range $(1,30) [\%]$ of porosities with characteristic microstructure defined by an hexagonal 2-dimensional polygon. The blue, orange lines describe the FEM predictions at different mesh sizes, whereas the green line describes the PG approximation.}
	\label{MainHomCoeffHexa}
\end{figure}
Similarly, figure (\ref{OtherHomoCoeffsHexa}) shows the non-diagonal elastic coefficients describing shear behavior comparing again to (PG) approximations. The coefficients connected to the axial-plane shows predictions with errors $< 2 \%$, therefore validated under the clinical range, whereas the problematic prediction of the $C_{66}^{hom}$ coefficient persist as in the case before and moreover, the errors become $> 15 \%$ at bigger porosity values.

As before, the prediction failure is related to the boundary conditions being imposed on the domain, and the continuity conditions over the mesh. The instability effects obtained, shows a clear dependence on the mesh size, thus further studies must be done.
\begin{figure}[!h]
	\centering
	\includegraphics[scale=.5]{images/CellsProb/CellProb_OthersHomCoeffsCircularHexa.pdf}
	\caption{Shear type elastic homogenized coeffs. in \textit{Voigt} notation. The figure shows the behavior over the range $(1,30) [\%]$ porosity with characteristic microstructure described by a hexagonal 2-dimensional polygon.}
	\label{OtherHomoCoeffsHexa}
\end{figure}
Finally, the explicit results of percentage errors are shown in the table (\ref{HomCoeffHexaTable}). It describes the clear correspondence between elastic homogenized coefficients with axial connection, and the error prediction on the $C_{66}^{hom}$ which is attributed to a full non-axial behavior, not captured within the 2-dimensional microstructure assumption.

\begin{table}[!h]

\centering
    \begin{tabular}{ |p{2.2cm}||p{2cm}|p{2cm}|p{2cm}|p{2cm}| }
    \hline
    \multicolumn{5}{|c|}{\textbf{Homogenized Coefficients}} \\
    \hline
    \textbf{Error} [\%] & $\phi = 5 \%$ & $\phi = 10 \%$ & $\phi = 15 \%$ & $\phi = 20 \%$ \\
    \hline
    $C^{hom}_{22}$ & <0.1 \% & <0.1 \% & <0.1 \% & 0.3 \% \\
    $C^{hom}_{33}$ & 0.2 \% & 0.3 \% & 0.1 \% & 0.7 \% \\
    $C^{hom}_{55}$ & 0.3 \% & 0.5 \% & 0.1 \% & 1.2 \% \\
    $C^{hom}_{66}$ & 4.0 \& & 8.6 \% & 13.2 \% & 18.2 \% \\
    $C^{hom}_{12}$ & 0.7 \% & 2.1 \% & 4.4 \% & 7.2 \% \\
    $C^{hom}_{23}$ & 0.2 \% & 0.7 \% & 1.4 \% & 2.5 \% \\
    \hline
    \end{tabular}
    \caption{Percentage errors between the homogenized coefficients and the PG reference case. The tensors are expressed in \textit{Voigt} notation with microstructure defined as a hexagonal polygon with circular perforation acting as porosity.}
    \label{HomCoeffHexaTable}
\end{table}

From tables (\ref{HomCoeffSquareTable}), (\ref{HomCoeffHexaTable}) it can be concluded that the 2-dimensional axial type description of the characteristic periodic microstructure relates correctly to realistic mechanical behavior in bone, nevertheless it lacks of non-axial type description regarding to PG predictions. It related then to a possible failure to incorporate non-axial structures that marginally could affect the homogenized coefficients by means of the two-scale framework. Such effects are currently under study in a experimentally oriented setting \cite{Cai2019}.

\subsection{3-Dimensional Model}
To test the insight observed using 2-dimensional case and assuming the lower percentage error shown from the unit-square type domain, a 3-dimensional cubic domain with cylindrical type inclusion is proposed as periodic microstructure characteristic of cortical bone, i.e. $\mathbf{Y} = (0,1)^3$. Such new degree of freedom is expected to contribute on the non-axial behavior, thus incorporating missing elements that are vanished from a lower dimensional description. However, it requires computational cost associated to finer meshes for fidelity results. \\

The figure (\ref{Main3dHomCoeffSquare}) describes diagonal coefficients by means of FEM method, comparing with PG predictions. Nevertheless, the isotropic ratio predicts a different behavior from the 2-dimensional models, assumed from the new terms describing multiple axial and anti-axial interaction on the cell PDE system.
\begin{figure}[!h]
	\centering
	\includegraphics[scale=.5]{images/CellsProb/3DCellProb_MainHomCoeffsCircular.pdf}
	\caption{Main diagonal elastic tensor coefficients in \textit{Voigt} notation. It describes prediction values over the range $(1,30) [\%]$ of porosities with 3-dimensional cubic characteristic microstructure. The blue, orange lines describe the FEM predictions at different mesh sizes, whereas the green line describes the PG approximation.}
	\label{Main3dHomCoeffSquare}
\end{figure}
Similarly, (\ref{Other3dHomCoeffSquare}) describes non-diagonal coefficients that in the 2-dimensional case contains greater error percentages.

As stated before, such behavior assumed as interactions between non-axial and axial behavior as described from $C_{55}^{hom}, C_{23}^{hom}$ coefficients, shows error of $\sim 1 \%$ regarding to PG predictions. Thus, such error result close to 2-dimensional models tested before, but it remains with different behavior on the $C_{66}^{hom}$ coefficient.

\begin{figure}[!h]
	\centering
	\includegraphics[scale=.5]{images/CellsProb/3DCellProb_OthersHomCoeffsCircular.pdf}
	\caption{Main diagonal elastic tensor coefficients in \textit{Voigt} notation. It describes prediction values over the range $(1,30) [\%]$ of porosities with 3-dimensional cubic characteristic microstructure. The blue, orange lines describe the FEM predictions at different mesh sizes, whereas the green line describes the PG approximation.}
	\label{Other3dHomCoeffSquare}
\end{figure}

Finally, table (\ref{Hom3dCoeffSquareTable}) shows explicitly error percentages obtained at various porosity levels. It can be concluded that diagonal elastic coefficients, describe with lower errors the mechanical behavior following PG asymptotic solutions, as shown by $C_{22}^{hom}, C_{33}^{hom}$.

Similarly, axial interacting coefficients such as $C_{23}^{hom}, C_{55}^{hom}$ follows predicted values regarding the reference which implies correct incorporation of realistic interaction within long bone axis. Nevertheless, $C_{66}^{hom}$ remains with higher errors of $\sim 10 \%$ which enable us to conclude possible underlying effects from produced from the microstructure, having impact on the overall elastic behavior on bone. Such conclusion it backed-up from the validity of PG model, which fits experimental data with $C_{66}^{hom}$ errors of $\sim 9 \%$. It can be associated moreover to the presence of \textit{Volksmann} canals that interact on the non-axial plane and that are assumed to have minimal impact on the periodic structure, which might not be fully valid at this scale.

\begin{table}[!h]
\centering
    \begin{tabular}{ |p{2.2cm}||p{2cm}|p{2cm}|p{2cm}|p{2cm}| }
    \hline
    \multicolumn{5}{|c|}{\textbf{Homogenized Coefficients}} \\
    \hline
    \textbf{Error} [\%] & $\phi = 5 \%$ & $\phi = 10 \%$ & $\phi = 15 \%$ & $\phi = 20 \%$ \\
    \hline
    $C^{hom}_{22}$ & 2.1 \% & 3.5 \% & 4.6 \% & 4.3 \% \\
    $C^{hom}_{33}$ & 0.5 \% & 0.9 \% & 1.0 \% & 0.2 \% \\
    $C^{hom}_{55}$ & 0.6 \% & 1.3 \% & 1.6 \% & 0.9 \% \\
    $C^{hom}_{66}$ & 1.8 \% & 5.0 \% & 8.1 \% & 9.9 \% \\
    $C^{hom}_{12}$ & 1.4 \% & 1.7 \% & 0.9 \% & 2.1 \% \\
    $C^{hom}_{23}$ & 1.8 \% & 2.7 \% & 3.1 \% & 1.9 \% \\
    \hline
    \end{tabular}
    \caption{Percentage errors between the homogenized coefficients and the PG reference case. The tensors are expressed in \textit{Voigt} notation with 3-dimensional cubic microstructure and cylindrical subdomain describing the porosity.}
    \label{Hom3dCoeffSquareTable}
\end{table}

\section{2-Dimensional Simulations of Wave Propagation}
The simulation setting associated to the experimental measurements is defined by a 2-dimensional rectangular array imitating the frontal plane associated to the cortical bone. In this case, the wave-propagation can be directly compared to the \textit{Lamb}-wave  theory proposed by \textit{Rhee} in \cite{Rhee2007}, thus enabling the numerical validation of the modelling being used.

The transducer excitation source is defined at the upper surface where the omit the interaction between the human skin with bone structure itself, mainly of viscous type.
The experimental measurement and recording procedure consist in the following steps:
\begin{enumerate}
    \item Each emission source within a section of the transducer is placed approximately at a distance of $0.5 \, [mm]$ from one another, being together a set of 5-12 different sources experimentally. Each one activated independently thus defining unique wave-guide propagation profiles, i.e., characterized by (porosity, thickness) pair. The numerical implementation uses data recording reconstructing 8 sources, allowing greater singular value fidelity for comparison, thus containing the standard experimental setting.

    \item The detection is obtained by placing typically 12-24 sensors depending on the configuration used, where each one is placed at a distance approximately of $0.4 \, [mm]$ from one another. In particular, the choice is made regarding the single source or multiple source setting used, with 48 and 66 sensors respectively.
\end{enumerate}
Each force source acting at the surface is modeled on the vertical direction associated to the horizontal plane of the skin pointing to the mid section of the cortical bone with a central time $t_0 > 0$ and angular frequency $f_0 > 0$, i.e., described in the form:
\begin{equation}
    \label{Force-eq}
    \mathbf{F}(\mathbf{x},t) = - e^{\frac{(t-t_0)^2}{2\sigma^2}} cos( 2 \pi (t-t_0) f_0 ) \mathbb{I}_{\mathbf{x} \in \Gamma_u} \hat{j} \quad \text{ on } \Gamma_N
\end{equation}
where $\Gamma_u \subset \Gamma_N$ denotes a subset of the boundaries where the force is applied, being the subscript denoting the upper one (u). Figure (\ref{ForceSource}) shows the explicit form used. In both time and frequency domain simulations, the parameters on the input force are set to $t_0 = 1, \sigma_0 = 0.7, f_0 = 1$. An important aspect shown on the singular value decomposition will be the correspondence between the input force type used and the recorded signal, in particular regarding to the real part of the Fourier transformed input force.

\begin{figure}[!h]
	\centering
	\includegraphics[width=0.9\textwidth]{images/ImgExt/ForceSource.pdf}
	\caption{On the left side, the input force in time domain while on the right side the input force in frequency domain. The implementation is done using $t_0 = 1 [\mu s], \sigma_0 = 0.7 [\mu s], f_0 = 1 [Mhz]$}
	\label{ForceSource}
\end{figure}

Formally the PDE system simulated is defined
by finding the solution of (\ref{HomPDE-Simulation}) under the $\beta$-Newmark (\ref{HomPDE-TimeUpdate}) time scheme with parameters $\beta = 0.36$ and $\gamma = 0.7$.

\begin{equation}
    \label{HomPDE-Simulation}
    \left \{
    \begin{array}{cc}
        \rho^{0} \partial_{tt} u^{(0)} - \nabla \cdot \sigma^{0} (u^{(0)}) = \mathbf{0} & \text{ in } (0,T)\times \Omega \\
        \sigma^{0}_{ij}(u^{(0)}) = C^{hom}_{ijkl}\mathbf{e}_{kl,x}(u^{(0)}) & \text{ in } (0,T)\times \Omega \\
        u^{(0)} = \mathbf{0} & \text{ on } (0,T)\times \Gamma_l \cup \Gamma_r \\
        \sigma^{0}(u^{(0)}) \cdot n = \mathbf{F}(\mathbf{x}) & \text{ on } (0,T)\times \Gamma_u \cup \Gamma_d
    \end{array}
    \right .
\end{equation}

Over such kind of configuration it can be proved theoretically the existence of the so-called \textit{Lamb}-waves that describe the particular guided-wave propagation associated to the elastic coefficients and density of the model being used.
In particular, the presence of a closed domain implies reflection with different directions related to the \textit{Neumann} or \textit{Dirichlet} respectively.

From a computational points of view, its observed the dependence of the mesh discretization with respect to the inverse problem prediction, thus inducing greater computational costs for fidelity prediction. Given such restriction, the 2-dimensional model had the following characteristics:
\begin{enumerate}
    \item A rectangular tetrahedral meshed domain using \texttt{CGALs} library. With tetrahedral cells at optimal mean diameters of $\sim 20 [\mu m]$ used for one-source type simulations and $\sim 40 [\mu m]$ for multiple-source simulations. For a reference mesh, number of points used where $\sim 30.000$ being the triangle cells $\sim 60.000$ at $40 [\mu m]$ and $\sim 90.000$ points with $\sim 300.000$ cells at $20 [\mu m]$.
    \item Its simulated the homogenized elastodynamic model for sets of $(th, po)$ pairs, evaluating then the prediction from the inverse problem solution. The elasticity tensor is of transverse isotropy type, with values obtained from PG predictions since as shown before, there is a correspondence between the FEM simulated coefficients and ones from PG predictions.
    \item The recording from the wave-front propagation is done by point measurements from which is then applied a signal processing step to recover \textit{Lamb}-modes diagrams in the form of $(f,k)$-diagrams.
\end{enumerate}

The figure (\ref{MeshFile2D}) contains a schematic description of the simulation setting for this 2-dimensional case.
\begin{figure}[!h]
	\centering
	\includegraphics[width=\textwidth]{images/ImgExt/SimP5TransIso12M780-MeshFile.png}
	\caption{Schematic setting of the numerical model to simulate. It contains the \textit{Dirichlet} and \textit{Neumann} boundary conditions for the elastodynamic problem. The mesh is done using \texttt{CGALs} library.}
	\label{MeshFile2D}
\end{figure}

Moreover, figure (\ref{Sim2D-TimeStep}) describes an explicit time-step of simulation, it shows in particular the propagated wave-front with their symmetric and anti-symmetric profiles.
\begin{figure}[!h]
	\centering
	\includegraphics[width=\textwidth]{images/ImgExt/SimP6TransIso33M780T310.png}
	\caption{Simulated wave-guide stopped at time $31 [\mu s]$. It shows in colors the intensity of the propagation wave along the rectangular domain and the interaction with the mixed boundary conditions imposed. This case is parametrized by $(6\%, 3.3 [mm])$ porosity-thickness pair.}
	\label{Sim2D-TimeStep}
\end{figure}

\subsection{Case of Multiple Sources}
Its simulated under the setting of 8 force sources activated independently, i.e., one at each experimental simulation, thus defining 8 different wave-guided propagation of the model (\ref{HomPDE-Simulation}).

\begin{rem}
The computation times associated to the multiple-cases setting vary according to the thickness parameter, since it defines the mesh size. Using a test size of $40 \, [\mu m]$ for the diameter of the cells within the mesh, the simulation times for different cases varies between $\sim 16-28$ hrs in the range of thicknesses $1-3 \, [mm]$. Moreover, it is found experimentally a quadratic time increment depending on the mesh size, for which a testing case at $20 [\mu m]$ takes $\sim 5-7$ days under 1 core of a Xeon E5-2660 v2 processor with 4 Gb. DRR3 RAM.
Therefore it was necessary to consider particular properties of the wave propagation to reduce the computational times for each simulation.
\end{rem}

The figure (\ref{FK-DiagramS8P3M28}) describes the \textit{Lamb}-curves obtained from the numerically simulated $(f,k)$-diagram describing the $L_M(f,k)$ functional at different $M$ values, being typically the case $M=4$ used in experimental settings. It shows the validation of the implemented model with respect to the theoretical prediction curves, observing clear correspondence between symmetrical and anti-symmetrical modes.

\begin{figure}[!h]
	\centering
	\includegraphics[width=\textwidth]{images/TimeMultSous/2DTimeS8P3ElasticFK28M780_y.pdf}
	\caption{Numerically simulated $(f,k)$-diagram defined by the function $L_M(f,k)$ of a 2D transverse elastodynamic model. Setting of 8 sources with $3\%$ porosity and thickness of $2.8 [mm]$ with different number of modes $M>0$.}
	\label{FK-DiagramS8P3M28}
\end{figure}

Similarly (\ref{SVD-S8P3M28}) describes the modes in $[dB]$ from the singular value decomposition of the recorded array. It shows the preponderance of the first three modes describing the wave-front that compared naturally to the experimental reference literature. The peak is shown to be at $0.5 [Mhz]$ in clear correlation with the input force peak shown on figure (\ref{ForceSource}). Moreover, the width of the recorded signal varies describing interactions of the wave-front within the mesh.

\begin{figure}[!h]
	\centering
	\includegraphics[scale=.5]{images/TimeMultSous/2DTimeS8P3Elastic28_SV.pdf}
	\caption{Singular values obtained by the SVD decomposition of the recorded signal from the simulated diagram (\ref{FK-DiagramS8P3M28}). It can be seen 8 different curves associated to each force source.}
	\label{SVD-S8P3M28}
\end{figure}

\begin{rem}
The presence of several symmetric and anti-symmetric modes expressed by the \textit{Lamb} waves is related experimentally with higher thickness values, since in this case the range of horizontal propagation is bigger.
\end{rem}
%Under such consideration, its shown on figure (\ref{FK-DiagramS8P3M28}) the wave-front simulations for a different pair $(Th., Po.)$, displaying a greater number of prediction curves.

\subsection{Case of a Single Source}
The above study of simulations with 8-source force to generate one sample of data introduce problems of computation under limited resources and time.
To tackle such problems, it is used the space invariance of the elastic wave, since essentially, the excitation produced by a particular force-source defines a wave-front that propagates throughout the receivers varying only the position of each one of the 8 input forces, thus the recording generated from each one are defined by spatial translation of the wave-front. Therefore by the homogeneity and symmetry of the domain being used nad the parameter independence of the domain, the 8-source setting can be exchanged to a one-source force with a higher number of receivers. This setting produces a decrease of time require to generate a full simulation, explicitly decreasing to 1/8 of the initial time but introducing reflection effects from the boundary conditions that affect the wave-front.

\begin{rem}
In this setting of one-source force, it is simulated for the mesh with cell diameters of $\sim 20 \, [\mu m]$ describing high-fidelity results with respect to the inverse problem prediction. The simulation times range with respect to the mesh thickness, in which under 1 core of a Xeon E5-2660 v2 processor with 4 Gb. DRR3 RAM, it requires $\sim 18-26$ hrs. to describe a full simulation using $1024$ time step associated to $51.2 [\mu s]$ of real-time experimentation.
\end{rem}
It is shown on figure (\ref{FK-DiagramS1P6M33}) the $(f,k)$-diagram associated to the 1-source simulations from such setting described above. It presents natural reflections related to the rectangular 2-dimensional domain with mixed boundary conditions used.
\begin{figure}[!h]
	\centering
	\includegraphics[width=\textwidth]{images/TimeSingSous/2DTime_P6ElasticFK33M1460_y.pdf}
	\caption{Numerically simulated $(f,k)$-diagram defined by the $L_M(f,k)$ functional of a 2D transverse elastodynamic model. Setting of 1 source with $6\%$ porosity and thickness of $3.3 [mm]$ with different $M$ values.}
	\label{FK-DiagramS1P6M33}
\end{figure}

Moreover, figure (\ref{SVD-S1P6M33}) describes the main modes associated to the recorded signal, following a realistic order of magnitude and oscillatory sine-like form characteristic from the input signal being used.
\begin{figure}[!h]
	\centering
	\includegraphics[scale=.5]{images/TimeSingSous/2DTime_P6Elastic33_SV.pdf}
	\caption{Singular values obtained by the SVD decomposition of the recorded signal from the simulated diagram (\ref{FK-DiagramS1P6M33}), describing the 8 simulated recording at the receptors.}
	\label{SVD-S1P6M33}
\end{figure}

The reflections shown in the image (\ref{SVD-S1P6M33}) produced from the simulations corresponds to an aliasing effect in the input signal $S_m(f, \mathbf{x})_{m \in [N^E]}$ in frequency domain at fixed frequency $f \in \mathbb{R}_+$ and receiver location $\mathbf{x}$. Such aliasing express the folding of the $k$-variable \footnote{Associated to the wavenumber description in ultrasound jargon.} by the conjugation property on \texttt{FFT}, i.e.,
\begin{equation*}
    \overline{\texttt{FFT}(S_m(f, \mathbf{x}))(k)} := \sum_{m=0}^M S_m(f, \mathbf{x}) \overline{e^{-2 \pi i \frac{p k}{M}}} = \texttt{FFT}(S_m(f, \mathbf{x}))(-k)
\end{equation*}
in such a way that the norm associated is the same. Moreover since we consider a finite interval $[0, k_{max}]$, such a reflected wavenumber $k$ is given by $k_{max}-k$ as observed in the figure (\ref{FK-DiagramS1P6M33})

Given such a symmetry, its considered the application of the analytic projector defined for a given signal $S$ regular enough by:
\begin{equation*}
    \mathcal{P}(S) := (I + \mathbf{i}\mathcal{H})(S)
\end{equation*}
being $\mathcal{H}$ the Hilbert transform. Such a projector defines the analytic signal of $S$ by constructing its real and imaginary parts.

Since the behavior observed in the $(f,k)$-diagram (\ref{FK-DiagramS1P6M33}) shows symmetry with bigger values of $M$, a natural idea is to use the \textit{Hilbert} transform on the input signal, obtaining a analytic signal which maintains the structure of the \textit{Lamb} modes and moreover recreates experimentally obtained results \textit{in-vivo} and \textit{ex-vivo}.
Applying then such a projection filter we obtain the results qualitatively and quantitatively similar with respect to the real experimental data.

\begin{figure}[!h]
	\centering
	\includegraphics[width=\textwidth]{images/TimeSingSous/2DTimeHilb_P6ElasticFK33M1460_y.pdf}
	\caption{Numerically simulated $(f,k)$-diagram of 2D elastodynamic Model. Setting of 1 source with $6\%$ porosity and thickness of $3.3 [mm]$ applying Hilbert transform to delete reflections.}
	\label{FK-Hil-DiagramS1P6M33}
\end{figure}

\begin{figure}[!h]
	\centering
	\includegraphics[scale=.5]{images/TimeSingSous/2DTimeHilb_P6Elastic33_SV.pdf}
	\caption{Singular values obtained by the SVD decomposition of the recorded signal from the simulation (\ref{FK-Hil-DiagramS1P6M33}), describing the 8 different recordings at the receptors.}
	\label{SVD-Hil-S1P7M33}
\end{figure}

To give statistical results, using uniformly distributed pairs in the parameters space of biomedical interest it is simulated under the above setting, obtaining the following results in terms of Root Mean Square Error (RMSE), validating the model used and the simulations being done.

\begin{table}[!h]
\centering
    \begin{tabular}{l l l}
    \toprule
    \textbf{RMSE} & \textbf{Porosity} (0-30 \%) & \textbf{Thickness} (1-4) [mm]\\
    \midrule
    Axial Meas. & 0.87 \% & 0,02  [mm]\\
    Anti-Axial Meas. & 0.47 \%  & <0.01 [mm]\\
    Composed & 1.2 \% & 0.03 [mm] \\
    \bottomrule
    \end{tabular}
    \caption{RMSE results from time-domain simulations using a set of 8 (porosity, thickness) pairs homogeneously distributed on the space of biomedical interest. Explicitly, the \textbf{Axial Meas.} defines vertical measurements of displacement, \textbf{Anti-Axial Meas.} defines horizontal measurement of displacement, whereas \textbf{Composed} defines measurement of maximum values between each of the two above, thus being of mixed type.}
    \label{TimeInvTable}
\end{table}

A critical aspect regarding the experimental procedure is defined by the device sensitivity towards axial measurements. It has been observed that small variations of the device alignment implies corrupted recording that produce therefore wrong (porosity, thickness) prediction pairs.
In this sense, table (\ref{TimeInvTable}) shows explicitly the direction-sensibility dependence towards the recordings. As Axial and Anti-axial measurement itself retrieve RMSE lower enough in biomechanical settings, the compose recordings of data, retrieve porosity errors order of magnitude higher. Thus, directional data contamination compromise robustness of the inverse problem formulation. Therefore, an aspect that must be considered from the modelling setting as in the experimental device.

\section{Case on Frequency Domain}

The time-domain simulation give results which represent qualitatively the model with enough fidelity, nevertheless such simulation requires relatively small time step in such a way that for full simulations it takes considerable time. Thus, it is necessary to define a model which reduces such computational cost.
To this end, let us note that the signal processing involves application of \texttt{FFT} over the sensors data, a straightforward method is to consider simulations directly on the frequency array of interest $(\omega_i)_{i \in [N^F]}$.

Explicitly, one seek solutions at fixed frequency $\omega \in \mathbb{R}_+$ in the form:
\begin{equation}
    \label{FreqAnsatz}
    u^{\epsilon}(\mathbf{x},t) = \hat{u}^{\epsilon}(\mathbf{x},\omega) e^{i \omega t}
\end{equation}
solving the effective elastic formulation
\begin{equation}
    \label{VectorPDE-Freq}
    \left \{
    \begin{array}{cc}
        -\rho^{0} \omega^2 \hat{u}^{(0)} - \nabla \cdot \sigma^{0} (\hat{u}^{(0)})=\mathbf{0}  & \text{ in }  \Omega \\
        \sigma^{0}_{ij} (\hat{u}^{(0)}) = \mathbf{C}^{hom}_{ijkl} \mathbf{e}_{kl} (\hat{u}^{(0)}) & \text{ in } \Omega  \\
        \hat{u}^{(0)} = \mathbf{0} & \text{ on } \Gamma_D\\
        \sigma^{0} (\hat{u}^{(0)}(\mathbf{x}))\cdot n = \hat{\mathbf{F}} & \text{ on } \Gamma_N \\
    \end{array}
    \right .
\end{equation}
where it was omitted the frequency dependency on the solution $\hat{u}^{(0)}$ for easiness of exposure and denoted $\Hat{\mathbf{F}}(\omega, \mathbf{x})$ the Fourier transform at frequency $\omega$ of $\mathbf{F}(\cdot, \mathbf{x})$. Moreover, the numerical implementation is done using FEM on the variational formulation associated to (\ref{VectorPDE-Freq}).

\subsection{Solutions without Attenuation}
Using the frequency domain scheme proposed in the section before, the \textit{Lamb}-waves contained unnatural discontinuities passing from a symmetric mode to an anti-symmetric one, also $dB$ values ranging with over $10$ orders of magnitude. Such distortion are shown in (\ref{FK-Freq-DiagramS8P12M28}) and (\ref{SVD-Freq-S8P12M28}) respectively. This kind of behavior repeated over different pairs of porosity level under study ranging the full domain of biomedical interest associated to the simulations thus becoming an intrinsic aspect of the elastic operator under study.

\begin{figure}[!h]
	\centering
	\includegraphics[width=\textwidth]{images/FreqRes/2DFreqS8P12ElasticFK28M400_y.pdf}
	\caption{Numerically simulated $(f,k)$-diagram of the $L_M(f,k)$ functional using a 2D frequency domain elastic model. Setting of 8 sources with $12\%$ porosity and thickness of $2.8 \,[mm]$}
	\label{FK-Freq-DiagramS8P12M28}
\end{figure}

\begin{figure}[!h]
	\centering
	\includegraphics[scale=.5]{images/FreqRes/2DFreqS812Elastic28_SV.pdf}
	\caption{Singular values obtained by the SVD decomposition of the recorded signal from the simulation (\ref{FK-Freq-DiagramS8P12M28}), describing the 8 different recordings at the receptors containing resonances.}
	\label{SVD-Freq-S8P12M28}
\end{figure}

Nevertheless, several sets of simulations are done to study and validate the wave-front generated. The table (\ref{FreqInvTable}) shows the RMSE results where the predictions are done using an optimization algorithm to fit the recorded data to a set of references, i.e., solving the inverse problem \cite{Minonzio2018}. Results shows validation of the frequency domain simulations even with the discontinuities observed both in the $(f,k)$-diagram as in the multiple peaks observed on (\ref{SVD-Freq-S8P12M28}). It can be explained from the clear behavior shown even at high-frequencies, thus enabling a clear fitting of the \textit{Lamb}-curves even with discontinuities of the processed signal.
\begin{table}[!h]
\centering
    \begin{tabular}{l l l}
    \toprule
    \textbf{RMSE} & \textbf{Porosity} (0-30 \%) & \textbf{Thickness} (1-4) [mm]\\
    \midrule
    Axial Meas. & 1.15 \% & 0,03  [mm]\\
    Anti-Axial Meas. & 1,11 \%  & < 0,01 [mm]\\
    Composed & 0.8 \% & 0.02 [mm] \\
    \bottomrule
    \end{tabular}
    \caption{RMSE results from frequency-domain simulations using a set of 8 (porosity, thickness) pairs homogeneously distributed on the space of biomedical interest. Explicitly, the \textbf{Axial Meas.} defines vertical measurements of displacement, \textbf{Anti-Axial Meas.} defines horizontal measurement of displacement, whereas \textbf{Composed} defines measurement of maximum values between each of the two above, thus being of mixed type.}
    \label{FreqInvTable}
\end{table}

The presence of discontinuities observed on the curves from  the $(f,k)$-diagram (\ref{FK-Freq-DiagramS8P12M28}) as in the peaks shown on (\ref{SVD-Freq-S8P12M28}) describes a unnatural behavior of the wave-front. Multiple possible causes can be attributed to such effect, ranging from resonance behavior of the mesh itself, discontinuity effects of the discretization procedure or the bad-possedness of the elastic operator itself.

In this particular case, let us recall from the justification section, that the existence results of the elastodynamic solution is derived from the existence of an increasing sequence of eigenvalues associated to the elastic operator (\ref{EigenValuesProp}). In this context, such eigenvalues will be called eigen-frequencies and they correspond to the main cause of such discontinuities observed before on the simulations as will be studied in what follows.

Such a study corresponds to the formulation of an eigenvalue problem associated to the elastic operator, defined as finding the pairs $\{(\lambda_k, u_k) \, : \, k \in \mathbb{N} \} \subset \mathbb{R}_+ \times \mathbf{H}^1(\Omega, \Gamma_D)$ solution to the following variational form:

\begin{equation*}
    \label{VariationalEigenProb}
    \mathcal{I}_{\mathbf{C}^{hom}} (u_k, v) = \lambda_k (u_k, v)_{\Omega} \quad \forall v \in \mathbf{H}^1(\Omega, \Gamma_D)
\end{equation*}
where we identify each eigenvalue to the eigenfrequency $\omega_k = 2 \pi f_k$ associated to our problem in the form:
\begin{equation*}
    \lambda_k = \rho^0 (2\pi f_k)^2, \text{ i.e. } f_k = \frac{1}{2\pi} \sqrt{\frac{\lambda_k}{\rho^0}} \quad k \in \mathbb{N}_{*}
\end{equation*}

\begin{rem}
Let us note in particular that the existence of such pairs is obtained from a classical result of elliptic theory \cite{raviart1983introduction}, \cite{evans2010partial}. Explicitly, it follows since the homogenized coefficients are elliptic and moreover they are bounded which gives us a well-defined bilinear, bicontinuous and coercive operator $\mathcal{I}_{\mathbf{C}^{hom}}(\cdot, \cdot)$ and a linear continuous operator $b(\cdot) := (u_k, \cdot)$ defined respectively on $\mathbf{H}^1(\Omega, \Gamma_D)\times \mathbf{H}^1(\Omega, \Gamma_D)$ and $\mathbf{H}^1(\Omega, \Gamma_D)$.
\end{rem}

By solving the problem (\ref{VariationalEigenProb}), it was found a discrete spectrum with abundant eigen-frequencies in bounded intervals of frequency as predicted from (\ref{EigenValuesProp}), nevertheless the experimental frequency array which was necessary to use for further studies in connection with the real data showed a neighborhood of at least eigen eigen-frequencies over each experimentally selected frequency.

In (\ref{EigenValuesComparison}) is shown the frequencies used in the experimental setting used for the simulations in the frequency domain and the eigen-frequencies associated to the operator under study. It explicitly describes the correspondence of the found eigen-values within a close neighborhood of the simulated frequency array and moreover, intersecting the peaks with resonance modes, thus explaining the resonance and un-natural discontinuity effect observed before.

\begin{figure}[!h]%
    \centering
    \subfloat[Start Bandwidth]{{\includegraphics[width=7cm]{images/FreqRes/SingValues-EigenFreqs00-05.pdf} }}%
    \qquad
    \subfloat[End Bandwith]{{\includegraphics[width=7cm]{images/FreqRes/SingValues-EigenFreqs05-10.pdf} }}%
    \caption{Comparison between Singular Values and Eigen-frequencies: Experimentally its found a increasing sequence of eigenvalues that intersects the experimentally chosen array frequencies.}%
    \label{EigenValuesComparison}%
\end{figure}

\subsection{Solution using Attenuation.}
To bypass the oscillation observed at the frequency-domain problem, its considered adding a $\epsilon$ viscous-like term, such model in particular defines a translation of the eigen-frequencies from the elastic operator to the complex plane, thus avoiding the real plane resonances. In this sense, is expected an smoothing effect on the real part recordings, and moreover this implies avoiding the ill-conditioned matrix system from the FEM space discretization procedure.

For a fix frequency $\omega \in \mathbb{R}$, let us consider solutions in the form: $u(\mathbf{x},t) = e^{ i \omega t}\hat{u}(\mathbf{x})$, so that $\hat{u}\in \mathbf{H}^1(\Omega)$ solves the equivalent problem in the frequency domain
\begin{equation*}
    \left \{
    \begin{array}{cc}
        -\omega^2 \rho^{0} \hat{u} - i \epsilon \hat{u} - \nabla \cdot \sigma^0 (\hat{u}) = \mathbf{0} & \text{ in } \Omega\\
        \sigma^{0}(\hat{u})  =  C_{ijkl}^{hom}\mathbf{e}_{kl}(\hat{u}) & \text{ in } \Omega \\
        \hat{u} = \mathbf{0} & \text{ on } \Gamma_D\\
        \sigma^{0}(\hat{u}) \cdot n = \mathbf{F}(\cdot, \omega) & \text{ on } \Gamma_N
    \end{array}
    \right .
\end{equation*}
Taking into account that \texttt{FEniCS} version 2017.2.0 doesn't support the usage of a complex coefficient formulation in the variational form, its decomposed the solution in their real and complex part as $\hat{u} = \hat{u}_R + i \hat{u}_I$. It follow then a coupled system satisfied for the pair $(\hat{u}_R, \hat{u}_I)$ given in the form:
\begin{equation*}
    \left \{
    \begin{array}{cc}
        -\omega^2 \rho^0 \hat{u}_R +  \omega \epsilon \hat{u}_I - \nabla \cdot \sigma (\hat{u}_R) = \mathbf{0} & \text{ in } \Omega \\
        -\omega^2 \rho^0 \hat{u}_I - \omega \epsilon \hat{u}_R - \nabla \cdot \sigma (\hat{u}_I) = \mathbf{0} & \text{ in } \Omega \\
        \hat{u}_R, \hat{u}_I = \mathbf{0} & \text{ on } \Gamma_D \\
        \sigma(\hat{u}_R)\cdot n, \sigma(\hat{u}_I)\cdot n = \hat{\mathbf{F}}_R, \hat{\mathbf{F}}_I & \text{ on }\Gamma_N
    \end{array}
    \right.
\end{equation*}
which can be solved with the standard tools of \texttt{FEniCS} by the usage of a mixed element for the couple system.

Simulating such system shows on figure (\ref{FK-DiagramFreqS8P12M28}) the $(f,k)$-diagram associated to the 8-sources setting. It presents natural reflections related to the rectangular 2-dimensional domain used with mixed boundary conditions.
\begin{figure}[!h]
	\centering
	\includegraphics[width=\textwidth]{images/FreqMultSous/2DMixedP12TransIsoFKW28M400_y.pdf}
	\caption{Numerically simulated $(f,k)$-diagram of the $L_M(f,k)$ functional using a 2D transverse elastodynamic model. Setting of 8 sources with $12\%$ porosity and thickness of $2.8 [mm]$ with different $M$ values for signal intensity comparison.}
	\label{FK-DiagramFreqS8P12M28}
\end{figure}

Nevertheless, using figure (\ref{SVD-FreqS8P12M28}) of main modes associated to the recorded signal, its observed vanishing oscillation of the modes, thus numerically avoiding the eigen-frequencies, the main provider of resonances.
\begin{figure}[!h]
	\centering
	\includegraphics[scale=.5]{images/FreqMultSous/2D-FreqSimP12W28eKV_SV.pdf}
	\caption{Singular values obtained by the SVD decomposition of the recorded signal from the simulation (\ref{FK-DiagramFreqS8P12M28}), describing the 8 recorded attenuated signals.}
	\label{SVD-FreqS8P12M28}
\end{figure}

\section{3-Dimensional Simulation of Wave Propagation}
Following the 2-dimensional case, it is now studied the effect of radial wave behavior on the recorded signal, assessing in particular the experimentally obtained results that neglect the non-axial wave-guide propagation. In this sense, is assessed the wave-propagation by using a cylindrical type domain characterizing the cortex curvature and on a non-uniform domain derived from $\mu$-CT images that relates the irregularities of inner surfaces from realistic cortical bone samples.
Such procedures imply the creation of adaptive meshes of the complex cortical bone geometry, where open-source software such as \texttt{iso2mesh}, \texttt{CGAL} is used for its generation and in particular is created a pipeline of mesh generation from $\mu$-CT images.

\subsection{Half-Cylinder Case}
A half-cylinder mesh is proposed as first approximation to the 3-dimensional real cortical bone sample from the $\mu$-CT images. In this case, avoiding the non-uniformity characteristic of the bone surface it's tested the wave-guide propagation and distortion generated by the natural curvature of the mesh.

The numerical model setting is schematically proposed on (\ref{HalfCylSubdomainsFile}), resembling the 2-dimensional case (\ref{MeshFile2D}) with variations associated to the input force width and rectangular-type force sensors. Such sensors are modelled to capture now surface forces of type $\sigma^{hom}(u)\cdot n$ restricted to each sensor subdomain. As before, the problem is modelled with \textit{Dirichlet} boundary conditions on $\Gamma_l \cup \Gamma_r$ and \textit{Neumann} condition on $\Gamma_u \cup \Gamma_d$.

\begin{figure}[!h]
	\centering
	\includegraphics[width=0.8\textwidth]{images/ImgExt/HalfCyl3d-MeshBoundaries.png}
	\caption{Half-Cylinder Mesh defining the geometry for the elastodynamic 1-source simulation with mean diameter of tetrahedral $\sim 40 [\mu m]$. Number of vertices: $176,144$ and number of cells: $956,704$. The colors variations shows the different tagged subdomains describing the numerical implementation and recording on the receptors. In this case, from left to right it's shown source subdomain and force-sensors subdomains in array-like form. }
	\label{HalfCylSubdomainsFile}
\end{figure}

As before, the implementation is done with \texttt{FEniCS} library on time-domain. Applying a post-processing analysis at particular time step with visual behavior effect is shown on figure (\ref{HalfCyl-TimeStep}) using the \texttt{ParaView} library. The figure describes a wave-front propagating along the axial-plane as expected but with characteristic non-axial behavior not present in 2-dimensional simulations.

\begin{figure}[!h]
	\centering
	\includegraphics[width=0.8\textwidth]{images/ImgExt/HalfCyl3d-T160.png}
	\caption{Wrapping by vector effect on the simulated domain with input force $\mathbf{F}(\mathbf{x},t)$ at $8 [\mu s]$. The color intensity described by the right-hand side bar shows the magnitude of displacement scaled at $[mm]$. }
	\label{HalfCyl-TimeStep}
\end{figure}

\begin{rem}
The total simulation time associated to the half-cylindrical mesh is $\sim 25$ hrs. using 2 cores on a Xeon E5-2660 v2 processor with 5 Gb. RAM DDR3. This mesh with cells at $\sim 40 [\mu m]$ defines \textit{Lamb}-waves requiring 1024 time steps partitioning $51.2 [\mu s]$ of real-time simulation.
\end{rem}

The signal recording from the wave-front propagation partially observed from (\ref{HalfCyl-TimeStep}) enables us to observe the first example of numerically generated \textit{Lamb}-modes characteristic of the \textit{Lamb}-wave theory as shown in (\ref{FK-Cyl-DiagramS1P11M18}). In particular, the 3-dimensional curvature effect from the cortical bone doesn't affect the main three modes, nevertheless anti-symmetrical modes are less clear showing variations respect to the theoretical 2-dimensional theoretical model and vanishing at higher frequencies. On the other hand, symmetrical modes preserve their structure on the central range of frequencies $(0.5, 1.5) [Mhz]$. Moreover, its shown already at level $M=4$ strong reflection effects affecting the signal.
\begin{figure}[!h]
	\centering
	\includegraphics[width=\textwidth]{images/ClusterSim/3DCylTimeP11TransIsoFKW18.pdf}
	\caption{Numerically simulated $(f,k)$-diagram of the $L_M(f,k)$ functional using as 3-dimensional Half-cylinder elastodynamic model. Setting of 1 source with $11\%$ porosity and $1.8\,[mm]$ thickness applying Hilbert transform to delete reflections. The inverse formulation retrieves $\sim 1.01\%$ of porosity and $\sim 1.801 \,[mm]$ thickness.}
	\label{FK-Cyl-DiagramS1P11M18}
\end{figure}
With respect to the singular value decomposition of the recorded signal, in figure (\ref{SVD-Cyl-S1P11M18}) the first 3 modes describes a natural behavior in the $(0, 20) \, [dB]$ range associated to the input force currently used. The oscillatory effect is attributed to the cosine component on the force-source, decaying at outside the maximum signal intensity at $\sim 1 \, [MHz]$.
\begin{figure}[!h]
	\centering
	\includegraphics[scale=.6]{images/ClusterSim/3DCylTimeP11TransIsoFKW18_SV.pdf}
	\caption{Singular values obtained by the SVD decomposition of the recorded signal from the simulation (\ref{FK-Cyl-DiagramS1P11M18}). The different modes obtained from the decomposition are shown in different colors, being the first 3 related to the naturally obtain from real \textit{ex-vivo} results.}
	\label{SVD-Cyl-S1P11M18}
\end{figure}

\subsection{Irregular Domain Case}
The half-cylinder shows clear correspondence to the 2-dimensional case, describing prevalence of the axial-propagation over the non-axial effect that occur during the wave-front. Nevertheless, it does not incorporates possible irregularities arising from constant development of bone, being not only the curvature effect relevant to a realistic simulation but also the presence of non-uniform irregularities mainly from the interior surfaces on cortical bone samples. In this case, it is assessed the mesh creation based on real $\mu$-CT cortical bone images and the data-flow necessary to create a well-defined mesh, simulation and processing of results.

\subsubsection{Mesh Generation}

The mesh generation is done using the data-flow diagram presented in (\ref{DiagramMeshGeneration}). Such procedure works by applying several layer of software. It creates a complex tetrahedral mesh from processed volumetric images using as back-end \texttt{CGAL} library that compute the geometry.
The processing of the $\mu$-CT gray-scale images stack is defined in three main steps:
\begin{enumerate}
    \item A scaling procedure from input $9 \, [\mu m]$ voxel images is done to restrict the memory consumption from the full stack of $\mu$-CT images. The output images are obtained with $56 \, [\mu m]$ voxel, i.e., considering a $40 \%$ scaling factor with cubic interpolator.
    \item The stack is separated between gray-scale value ranges, to isolate the different sets of constituent materials. In this case, the separation of the mesoscale is done, being porosity and bone matrix voxels labeled.
    \item Finally, each labeled set of voxels is stacked, defining a volumetric image on \texttt{Octave}, meshed with \texttt{Iso2mesh} library which wraps functions containing the \texttt{CGAL} algorithms of mesh generation.
\end{enumerate}
\begin{figure}[!h]
	\centering
	\includegraphics[scale=.5]{images/ImgExt/DiagramMeshGeneration.png}
	\caption{Data-Flow. The mesh generation involves a sequence of different software \texttt{Fiji, Octave, iso2mesh, CGAL} that used in sequence generates complex adaptive meshes that describe realistic geometries.}
	\label{DiagramMeshGeneration}
\end{figure}

The 3-dimensional elastodynamic study of the homogenized bone is done by considering the above mesh generation (\ref{DiagramMeshGeneration}) ignoring the labeled sets, thus defining an uniform interior mesh being adaptive to the surface irregularities.
To keep the scaled distance relating to the experimental setting, it is used $1000$ slices from the stack, thus defining real $56 \, [mm]$ of cortical bone geometry.

The objective then is to recover the dispersion curves associated to the 2-dimensional model but now incorporating the surface effect from the curvature and irregularities, that are expected to affect the behavior of the \textit{Lamb}-curves and thus the recorded signal itself.

By applying the generation procedure described before, it follows the realistic irregular mesh pictured in (\ref{HomBoneMeshFile}). It characterizes a cortical bone sample of $56 \, [mm]$ length in the long direction describing a thickness of $\sim 1.8 [mm]$.

\begin{figure}[!h]
	\centering
	\includegraphics[width=0.8\textwidth]{images/ImgExt/CorticalBoneS1000OPT20-View.png}
	\caption{Mesh Generated from 1000 Slices from $\mu-CT$ images using the mesh-generation diagram (\ref{DiagramMeshGeneration}). It characterizes a cortical bone sample of $56 \, [mm]$ length in the long direction associated to a thickness $\sim 1.8 [mm]$ and experimentally tested porosity of $\sim 11 \%$. Explicitly, the mesh is described by $432,280$ vertices with $1,393,709$ tetrahedrons.}
	\label{HomBoneMeshFile}
\end{figure}

 \subsubsection{Simulation and Results}

The configuration is defined similar to the cylindrical case. The figure (\ref{HomBoneSubdomainsFile}) describes explicitly the settings of rectangular sources and receivers implemented, each one defined by a width of $\sim 0.8 [mm]$ with height $\sim 8 [mm]$ located at the top surface of the mesh. As in the cylinder case, the receivers record force-signal of type $\sigma^{0}(u)\cdot n$ over each of the subdomain locations.
\begin{figure}[!h]
	\centering
	\includegraphics[width=0.8\textwidth]{images/ImgExt/Cortical3dsc04Mesh1000Fill-MeshBoundaries.png}
	\caption{The colors markers define the different subdomains associated to the mesh (\ref{HomBoneMeshFile}). It is described $48$ receivers and a transmitter locations in a array-like form resembling the experimental transducer. Moreover, each subdomain is defined approximately by $\sim 200$ marked tetrahedral cells.}
	\label{HomBoneSubdomainsFile}
\end{figure}
The adaptive mesh (\ref{HomBoneMeshFile}) resembles a real geometry by meshing the irregularities on the inner surface characteristics of a natural cortical bone sample.

Over such geometry is simulated an elastodynamic model propagating a guided wave and thus generating the dispersion curves of figure (\ref{FK-HomBone-DiagramS1P11M18}) related to the wavefront in figure (\ref{HomBone-TimeStep}). Varying in color intensity, it is shown the wave-front interacting with the non-uniform mesh. Moreover, different view-planes show direct impact in the wave behavior as it interacts with the inner irregular surface, creating points of high displacement. This kind of behavior not observed on the cylindrical case studied before, thus becoming an inherent effect from the irregularities.

\begin{figure}[!h]
	\centering
	\includegraphics[width=0.8\textwidth]{images/ImgExt/Cortical3dsc04Mesh1000Fill-T80.png}
	\caption{The elastodynamic simulation over the irregular mesh is shown at instant $32 \, [\mu s]$, characterizing the wave-front propagation using a intensity color-scheme. The right-hand side bar contains the scale over the simulation, at $0.056 \, [mm]$ associated to the voxel size.}
	\label{HomBone-TimeStep}
\end{figure}

\begin{rem}
The elastodynamic model simulated over this complex domain at $\sim 80 \, [\mu m]$ required 2 cores of a Xeon E5-2660 v2 processor with $\sim 8$ Gb of DDR3 RAM and $\sim 7$ days of computation time. It enables us to obtain complex wave-front propagation affected by the irregularities of the domain.
\end{rem}

The effect produced on the guided-wave from the interaction with the irregularities on the domain are shown in the $(f,k)$-diagram of figure (\ref{FK-HomBone-DiagramS1P11M18}). It shows a clear discrepancy between the reconstructed modes recorded at the receptors and the reference \textit{Lamb}-curves. The main variation is shown on the first anti-symmetric and symmetric modes, which does not fit within the expected behavior. Nevertheless, it can be seen that second modes have behavior fitting the references.
\begin{figure}[!h]
	\centering
	\includegraphics[width=\textwidth]{images/ClusterSim/3DCorticalS1000TimeP11TransIsoFKW18.pdf}
	\caption{Numerically simulated $(f,k)$-diagram  of the $L_M(f,k)$ functional using a 3-dimensional realistic-geometry. Setting of one-source with $11\%$ porosity and $\sim 1.8 [mm]$ thickness. The green lines defines \textit{Lamb} curves created from recording of the wave-guide being the others associated to a reference model.}
	\label{FK-HomBone-DiagramS1P11M18}
\end{figure}
Similarly, singular values associated to data recording described by (\ref{FK-HomBone-DiagramS1P11M18}) are given on (\ref{SVD-HomBone-S1P11M18}) which resembles realistic values given the input force used. The figure shows the first three modes in realistic magnitude scale $(0, 20) \, [dB]$, being the rest of modes of lesser importance given the presence of noise in realistic measurements that should vanish the rest of modes.
\begin{figure}[!h]
	\centering
	\includegraphics[scale=.6]{images/ClusterSim/3DCorticalS1000TimeP11TransIsoFKW18_SV.pdf}
	\caption{Singular values obtained by the SVD decomposition of the recorded signal from the simulated diagram (\ref{FK-Cyl-DiagramS1P11M18}), describing the 8 recordings at the receptors.}
	\label{SVD-HomBone-S1P11M18}
\end{figure}
In comparison with the half-cylinder case it's shown a clear variation on the general wavefront behavior, expressed in modes not align with respect to the reference cases for the parameters used in the simulation. Moreover, figure (\ref{FK-HomBone-DiagramS1P11M18}) shows clear signal distortion at the high frequency range of $(1, 2)\, [Mhz]$ for all the different \textit{Lamb}-curves involved, expressed in color diffusion within the curves. Explicitly, at higher $M$ values, which characterize the amount of receptors information to analyze, shows clear interaction within the domain mesh, thus more error fitting associated to the inverse problem solution.

On the other hand, figure (\ref{FK-Cyl-DiagramS1P11M18}) associated to the half-cylinder setting describes a more regular behavior of the curves in all the frequency range, corresponding to a wave-front in which the curvature effect does not affect the main axial propagation, thus describing at each $M$ values clear \textit{Lamb}-curves, thus fully comparative signal with the 2-dimensional case.

The explanation to such behavior relates to missing interaction within the inner irregularities that fully deform the characteristic wave propagation. Moreover, the simulations shows concentration of displacement in the interior irregularities being an aspect to further investigate. In this sense, the plausible explanation on the first symmetric and anti-symmetric modes is related to missed damping effects on the bone marrow that are not captured in the simulations, which requires a generalization to a viscoelastic model to capture such effects.

%\subsubsection{Fully Porous Material}
%The save Pipeline (\ref{DiagramMeshGeneration}) is used for the mesh generation, now without homogenized coefficients and therefore taking into account the variation on the elastic coefficients depending on the presence of mesoscale structure and cavities.


\newpage
\section{Polynomials}

	\subsection{Techniques to remember}

		\begin{take_note*}{}
			\begin{enumerate}[wide=0em, label=\arabic*, itemsep=10pt, parsep=5pt, font=\bfseries]
				\item A polynomial with odd degree always has at least one real root.
				\item If a polynomial with even degree has a negative value on its graph, then it has at least one real root.
				\item Roots of unity divide a polynomial in parts like congruence classes.
				\item MODULUS SIGN: use Triangle Inequality.
				\item They say, In Poly, chase ROOTS.
				\item $ x^nf(\dfrac{1}{x}) $ has the same coefficients as $ f(x) $, but in opposite order.
			\end{enumerate}
		\end{take_note*}

		\theo{}{Lagrange Interpolation Theorem}{Given $n$ real numbers, there exist a polynomial with at most $n-1$ degree such that the graph of the polynomial goes through all of the points.}

		\theo{}{Finite Differences}{This is the descrete form of derivatives. The first finite difference of a function $ f $ is defined as $ g(x) := f(x+1)-f(x) $.

		$ n+1 $th finite difference of a $ n $ degree polynomial: For any polynomial $P(x)$ of degree at most $n$ the following equation holds: \[\sum_{i=0}^{n+1}(-1)^i \binom{n+1}{i}P(i)=0\]}\label{finite_difference}

		\begin{Remark}
			This can be used
			\begin{enumerate}
				\item to reduce the degree of a polynomial, manipulate the coefficients etc.
				\item to solve recurrences, where the recurrence equation is a bit messy and contains a lot of previous values. Like this recurrence is quite messy to solve as it is, but if we take the first finite difference here, it becomes easy:\[f(x) = \frac{1}{3} f(x+1) + \frac{2}{3} f(x-1) + 1\]

				It's like solving for the first derivative and then finding the original function.
			\end{enumerate}
		\end{Remark}

	\newpage
	\subsection{General Problems}

	\prob{https://artofproblemsolving.com/community/c6h587303p3476290}{USA TST 2014 P4}{E}{Let $n$ be a positive even integer, and let $c_1, c_2, \dots, c_{n-1}$ be real numbers satisfying \[ \sum_{i=1}^{n-1} \left\lvert c_i-1 \right\rvert < 1. \] Prove that \[2x^n - c_{n-1}x^{n-1} + c_{n-2}x^{n-2} - \dots - c_1x^1 + 2\] has no real roots.}

		\solu{A polynomial has no real root means that the polynomial completely lies in either of the two sides of the $x$-axis. So in this case, we have to prove that $P(x)>0$. So we gotta try to bound. Again, to make $\vert c_i-1 \vert$ a little bit more approachable, we assign $b_i=c_i-1$ and write $P(x)$ in terms of $b_i$. Now, how to bring the modulus sign in our polynomial? Oh, we have triangle ineq for those kinda work :0}

	\prob{https://artofproblemsolving.com/community/c6h54043p337849}{USAMO 2002 P3}{H}{Prove that any monic polynomial (a polynomial with leading coefficient $1$) of degree $n$ with real coefficients is the average of two monic polynomials of degree $n$ with $n$ real roots.}

		\solu{(i) If we have $ n+1 $ points, we have an unique polynomial through them.\\
		(ii) If we have one positive value of a polynomial and one negative value, then there exists a real root between that two values.}

	\prob{https://artofproblemsolving.com/community/c6h37599p234868}{China TST 1995 P5}{M}{$ A$ and $ B$ play the following game with a polynomial of degree at least 4: \[ x^{2n} + \_\ x^{2n - 1} + \_\ x^{2n - 2} + \ldots + \_\ x + 1 = 0 \] $A$ and $ B$ take turns to fill in one of the blanks with a real number until all the blanks are filled up. If the resulting polynomial has no real roots, $ A$ wins. Otherwise, $ B$ wins. If $ A$ begins, which player has a winning strategy?}

		\solu{Not always (actually in very few cases) the first move decides the winning strategy. In this case, if $B$ could make the last move, he would definitely win. But as he can't, consider the final two moves. Again ``Waves''.}

	\prob{http://yufeizhao.com/olympiad/imo2008/zhao-polynomials.pdf}{Zhao Polynomials}{E}{A set of $n$ numbers are considered to be $k$-cool if $a_1+a_{k+1}\dots =a_2+a_{k+2}\dots =\dots =a_k+a_{2k}\dots$. Suppose a set of $50$ numbers are $3,5,7,11,13,17$-cool. Prove that every element of that set is $0$.}

		\solu{Equivalence class :0 roots of unity :0 :0 :0}

	\prob{https://artofproblemsolving.com/community/c6h1238101p6307084}{All Russian Olympiad 2016, Day2, Grade 11, P5}{E}{Let $n$ be a positive integer and let $k_0,k_1, \dots,k_{2n}$ be nonzero integers such that $k_0+k_1 +\dots+k_{2n}\neq 0$. Is it always possible to find a permutation $(a_0,a_1,\dots,a_{2n})$ of $(k_0,k_1,\dots,k_{2n})$ so that the equation \[a_{2n}x^{2n}+a_{2n-1}x^{2n-1}+\dots+a_0=0 \] has no integer roots?}

	\solu{The degree is $2n$, and we have to find a zero, so proving/disproving the existence of negative value of $P(x)$ is enough. If all the values of $P(x)$ are to be positive, the leading coefficient must be very big...}

	\prob{https://artofproblemsolving.com/community/c6h1296837p6886800}{Zhao Poly}{E}{Let $f(x)$ be a monic polynomial with degree $n$ with distinct zeroes $x_1,x_2,...,x_n$. Let $g(x)$ be any monic polynomial of degree $n-1$. Show that $$\sum_{j=1}^{n}\dfrac{g(x_j)}{f'(x_j)} =1$$ where $f'(x_i) = \displaystyle\prod_{j\neq i} (x_i-x_j)$}

	\solu{Lagrange's Interpolation}

	\prob{https://artofproblemsolving.com/community/c6h1634950p10278510}{ARO 2018 P11.1}{E}{The polynomial $P (x)$ is such that the polynomials $P(P(x))$ and $P(P(P(x)))$ are strictly monotone on the whole real axis. Prove that $P (x)$ is also strictly monotone on the whole real axis.}

	\prob{https://artofproblemsolving.com/community/c6h1619736p10134447}{Serbia 2018 P4}{E}{Prove that there exists a uniqe $P(x)$ polynomial with real coefficients such that
		\[xy-x-y\mid (x+y)^{1000}-P(x)-P(y)\] for all real $x,y$.}

		\solu{Substitution.}

	\subsection{Root Hunting}

		\prob{https://artofproblemsolving.com/community/c7h1554572p9472758}{Putnam 2017 A2}{E}{Let $Q_0(x)=1$, $Q_1(x)=x,$ and	\[Q_n(x)=\frac{(Q_{n-1}(x))^2-1}{Q_{n-2}(x)}\]for all $n\ge 2.$ Show that, whenever $n$ is a positive integer, $Q_n(x)$ is equal to a polynomial with integer coefficients.}

	\subsection{NT Polynomials}

		\prob{https://artofproblemsolving.com/community/c6h276183p1494541}{Iran TST 2009 P4}{E}{Find all polynomials $f$ with integer coefficient such that, for every prime $p$ and natural numbers $u$ and $v$ with the condition:
			\[ p \mid uv - 1 \]
		we always have
			\[p \mid f(u)f(v) - 1\]}

			\solu{Notice that we can disregard $ v $ by considering it $ \dfrac{1}{u} $, and the condition won't be affected, because primes allow multiplicative inverses. After this observation the problem is almost solved.}

		\prob{https://artofproblemsolving.com/community/c6h6448p22328}{Iran TST 2004 P6}{E}{$p$ is a polynomial with integer coefficients and for every natural $n$ we have $p(n)>n$. $x_k $ is a sequence that: $x_1=1, x_{i+1}=p(x_i)$ for every $N$ one of $x_i$ is divisible by $N.$ Prove that $p(x)=x+1$}

			\solu{Notice that $ \{x_i\} $ becomes periodic mod any prime. Now, we start by showing that $ P(1)=2 $. We have, $ P(x) $ has to be even. If it is $ >2 $ then what happens? what if we take $ N=P(1)-1 $?}

		\prob{https://artofproblemsolving.com/community/c6h101487p572821}{ISL 2006 N4}{E}{Let $P(x)$ be a polynomial of degree $n > 1$ with integer coefficients and let $k$ be a positive integer. Consider the polynomial $Q(x) = P(P(\dots P(P(x))\dots ))$, where $P$ occurs $k$ times. Prove that there are at most $n$ integers $t$ such that $Q(t)=t$.}

			\solu{Suppose that there are more than $n$ fixed points. So at least one of them can’t be a fixed point of $P$. Use that. Follow.}

		\prob{https://artofproblemsolving.com/community/c6h546164p3160553}{ISL 2012 A4}{H}{Let $f$ and $g$ be two nonzero polynomials with integer coefficients and $\deg f>\deg g$. Suppose that for infinitely many primes $p$ the polynomial $pf+g$ has a rational root. Prove that $f$ has a rational root.}

			\solu{dunno}

	\subsection{Fourier Transformation}

		\lem{Dealing with binomial terms with a common factor}{Let $ n, k $ be two integers, and let $ z $ be a $ k $th root of unity other than $ 1 $. Then, \[\binom{n}{0} + \binom{n}{k} + \binom{n}{2k} + \dots = \frac{(1+z^1)^n + (1+z^2)^n + \dots+ (1+z^k)^n }{k} \]}

			\proof{For $ j $ not divisible by $ k $, \[z^j\left(\sum_{i=1}^{k} z^i\right) =0\]}


\section{Why we need deep neural networks via composition}\label{whydeep}
\input{6DL/DNN1FEM-1D}
\input{6DL/DNN1FEM-2D}

497-6DL/7 Deep Neural network Functions/7.2-WhyDeep.tex


\documentclass[a4paper,10pt]{article}

\usepackage[utf8]{inputenc}
\usepackage{fontenc}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{multirow}
\usepackage{titling}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{geometry}
\geometry{verbose,a4paper, tmargin=25mm, bmargin=25mm, lmargin=25mm, rmargin=25mm}

\title{Binary Timeseries File Format Specification}
\author{Jonathan Schilling}
\date{\today}

\usepackage{attachfile2}
\attachfilesetup{color=1 0 0,
                 author={\theauthor},
                 subject={Attached File}}

\begin{document}
\maketitle

\section{Scope}\label{sec:scope}

This is the specification for a really simple binary file format for storing a regularly-spaced sequence of single-channel measurement data
in an efficiently writeable and readable format.
The basic assumption is that the time axis~$t_i$ of a series of $N$~measurements can be computed on the fly from the array indices:
\begin{equation}
  t_i = t_0 + i \cdot \Delta t \quad \mathrm{for} \quad i = 0, 1, ..., (N-1) \quad ,
\end{equation}
where $t_0$ is the (reference) timestamp of the first sample and $\Delta t$ is the sampling interval.

The data values $y_i$ are stored as raw values $\hat{y}_i$, optionally with an offset~$o$ and a scaling factor~$s$:
\begin{gather}
\begin{aligned}
  y_i & = &             \hat{y}_i & \quad \mathrm{for} \quad i = 0, 1, ..., (N-1) & \mathrm{without~scaling,} \\
  y_i & = & o + s \cdot \hat{y}_i & \quad \mathrm{for} \quad i = 0, 1, ..., (N-1) & \mathrm{with~scaling.}
\end{aligned}
\end{gather}
The number of samples is limited by the maximum value of the (signed 32-bit) \texttt{int} type, which is
\begin{equation}
  2^{31} - 1 = 2\,147\,483\,647 \approx 2.1 \cdot 10^9 \quad .
\end{equation}
In case of raw \texttt{double} values, the corresponding maximum file size is $(64 + 8 \cdot 2\,147\,483\,647)\,\mathrm{bytes} \approx 16\,\mathrm{GB}$,
where 64~bytes are reserved for the file header information.

Suppose an ADC samples at a given frequency $f$. Then, the sampling interval $\Delta t = f^{-1}$.
Using this time series file format, a maximum of $2^{31}-1$ samples can be stored, which then corresponds to a
total duration $T_\mathrm{max}$ of
\begin{equation}
  T_\mathrm{max} = (2^{31}-1) \cdot \Delta t \quad .
\end{equation}
For a $f = 1\,\mathrm{Mhz}$ sampling rate, $\Delta t = 1\,\mu\mathrm{s}$ and $T_\mathrm{max} \approx 2147\,\mathrm{s}$.

The recommended file name extension for Binary Timeseries files is \texttt{*.bts}.

\section{Definitions}\label{sec:definitions}
In Tab.~\ref{tab:data types} you find an overview of the types for raw data considered in this specification.
\begin{table}[htbp]
 \centering
 \begin{tabular}{|c|c|c|c|c|c|}
    \hline
    type            & size in bytes & identifier value & ok for time & ok for scaling & ok for data \\
    \hline
    \textit{None}   & 0             & 0                & no          & yes            & no          \\
    \hline
    \texttt{byte}   & 1             & 1                & no          & yes            & yes         \\
    \hline
    \texttt{short}  & 2             & 2                & no          & yes            & yes         \\
    \hline
    \texttt{int}    & 4             & 3                & no          & yes            & yes         \\
    \hline
    \texttt{long}   & 8             & 4                & yes         & yes            & yes         \\
    \hline
    \texttt{float}  & 4             & 5                & no          & yes            & yes         \\
    \hline
    \texttt{double} & 8             & 6                & yes         & yes            & yes         \\
    \hline
 \end{tabular}
 \caption{Data types considered relevant for time series data.}
 \label{tab:data types}
\end{table}

The first column lists the Java-style name of the given types.
In the second column, the size of the corresponding type in bytes is listed.
The third column lists the numeric value of the \texttt{dtype} bytes identifying the type of data in the file (see below).
The last three columns tell you if a given type can be used to specify the time axis (ok for time),
the scaling of the raw data (ok for scaling) and the raw data values (ok for data).

Throughout this document, the data types refer to the signed version of these. Unsigned versions of the data types are not
considered here, as they are not available in certain programming languages (e.g. Java).

\section{File Structure}\label{sec:file_structure}
The contents of the files are structured as shown in Tab.~\ref{tab:structure}.
\begin{table}[htbp]
 \centering
 \begin{tabular}{|c|c|c|c|c|}
    \hline
    offset & size             & type                             & allowed values    & description \\
    \hline
    0      & 2                & \texttt{short}                   & 1                 & used to verify correct endianess  \\
    \hline
    2      & 1                & \texttt{byte}                    & 4 or 6            & data type of time: 4 (long) or 6 (double) \\
    \hline
    3      & 8                & \texttt{long} or \texttt{double} & \textit{any}      & $t_0$: reference timestamp \\
    \hline
    11     & 8                & \texttt{long} or \texttt{double} & \textit{any}      & $\Delta t$: time interval between two samples \\
    \hline
    19     & 1                & \texttt{byte}                    & 0 ... 6           & data type of scaling for data values; \\
     ~     & ~                &      ~                           &                   & 0 (\textit{None}) indicates that scaling is disabled  \\
    \hline
    [20]   & 8                & \textit{varying}                 & \textit{any}      & offset $o$ of data values \\
    \hline
    [28]   & 8                & \textit{varying}                 & \textit{any}      & scaling factor $s$ for data values \\
    \hline
    36     & 23               & \textit{reserved}                & \textit{reserved} & reserved for future use, e.g. units \\
    \hline
    59     & 1                & \texttt{byte}                    & 1 ... 6           & dtype of raw data: 1 (byte) to 6 (double) \\
    \hline
    60     & 4                & \texttt{int}                     & $> 0$             & number $N$ of data values \\
    \hline
    64     & \textit{varying} & \textit{varying}                 & \textit{any}      & data values $\hat{y}_i$ of type given by dtype \\
    \hline
 \end{tabular}
 \caption{Structure of the binary timeseries files.
 The values in the columns ``offset'' and ``size'' are in bytes.
 The rows where the offset is in [ ] are not valid and should contains zeros in the file if no scaling for the data values is used.}
 \label{tab:structure}
\end{table}

The first field at offset 0 in the file is a \texttt{short}, which is always 1.
It should be read using a \texttt{readShort()} or similar function, which implicitly assumes the system's endianess.
Then it should be checked if the returned value is $1$ or $256$.
In the latter case, the endianess of the reading method is wrong and needs to be flipped in order to proceed.

The next field at offset 2 defines the data type of the time axis definition values $t_0$ and $\Delta t$.
If it is equal to 3, the time definition is given as \texttt{long}.
If it is equal to 5, the time definition is given as \texttt{double}.
No assumption should be made on the unit of these values, although it is recommended to reserve \texttt{double} for seconds and
\texttt{long} for nanoseconds.

The next field at offset 3 defines the reference timestamp $t_0$ and has to be read as a \texttt{long} or \texttt{double},
depending on the value read at offset 2.
The next field at offset 11 defines the sampling interval $\Delta t$ and has to be read as a \texttt{long} or \texttt{double},
depending on the value read at offset 2.
The time axis definition values $t_0$ and $\Delta t$ always have to be of the same data type and should use the same unit.

The field at offset 19 defines the data type of the scaling parameters $o$ and $s$ to come.
If its value is zero, no scaling is used and the next sixteen bytes can be ignored.

At offset 20, the constant offset $o$ of the raw data is stored. Its size can range from one byte to at most eight bytes
and it is always stored from offset 20 on; the remaining (unused) bytes in case of a type smaller than 8 bytes are ignored and should be written as zeros.
Right after the data offset value, at an offset of 28, the scaling factor $s$ is stored.
Its size can range from one byte to at most eight bytes
and it is always stored from offset 28 on; the remaining (unused) bytes in case of a type smaller than 8 bytes are ignored and should be written as zeros.
The scaling parameters $o$ and $s$ always have to be of the same data type and should use the same unit.

The bytes at offsets 36 to 58 are reserved for future use.

The next field at offset 59 defines the data type of the raw data.
Right after the raw data type, at an offset of 60, the number of data values $N$ to come is stored.
From offset 64 on, the raw data values $\hat{y}_i$ are stored, which have to be read as the data type defined by the value at offset 59.

\section{Subset Reading}\label{sec:subset_reading}
The main goal of this file format is to allow easy and fast reading of subsets of the whole time series data.
Having an equally spaced time axis allows to compute the data indices inside a given time interval and using the definitions in Sec.~\ref{sec:file_structure},
the offsets in the file can be computed for seeking to the computed position in the file and reading only from there on.

Suppose you have read $t_0$ and $\Delta t$ from the binary timeseries file header and now want to read all available samples
inside the interval $[t_l, t_u]$ where $t_l < t_u$ and the subscript $l$ ($u$) stand for \textit{lower} (\textit{upper}).
This situation is illustrated in Fig.~\ref{fig:timeAxis}
(\textattachfile[description={SVG version of Fig.~\ref{fig:timeAxis}}]{timeAxis.svg}{SVG},~\textattachfile[
                 description={EPS version of Fig.~\ref{fig:timeAxis}}]{timeAxis.eps}{EPS}).
\begin{figure}[htbp]
  \centering
  \includegraphics[width=0.6\textwidth]{timeAxis.eps}
  \caption{Time axis of a time series, where all data between $t_l$ and $t_u$ should be read.
  The resulting interval to be read includes indices from $i$ to $j$ and is indicated by the grey rectangle.}
  \label{fig:timeAxis}
\end{figure}

It is evident that the timestamps $t_l$ and $t_u$ are not necessarily aligned with the time axis of the available data.
Therefore, rounding has to be used to compute the indices of data:
\begin{itemize}
  \item \texttt{double} timestamps: $t_0, \Delta t \in \mathbb{R}_\mathrm{64\,bit}$
  \begin{gather}
   \begin{align}
    i & = \left\lceil  \frac{t_l - t_0}{\Delta t} \right\rceil  \in \mathbb{N} \\
    j & = \left\lfloor \frac{t_u - t_0}{\Delta t} \right\rfloor \in \mathbb{N}
   \end{align}
  \end{gather}
  \item \texttt{long} timestamps: $t_0, \Delta t \in \mathbb{Z}_\mathrm{64\,bit}$
  \begin{gather}
   \begin{align}
    i & = \frac{t_l - t_0 + \Delta t - 1}{\Delta t} \in \mathbb{N} \\
    j & = \qquad \frac{t_u - t_0}{\Delta t} \qquad  \in \mathbb{N}
   \end{align}
  \end{gather}
\end{itemize}
In case of the \texttt{long} timestamps, implicit computation of the floor of the division result is assumed.
Using these formulas, the relevant part of the file to be read starts at index $i$ and ends at index $j$.
Note that these formulas are only valid if $t_0 < t_l < t_u < t_{N-1}$ holds.

\section{Finalizing Remarks}
Implementations of this file format in Java and Python are available on GitHub:
\begin{center}
\href{https://github.com/jonathanschilling/BinaryTimeseries}{https://github.com/jonathanschilling/BinaryTimeseries}
\end{center}
The Java version is also available on Maven~Central:
\begin{verbatim}
<dependency>
  <groupId>de.labathome</groupId>
  <artifactId>BinaryTimeseries</artifactId>
  <version>1.0.4</version>
</dependency>
\end{verbatim}
The Python version is also available on \texttt{PyPI}:
\begin{verbatim}
pip install BinaryTimeseries
\end{verbatim}
In case of questions or bug reports, please open an issue on GitHub:
\begin{center}
\href{https://github.com/jonathanschilling/BinaryTimeseries/issues}{https://github.com/jonathanschilling/BinaryTimeseries/issues}
\end{center}

\end{document}


\documentclass{article}
\usepackage[margin=1in]{geometry}
\usepackage{hyperref}
\usepackage[dvipsnames]{xcolor}
\usepackage{tikz}
\usepackage{subcaption}
\usepackage{amsmath, amsfonts}

\DeclareMathOperator{\Tr}{Tr}
\DeclareMathOperator{\diag}{\mathbf{diag}}
\DeclareMathOperator*{\argmin}{arg\,min}
\DeclareMathOperator*{\argmax}{arg\,max}

\newcommand{\E}{\mathbb{E}}
\newcommand{\bs}{\boldsymbol}

\newtheorem{theorem}{Theorem}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{claim}[theorem]{Claim}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{definition}[theorem]{Definition}
\newenvironment{proof}{{\bf Proof:}}{\hfill\rule{2mm}{2mm}}

\title{On Farka's Lemma}
\author{
	Ruilin Li  \\
	\href{mailto:ruilin.li@gatech.edu}{ruilin.li@gatech.edu} \\
	Georgia Institute of Technology
	}
\date{\today}

\begin{document}

\maketitle

\section{Farka's Lemma}

\begin{lemma}
Given a vector $\bs{b} \in \mathbb{R}^m$  and $A \in \mathbb{R}^{m \times n}$, it must be one of the following two cases,
\begin{itemize}
	\item There exists a non-negative vector $\bs{x} \ge \bs{0}$ such that
		\[ A\bs{x} = \bs{b} \]
	\item There exists a vector $\bs{y}$ such that
		\[ A^T\bs{y} \le \bs{0} \mbox{ and } \bs{b}^T\bs{y} > 0 \]
\end{itemize}
See figure \ref{fig:farka} for visual illustration.
\end{lemma}

\begin{figure}[h]
\begin{subfigure}{.5\linewidth}
\centering
\begin{tikzpicture}
	\draw [fill=orange, opacity=0.2] (0,0) -- (4,4) -- (5,0);
	\draw [dotted] (0,0) -- (4,4);
	\draw [dotted] (0,0) -- (5,0);
	\draw [->, thick, purple] (0,0) -- (3,3);
	\node [right, purple] at (3,3) {$\bs{a}_1$};
	\draw [->, thick, purple] (0,0) -- (4,0);
	\node [below, purple] at (4,0) {$\bs{a}_2$};
	\draw [->, thick, cyan] (0,0) -- (3.5,2);
	\node [right, cyan] at (3.5,2) {$\bs{b}$};
\end{tikzpicture}
\caption{$A\bs{y} = \bs{b}$}\label{fig:case1}
\end{subfigure}
~
\begin{subfigure}{.5\linewidth}
\centering
\begin{tikzpicture}
	\draw [fill=orange, opacity=0.2] (0,0) -- (4,4) -- (5,0);
	\draw [dotted] (0,0) -- (4,4);
	\draw [dotted] (0,0) -- (5,0);
	\draw [->, thick, purple] (0,0) -- (3,3);
	\node [right, purple] at (3,3) {$\bs{a}_1$};
	\draw [->, thick, purple] (0,0) -- (4,0);
	\node [below, purple] at (4,0) {$\bs{a}_2$};
	\draw [->, thick, cyan] (0,0) -- (1,3);
	\node [above, cyan] at (1,3) {$\bs{b}$};
	\draw [dotted] (1,3) -- (2,2);
	\draw [->, thick, cyan] (0,0) -- (2,2);
	\node [below right, cyan] at (2,2) {$\bs{b}^\star$};
\end{tikzpicture}
\caption{$A^T\bs{y} \le \bs{0} \mbox{ and } \bs{b}^T\bs{y} > 0$}\label{fig:case2}
\end{subfigure}
\caption{Visualization of Farka's Alternatives}\label{fig:farka}
\end{figure}

\begin{proof}
Denote the cone of column vectors of $A$ by $C(A)$, i.e.
	\[ C(A) = \{ \sum_{i=1}^m x_i \bs{a}_i| x_i \ge 0, i=1,2,\cdots, m\}\]
\begin{itemize}
	\item If $\bs{b} \in C(A)$, then there exists $\bs{x} \ge \bs{0}$ such that $\bs{b} = A\bs{x}$. Suppose there is a vector $\bs{y} \ge \bs{0}$ such that
	\[ A^T\bs{y} \le \bs{0} \mbox{ and } \bs{b}^T \bs{y} > 0 \]
	then we would have
	\[ 0 < \bs{y}^T\bs{b} = \bs{y}^T A\bs{x}=(A^T \bs{y})^T\bs{x} \le 0 \]
	Contradiction. Therefore there does not exist $\bs{y} \ge \bs{0}$ such that
	\[ A^T\bs{y} \le \bs{0} \mbox{ and } \bs{b}^T \bs{y} > 0\]
	\item If $\bs{b} \notin C(A)$. Consider vector $\bs{y} = \bs{b} - \bs{b}^\star$ where $\displaystyle \bs{b}^\star = \argmin_{\bs{x} \in C(A)} ||\bs{x} - \bs{b}||^2$ is the projection of $\bs{b}$ onto $C(A$).

	From the property of projection onto convex sets (POC), we have that for any vector $\bs{z} \in C(A)$,
	\[  \langle \bs{z} - \bs{b}^\star, \bs{b} - \bs{b}^\star \rangle \le 0, \quad \langle \bs{b} - \bs{b}^\star, \bs{b} - \bs{z}\rangle \ge 0\]
	and the second equality holds if and only if $\bs{b} =\bs{b}^\star$. By our assumption $\bs{b} \notin C(A)$, so $\bs{b} \neq \bs{b}^\star$, hence $\langle \bs{b} - \bs{b}^\star, \bs{b} - \bs{z}\rangle > 0$. Let $\bs{z} =\bs{0}$, we immediate conclude that $\bs{b}^T\bs{y} > 0$.

	Next we need to show $\langle \bs{z}, \bs{b} - \bs{b}^\star \rangle \le 0$ and it suffices to show $\langle \bs{b}^\star, \bs{b} - \bs{b}^\star\rangle =0$. This is due to the fact
	\[ f(\alpha) = ||\alpha \bs{b}^\star - \bs{b}||^2 \]
	is minimized when $\alpha = 1$ and
	\[f^\prime(1) = \langle \bs{b}^\star-\bs{b}, \bs{b}^\star \rangle = 0\]

	Therefore, we find a vector $\bs{y}$ such that $A^T\bs{y} \le \bs{0}$ and $\bs{y}^T\bs{b} > 0$.
\end{itemize}
\end{proof}

\section{A Variant of Farka's Lemma}
\begin{lemma}
Given a vector $\bs{b} \in \mathbb{R}^m$  and $A \in \mathbb{R}^{m \times n}$, one and only one of the following two cases holds,
\begin{itemize}
	\item There exists a non-negative vector $\bs{x} \ge \bs{0}$ such that
		\[ A\bs{x} \le \bs{b} \]
	\item There exists a non-negative vector $\bs{y} \ge \bs{0}$ such that
		\[ A^T\bs{y} \ge \bs{0} \mbox{ and } \bs{b}^T\bs{y} < 0 \]
\end{itemize}
\end{lemma}

\begin{proof}
We apply Farka's lemma to vector $\bs{b}$ and matrix $\begin{bmatrix} A & I\end{bmatrix}$, then
\begin{itemize}
	\item Either there exists $\bs{x} \in \mathbb{R}^n$ and $\bs{s} \in \mathbb{R}^m$, such that $\bs{x} \ge \bs{0}, \bs{s} \ge \bs{0}$ and
	\[ \begin{bmatrix} A & I\end{bmatrix} \begin{bmatrix} \bs{x} \\ \bs{s}\end{bmatrix} = \bs{b} \]
	in which case we have $A\bs{x} \le \bs{b}$.
	\item Or there exists a vector $\bs{z}$ such that $\begin{bmatrix} A^T \\ I\end{bmatrix} \bs{z} \le \bs{0}$ and $\bs{b}^T\bs{z} > 0$. Let $\bs{y} = -\bs{z}$, we have $\begin{bmatrix} A^T \\ I\end{bmatrix} \bs{y} \ge \bs{0}$ and $\bs{b}^T\bs{y} < 0$.
\end{itemize}
\end{proof}

\section{Prove Strong Duality of LP via Farka's Lemma}

\end{document}