\documentclass[a4paper,12pt]{article}
%\documentclass[a4paper,12pt]{scrartcl}

\usepackage{xltxtra}

\input{../preamble.tex}

% \usepackage[spanish]{babel}

% \setromanfont[Mapping=tex-text]{Linux Libertine O}
% \setsansfont[Mapping=tex-text]{DejaVu Sans}
% \setmonofont[Mapping=tex-text]{DejaVu Sans Mono}

\title{Homework \#12}
\author{Isaac Ayala Lozano}
\date{\today}

\begin{document}
\maketitle

\begin{enumerate}
 \item Propose a random process (Figure \ref{fig: samples}) and prove that it is ergodic.

 Let $y(\zeta, t) = \sum_{n=1}^N a_n \cos (\omega_n t + \Psi(\zeta))$ be the proposed random process, where

 \begin{itemize}
  \item $a_n$ is the amplitude of each cosine function.
  \item $\omega_n$ is the frequency corresponding to each $n$.
  \item $\Psi(\zeta) \in R $ is the random noise added to the process.
 \end{itemize}

 \begin{figure}[htb!]
\centering
\import{./img/}{hw12_samples.tex}
\caption{Random functions from the ensemble.}
\label{fig: samples}
\end{figure}

 We prove that the process is ergodic by verifying that for the ensemble of sample functions $y_k$, the mean value $\mu_y (k)$ and the autocorrelation function $R_{yy}(\tau, k)$ do not differ over different sample functions \cite{bendat2011random}.

 The mean value of the sample function is obtained as follows

 \begin{align*}
  \mu_y(k) &= \lim _{T \rightarrow \infty} \frac{1}{T} \int_0^T y_k (t) dt \\
  &= \lim _{T \rightarrow \infty} \frac{1}{T} \int_0^T \sum_{n=1}^N a_n \cos(\omega_n t + \Psi (\zeta)) dt\\
  &= \lim _{T \rightarrow \infty} \frac{1}{T}  \sum_{n=1}^N \int_0^T a_n \cos(\omega_n t + \Psi (\zeta)) dt\\
  &= \lim _{T \rightarrow \infty} \frac{1}{T}  \sum_{n=1}^N \left. \frac{a_n}{\omega_n} \sin(\omega_n t + \Psi (\zeta))  \right\rvert_{0}^{T} \\
  &= 0
 \end{align*}

 Given that $N < \infty$, the sum of all terms will also be number less than infinity.
 Thus, as $T$ tends towards infinity the mean value of the random process approaches zero.
 This holds true for all values of $\Psi(\zeta)$.

\begin{figure}[htb!]
\centering
\import{./img/}{hw12_ergodic.tex}
\caption{Mean vlaue for different amount of samples.}
\label{fig: ergodic}
\end{figure}

 For the autocorrelation function, a similar process is followed.

 \begin{align*}
  R_{yy} (\tau, k) & = \lim _{T \rightarrow \infty} \frac{1}{T} \int_0^T y_k (t) y_k (t + \tau) dt\\
  &= \lim _{T \rightarrow \infty} \frac{1}{T} \int_0^T \sum_{n=1}^N a_n \cos(\omega_n t + \Psi (\zeta))
  \sum_{n=1}^N a_n \cos(\omega_n (t+ \tau) + \Psi (\zeta))
  dt
 \end{align*}

We present a simplified version of the proof when $N$ is equal to one, though the proof holds for all values of $N$.
We begin by applying the trigonometric identity of $\cos(u\pm v) = \cos(u)\cos(v) \mp \sin(u) \sin(v)$ , such that $u = \omega_n t + \Psi(\zeta)$ and $v = \omega_n \tau$.

 \begin{align*}
  R_{yy} (\tau, k) &= \lim _{T \rightarrow \infty} \frac{1}{T} \int_0^T  (a \cos(u))(a\cos(u)\cos(v) - a\sin(u)\sin(v)) dt\\
  &= \lim _{T \rightarrow \infty} \frac{1}{T} \int_0^T  (a^2 (\cos (u))^2 \cos(v) - a^2 \cos(u)\sin(u)\sin(v)) dt\\
  &= \lim _{T \rightarrow \infty} \frac{a^2}{T} ( \cos(v)\int_0^T (\cos(u))^2 dt -  \sin(v) \int_0^T \cos(u) \sin(u) dt )
 \end{align*}

 Evaluating each integral yields the following results.

 \begin{align*}
\int_0^T (\cos(u))^2 dt &= \int_0^T (\cos(\omega t + \Psi(\zeta)))^2 dt \\
&= \left. \frac{2 (\omega t + \Psi(\zeta)) + \sin (2(\omega t + \Psi(\zeta)))}{4 \omega}  \right\rvert_{0}^{T}\\
&= \frac{T}{2} + \frac{\sin(2(\omega T + \Psi(\zeta)))}{4\omega} - \frac{\sin(2\Psi(\zeta))}{4\omega} \\
%
\int_0^T \cos(u) \sin(u) dt &= \int_0^T \cos(\omega t + \Psi(\zeta)) \sin(\omega t + \Psi(\zeta)) dt\\
&= \left .  - \frac{\cos (2 (\omega t + \Psi(\zeta)))}{4 \omega} \right\rvert_{0}^{T}\\
&= \frac{\cos(2\Psi (\zeta))}{4\omega} - \frac{\cos (2 (\omega T + \Psi(\zeta)))}{4 \omega}
 \end{align*}

Substituting these results into the original equation and evaluating the limit yields

\begin{equation*}
 R_{yy} (\tau, k) =  \frac{a^2}{2} \cos(\omega \tau)
\end{equation*}

This is due to the fact that every other term for the integrals lacks a $T$ in the numerator of their fractions.
Given the absence of it, as $T$ approaches infinity the value of all the other terms will approach zero.

This result can be generalized for any value of N.
From the original equation we notice that the equation was a sum of integrals, hence for values of different from one it is only necessary to add the results of those other integrals.

\begin{equation*}
 R_{yy} (\tau, k) =  \sum_{n=1}^N \frac{a_n^2}{2} \cos(\omega_n \tau)
\end{equation*}

Observe that the autocorrelation function is not dependent on time, but on the lag between measurements.
It does not vary accross sample functions because they all present the same behaviour described in the random process' equation.

Given that both $\mu_y (k)$ and $R_{yy}(k)$ do not vary between sample functions, as has been proven, the proposed random process is indeed ergodic.

\item Present plots of the probability density functions for a sine wave, a sine wave plus random noise, and a sample of white\footnote{Also called Gaussian} noise.

\item Present the autocorrelation plots for the three previous functions.

\begin{figure}[htb!]
\centering
\import{./img/}{hw12_sin.tex}
\caption{Sine function.}
\label{fig: sin}
\end{figure}

\newpage
\pagebreak

\begin{figure}[htb!]
\centering
\import{./img/}{hw12_noise.tex}
\caption{Sine function with noise.}
\label{fig: noise}
\end{figure}

\newpage
\pagebreak

\begin{figure}[htb!]
\centering
\import{./img/}{hw12_white.tex}
\caption{White noise.}
\label{fig: white}
\end{figure}

\end{enumerate}

\printbibliography

\newpage
\pagebreak
\appendix
\section{Octave Code}
\lstinputlisting[language=Matlab]{hw08_plots.m}

% https://ocw.mit.edu/courses/mechanical-engineering/2-22-design-principles-for-ocean-vehicles-13-42-spring-2005/readings/r6_spectrarandom.pdf
\end{document}


\chapter{B\'{e}zier $\bar{B}$ projection}
\label{chp:chapter6}
\graphicspath{{figures/}{figures/chapter6/}}
\pgfplotsset{
    table/search path={{figures/chapter6/data},{data}},
}

In this chapter, we demonstrate how dual basis functions can be employed as the underlying local projection framework for a $\bar{B}$ approach to treat locking in isogeometric structural elements.

Numerical locking in structural finite elements includes geometric locking in thin curved structural members such as membrane and shear locking and also includes volumetric locking in incompressible and nearly incompressible elasticity. There is an immense body of literature on approaches to overcome locking in the finite element community and various approaches have emerged as dominant. These include reduced quadrature~\cite{malkus_mixed_1978,zienkiewicz_reduced_1971}, $\bar{B}$ projection methods~\cite{nagtegaal_numerically_1974,hughes_generalization_1980, NME:NME4328}, and mixed methods based on the Hu-Washizu variational principle~\cite{dolbow_volumetric_1999,kasper_mixed-enhanced_2000,hughes_variational_1986, NME:NME3048}. It is important to mention that, although ameliorated at high polynomial degrees, smooth splines in the context of IGA still exhibit locking behavior~\cite{echter_numerical_2010, bouclier_locking_2012}.

In IGA, there is a growing literature on the treatment of locking in structural elements. Leveraging higher-order smoothness, transverse shear locking can be eliminated at the theoretical level by employing Kirchhoff-Love~\cite{kiendl2009isogeometric, kiendl2015isogeometric} and hierarchic Reissner-Mindlin~\cite{oesterle_hierarchic_2017, oesterle_shear_2016,echter_hierarchic_2013} shell elements. Reduced quadrature schemes have been explored in~\cite{adam_improved_2014, adam_improved_2015, adam_selective_2015} as a way to alleviate transverse shear locking. The extension of $\bar{B}$ projection to the isogeometric setting was initiated in~\cite{elguedj:hal-00457010} for both elastic and plastic problems and was extended in~\cite{bouclier_efficient_2013} to include local projection techniques~\cite{mitchell_method_2011,govindjee_convergence_2012}.

We introduce two methods that employ \Bezier dual basis to produce a localized approximation to the standard $\bar{B}$ method. The motivation behind these methods is the fact that $\bar{B}$ methods result in dense linear systems. The methods we introduce result in a sparse linear system irrespective of the choice of basis functions. We call these two methods the symmetric and non-symmetric \Bezier $\bar{B}$ projection methods, where the names indicate the symmetry of the resulting stiffness matrix. We show that both methods result in a sparse stiffness matrix and reduce locking. We also show that optimal convergence rates are achieved in the case of the non-symmetric method and near optimal convergence rates are achieved in the case of the symmetric method.  We also perform an inf-sup analysis of these methods.

\section{Geometric locking: Timoshenko beams}
\label{sec:timoshenkobeam}
To illustrate the use of \Bezier $\bar{B}$ projection to overcome geometric locking effects we study transverse shear locking in Timoshenko beams. The Timoshenko beam problem provides a simple one dimensional setting in which to describe B\'ezier $\bar{B}$ projection. Note however, that the approach can be directly generalized to more complex settings like spatial beams and shells and other geometric locking mechanisms like membrane locking. We consider a planar cantilevered Timoshenko beam as shown in Figure~\ref{fig:Timoshenko_beam_cross}. The strong form for this problem can be stated as
\begin{align}
    \begin{rcases}
        \begin{aligned}
            -s{GA}\gamma'          & =f(x)          \\
            -EI\kappa'-s{GA}\gamma & = 0            \\
            \kappa                 & = \phi'        \\
            \gamma                 & = \omega'-\phi
        \end{aligned}
    \end{rcases}
     & \text{ in $\Omega$} \\
    \begin{rcases}
        \begin{aligned}
            \omega & =0 \\
            \phi   & =0
        \end{aligned}
    \end{rcases}
     & \text{ at $x=0$}    \\
    \begin{rcases}
        \begin{aligned}
            s{AG}\gamma & = Q \\
            -EI\kappa   & = M
        \end{aligned}
    \end{rcases}
     & \text{ at $x=L$}
\end{align}
where $\gamma$ is the shear strain, $\kappa$ is the bending strain, $\omega$ is the vertical displacement, $\phi$ is the angle of rotation of the normal to the mid-plane of the beam, $f$ is the distributed transverse load, $Q$ is a point load, $M$ is the moment, $E$ is the Young's modulus, $G$ is the shear modulus, $A$ is the cross-sectional area, $I$ is the second moment of inertia of the beam cross-section, $s$ is the shear correction factor, normally set to $5/6$ for rectangular cross-sections, and $\Omega = (0,L)$. When $\omega$ and $\phi$ are interpolated by basis functions of the same order the finite element solution to this problem exhibits shear locking as the beam becomes slender.

\begin{figure}[ht]
    \centering
    \includegraphics[width=0.25\linewidth]{timoshenko_beam_shape}
    \caption{Deformation of a Timoshenko beam. The normal rotates by the angle $\phi$, which is not equal to $w'$, due to shear deformation.}
    \label{fig:Timoshenko_beam_cross}
\end{figure}

\subsection{Symmetric \Bezier $\bar{B}$ projection}
\label{sec:symmetric-projection}
Locking is caused in Timoshenko beam problems when equal order interpolation is used for both midline displacements and rotations. To reduce the effects of locking for these problems the $\bar{B}$ method projects the shear strain, $\gamma$, onto a lower order function space. This process produces a projected shear strain, which we call $\bar{\gamma}$,  that is substituted into the weak form of the problem statement. In this section we use the \Bezier projection operator to compute an approximation of $\bar{\gamma}$, and refer to this approach as the symmetric \Bezier $\bar{B}$ projection method because the resulting stiffness matrix is symmetric.

\subsubsection{The weak form}

\sloppy Given the function spaces $\mathcal{S}(\Omega)=\{{\mathbf{u} \, \vert \, {\mathbf{u}\in{H^1(\Omega)\times{H^1(\Omega)}}},\mathbf{u}\vert_{\Gamma_{g}}=\mathbf{g}}\}$ and $\mathcal{V}(\Omega)=\{{\mathbf{w} \, \vert \, {\mathbf{w}\in{H^1(\Omega)\times{H^1(\Omega)}}}, \allowbreak \mathbf{w}\vert_{\Gamma_{g}}=\mathbf{0}}\}$ where $\mathbf{u}=\left\{{\omega,\phi}\right\}^T$, $\mathbf{w}=\left\{{\delta\omega,\delta\phi}\right\}^T$, $\mathbf{g}$ is the prescribed Dirichlet boundary condition, and $\Gamma_g$ is the Dirichlet boundary at $x=0$, the weak form of the problem can be stated as: find $\mathbf{u}\in{\mathcal{S}(\Omega)}$ such that for all $\mathbf{w}\in{\mathcal{V}(\Omega)}$
\begin{equation}
    {\int_{0}^L\kappa(\mathbf{w})EI\kappa(\mathbf{u}) + \bar{\gamma}(\mathbf{w})sGA\bar{\gamma}(\mathbf{u})} \, dx=\int_0^L\delta\omega f dx+\delta\omega(L)Q+\delta\phi(L)M.
\end{equation}

\subsubsection{Discretization}
We discretize $\omega$ and $\phi$ as
\begin{align}
    {\omega = \sum_A \omega_A N_A} \\
    {\phi = \sum_A \phi N_A}
\end{align}
where $N_A$ is a degree $p$ spline basis function and $\omega_A$ and $\phi_A$ are the corresponding control point values. The shear strain and bending strain can then be expressed as
\begin{align}
    \gamma & = \sum_A{\begin{bmatrix}N'_A & -N_A\end{bmatrix}\begin{bmatrix}\omega_A & \phi_A\end{bmatrix}^T} \\
    \kappa & = \sum_A\begin{bmatrix}0 & N'_A\end{bmatrix}\begin{bmatrix}\omega_A & \phi_A\end{bmatrix}^T
\end{align}
The shear strain $\bar{\gamma}$ is constructed by B\'{e}zier projection of the true shear strain $\gamma$ onto a lower degree space. In other words, we project from a $p^{th}$ degree spline space with $n$ basis functions $\mathbf{N}$ defined by the knot vector
\begin{align}
    \mathbf{\Xi}_{p}=\lbrace{\underbrace{0,0,\ldots,0}_\text{$p+1$ copies}},\mathbf{\Xi}_{int},{\underbrace{1,1,\ldots,1}_\text{$p+1$ copies}}\rbrace,
    \label{eq:origin_knot_vector}
\end{align}
onto a $p-1^{th}$ degree spline space with $\bar{n}$ basis functions $\bar{\mathbf{N}}$ defined by the knot vector
\begin{equation}
    \bar{\mathbf{\Xi}}_{p-1}=\lbrace{\underbrace{0,0,\ldots,0}_\text{$p$ copies}},\mathbf{\Xi}_{int},{\underbrace{1,1,\ldots,1}_\text{$p$ copies}}\rbrace
    \label{eq:projected_knot_vector}
\end{equation}
where the internal knots, denoted by $\mathbf{\Xi}_{int}$, are the same for both spaces. The projected shear strain $\bar{\gamma}$ can then be written as
\begin{align}
    \bar{\gamma} & = \sum_A \bar{\gamma}_A \bar{N}_A.
\end{align}
The control variables $\bar{\gamma}_A$ are simply
\begin{align}
    \bar{\gamma}_A = \int_{\Omega^A} \hat{\bar{N}}_A \gamma \, d\Omega = \langle \hat{\bar{N}}_A, \gamma \rangle_{\Omega^i}
\end{align}
where $\hat{\bar{N}}_A$ is a dual basis function for the spline space of degree $p-1$ computed from \eqref{eq:bezier-dual-basis}.

Localizing to the B\'{e}zier element we define the strain-displacement arrays in terms of element Bernstein basis functions of degree $p$ and $p-1$ as
\begin{align}
    \mathbf{B}_e^\kappa
     & = \begin{bmatrix} 0 & -{B^e_{0,p}}' & \cdots & 0 & -{B^e_{p,p}}' \end{bmatrix}, \\
    \mathbf{B}_e^\gamma
     & = \begin{bmatrix} {B^e_{0,p}}' & -B^e_{0,p} & \cdots & {B^e_{p,p}}' & -B^e_{p,p} \end{bmatrix}, \\
    \bar{\mathbf{B}}_e
     & = \begin{bmatrix} \bar{B}^e_{0,p-1} & \cdots & \bar{B}^e_{p-1,p-1} \end{bmatrix},
\end{align}
{where $B^e_{i,p}$ is the $i^{th}$ Bernstein basis function of order $p$}. We can then compute the element arrays as
\begin{align}
    \mathbf{K}_e^b       & = EI\mathbf{C}^e\langle{{\mathbf{B}_e^\kappa}^T,\mathbf{B}_e^\kappa}\rangle(\mathbf{C}^e)^T, \label{eq:symmetric_timoshenko} \\
    \bar{\mathbf{M}}_e   & = s{GA}\bar{\mathbf{C}}^e\langle{\bar{\mathbf{B}}_e^T,\bar{\mathbf{B}}_e}\rangle(\bar{\mathbf{C}}^e)^T,                      \\
    {\hat{\mathbf{P}}_e} & = \langle{(\hat{\bar{\mathbf{N}}}^e)^T,\mathbf{B}^\gamma_e}\rangle(\mathbf{C}^e)^T \label{eq:P-hat-elem},
\end{align}
where $\mathbf{C}^e$ is the element extraction operator for the degree $p$ spline space, $\bar{\mathbf{C}}^e$ is the element extraction operator for the degree $p-1$ spline space, and $\hat{\bar{\mathbf{N}}}^e$ are the dual basis functions restricted to the element for the degree $p-1$ spline space. The global stiffness matrix can then be written as
\begin{align}
    \mathbf{K} = \mathbf{K}^b + \bar{\mathbf{K}}^s_S \label{eqn:symmetric_b_bar_timoshenko_stiffness}
\end{align}
where
\begin{align}
    \mathbf{K}^b       & =\A_e\mathbf{K}_e^b,\label{eqn:bending_stiffness}                                  \\
    \bar{\mathbf{K}}^s & ={\hat{\mathbf{P}}}^T\bar{\mathbf{M}}{\hat{\mathbf{P}}}\label{eqn:shear_stiffness} \\
    {\hat{\mathbf{P}}} & =\A_e{\hat{\mathbf{P}}_e} \label{eq:P-hat-global}                                  \\
    \bar{\mathbf{M}}   & =\A_e\bar{\mathbf{M}}_e
\end{align}
and $\A$ is the standard finite element assembly operator \cite{Hug00}. We note that the assembly of $\bar{\mathbf{K}}^s$ requires the assembly of two intermediate matrices, $\bar{\mathbf{M}}$ and ${\hat{\mathbf{P}}}$. The computation of these matrices is needed because the product of two integrals over the entire domain can not be localized to the element level.

\subsection{Non-symmetric \Bezier $\bar{B}$ projection}
\label{sec:non-symmetric}

{Simo and Hughes \cite{Hug00} have shown that $\bar{B}$ formulations and mixed formulations are equivalent. However, the development of the symmetric \Bezier $\bar{B}$ projection method presented in Section~\ref{sec:symmetric-projection}, where we began by interpreting the $\bar{B}$ formulation as a strain projection method, lacks a connection to mixed formulations. In this section, we present a second method based on \Bezier projection in which we view the $\bar{B}$ formulation as a mixed formulation where, for the Timoshenko beam problem, the auxiliary variable is the shear stress. We use the \Bezier dual basis functions as the test functions for the auxiliary variable. Once the problem has been cast as a mixed formulation we then eliminate the auxiliary variable to get a purely displacement based formulation. This approach preserves convergence rates and all assembly routines for the stiffness matrix can be performed at the element level. However, it does not produce a symmetric stiffness matrix.}

\subsubsection{The weak form}
{In the mixed formulation for the Timoshencko beam problem the shear stress, $\tau=sGA\gamma$, is taken as a new independent variable. The weak form of the mixed formulation can then be stated as: find $\mathbf{u}\in{\mathcal{S}(\Omega)}$ and $\tau\in{L}^2(\Omega)$ such that for all $\mathbf{w}\in{\mathcal{V}(\Omega)}$ and $\delta\tau\in{L}^2(\Omega)$}
\begin{align}
    \int_{0}^L\kappa(\mathbf{w})EI\kappa(\mathbf{u}) + {\gamma}(\mathbf{w})\tau \, dx & = l\langle{\mathbf{w}}\rangle \\
    \int_{0}^L\delta\tau(sGA\gamma(\mathbf{u})-\tau) \, dx                            & = 0.
\end{align}
\subsubsection{Discretization}
{In the finite element formulation of the mixed problem, the discretization of $\mathbf{u}$ and $\mathbf{w}$ remain the same as before. The shear strain and its variation, however, are in $L^2(\Omega)$, so their finite element approximation can consist of functions with lower regularity, such as discontinuous polynomials. When the field $\mathbf{u}$ is discretized by $p^{th}$ degree spline basis functions defined by the knot vector given in \eqref{eq:origin_knot_vector}, we use the $p-1$ degree spline basis functions, defined by the knot vector given in \eqref{eq:projected_knot_vector}, to discretize the shear stress $\tau$ and the corresponding dual basis to discretize its variation $\delta\tau$. The discrete form of the shear stress and its variation are given by}
\begin{align}
    \tau       & =\sum_A\tau_A\bar{N}_A              \\
    \delta\tau & =\sum_A\delta\tau_A\hat{\bar{N}}_A.
\end{align}
{The stiffness matrix for the mixed form can then be written as}
\begin{equation}
    \mathbf{K}_{mix} =
    \begin{bmatrix}
        \mathbf{K}^b        & \mathbf{P}^T \\
        sGA\hat{\mathbf{P}} & -\mathbf{I}
    \end{bmatrix}
    \label{eq:mixed_timoshenko}
\end{equation}
{where}
\begin{equation}
    \mathbf{P}=\A_e\mathbf{P}_e,
\end{equation}
{and}
\begin{equation}
    \mathbf{P}_e=\bar{\mathbf{C}}^e\langle{\bar{\mathbf{B}}_e^T,\mathbf{B}^\gamma_e}\rangle(\mathbf{C}^e)^T.
\end{equation}
{ and $\hat{\mathbf{P}}$ is given in \eqref{eq:P-hat-elem} and \eqref{eq:P-hat-global}.
We can now eliminate the control variable of the shear stress from \eqref{eq:mixed_timoshenko} to get a pure displacement formulation where the stiffness matrix can be written as}
\begin{equation}
    \mathbf{K}=\mathbf{K}^b+\bar{\mathbf{K}}^s_{NS},
\end{equation}
where
\begin{equation}
    \bar{\mathbf{K}}^s_{NS}=sGA\mathbf{P}^T\hat{\mathbf{P}}.
    \label{eq:nonsymmetric_timoshenko}
\end{equation}
{We can see that the use of different function spaces for the shear strain and its variation leads to a non-symmetric stiffness matrix.}

\paragraph{Remark} { As mentioned previously, the symmetric \Bezier $\bar{B}$ formulation is not consistent with a mixed formulation. To see this, we can recover the mixed formulation of \eqref{eqn:symmetric_b_bar_timoshenko_stiffness}, which is}
\begin{equation}
    \begin{bmatrix}
        \mathbf{K}^b        & \hat{\mathbf{P}}^T     \\
        sGA\hat{\mathbf{P}} & -\bar{\mathbf{M}}^{-1}
    \end{bmatrix},
\end{equation}
{where both the shear stress and its variation are discretized by the dual basis functions. However, for the inner product of dual basis functions we have}
\begin{equation}
    \langle{\hat{\bar{N}}_i,\hat{\bar{N}}_j}\rangle\neq{\bar{\mathbf{M}}^{-1}_{ij}},
\end{equation}
{which shows the inconsistency between the symmetric \Bezier $\bar{B}$ formulation and the mixed formulation.}

\subsection{Bandwidth of the stiffness matrix}
A global $\bar{B}$ method that utilizes a global $L^2$ projection results in a dense stiffness matrix. The B\'ezier $\bar{B}$ {methods}, on the other hand, {produce} sparse stiffness matrices. However, the coupling of the local dual basis functions does increase the bandwidth slightly. This is illustrated in Figure~\ref{fig:stiffness_matrix}, which shows the structure of the stiffness matrix for the Timoshenko beam problem using the second order basis functions of maximal smoothness for a displacement-based method (Figure~\ref{fig:stiffness_matrix}a), global $\bar{B}$ method (Figure~\ref{fig:stiffness_matrix}b), symmetric B\'ezier $\bar{B}$ method (Figure~\ref{fig:stiffness_matrix}c) and non-symmetric \Bezier $\bar{B}$ method (Figure~\ref{fig:stiffness_matrix}d). The blank cells indicate zero terms in the matrix while colored cells show the location of nonzero terms.
\begin{figure}[!htb]
    \centering
    \begin{subfigure}[b]{0.47\linewidth}        %% or \columnwidth
        \centering
        \includegraphics[width=\linewidth]{Global}
        \caption{Standard}
        %\label{}
    \end{subfigure}
    \begin{subfigure}[b]{0.47\linewidth}        %% or \columnwidth
        \centering
        \includegraphics[width=\linewidth]{B_extraction}
        \caption{Global $\bar{B}$}
        %\label{}
    \end{subfigure}
    \begin{subfigure}[b]{0.47\linewidth}        %% or \columnwidth
        \centering
        \includegraphics[width=\linewidth]{LB_extraction}
        \caption{Symmetric B\'ezier $\bar{B}$}
        %\label{}
    \end{subfigure}
    \begin{subfigure}[b]{0.47\linewidth}        %% or \columnwidth
        \centering
        \includegraphics[width=\linewidth]{NS-LB_extraction}
        \caption{Non-symmetric B\'ezier $\bar{B}$}
        %\label{}
    \end{subfigure}
    \caption{Illustrations of the structure of $2^{nd}$ order Timoshenko beam stiffness matrices for (a) a standard displacement method, (b) a global $\bar{B}$ method, (c) a symmetric B\'ezier $\bar{B}$ method and (d) a non-symmetric B\'ezier $\bar{B}$ method.}
    \label{fig:stiffness_matrix}
\end{figure}

The increased bandwidth of the {symmetric} B\'ezier $\bar{B}$ method when compared to a displacement-based method can be explained by looking at the product of the integrals in \eqref{eqn:shear_stiffness}. For example, if we consider the basis functions $N_{1}$ and $N_{5}$ in Figure~\ref{fig:IGAelement} we see that $\operatorname{supp}(N_{1}) \cap{} \operatorname{supp}(N_{5}) = \emptyset$, which means that the inner product of these two functions will be zero and the corresponding coefficient in the stiffness matrix will be zero in the displacement-based method. For the B\'ezier $\bar{B}$ method, however, the form of \eqref{eqn:shear_stiffness} leads to a coupling between $N_{1}$ and $N_{5}$. This can be seen by considering $\Omega_2$. Over this element, the shear stiffness can be represented as
\begin{align}
    \bar{\mathbf{K}}^s_2 = \sum_{i=1}^3 \sum_{j=1}^3 \mathbf{P}_i^T\bar{\mathbf{M}}_2\mathbf{P}_j
\end{align}
and the term of this summation that results in the coupling between $N_{1}$ and $N_{5}$ is $\mathbf{P}_1^T\bar{\mathbf{M}}_2\mathbf{P}_3$, where $\mathbf{P}_1$ is the inner product of $N_{1}$ and $\hat{\bar{N}}_{2}$, $\mathbf{P}_3$ is the inner product of $N_{5}$ and $\hat{\bar{N}}_{3}$, and $\bar{\mathbf{M}}_2$ is the inner product of $\bar{N}_{2}$ and $\bar{N}_{3}$. We can see from Figure~\ref{fig:IGAelement} that $\operatorname{supp}(N_{1})\cap{}\operatorname{supp}(\hat{\bar{N}}_{2})=\Omega_1$, $\operatorname{supp}(N_{5})\cap{}\operatorname{supp}(\hat{\bar{N}}_{3})=\Omega_3$ and $\operatorname{supp}(\bar{N}_{2})\cap{}\operatorname{supp}(\bar{N}_{3})=\Omega_2$, so that $\mathbf{P}_1^T\bar{\mathbf{M}}_2\mathbf{P}_3$ is not zero. Thus we have increased the number of nonzero coefficients in the shear stiffness matrix. However, the same exercise can be used to show that there is no coupling between $N_{0}$ and $N_{6}$ for this set of basis functions so the matrix is not dense. {the bandwidth of the non-symmetric B\'ezier $\bar{B}$ method is reduced further. This is because the Gramian matrix does not appear in the this formulation.} In fact, from the formulation of the element stiffness matrix, we can show that the bandwidth of the stiffness matrix of the symmetric B\'ezier $\bar{B}$ and non-symmetric B\'ezier $\bar{B}$ methods for the Timoshenko beam are $6p-3$ and $4p-1$, respectively.

\paragraph{Remark} In \cite{bouclier_efficient_2013} a local $\bar{B}$ method for shells was proposed that was based on the local least squares method presented in \cite{govindjee_convergence_2012}. This approach has a similar structure to the {symmetric B\'ezier $\bar{B}$} method presented here. However, it was shown in~\cite{thomas_bezier_2015} that choosing (\ref{eq:Bezier_weight}) as the weighting provides a significant increase in the accuracy of the approximation.

\begin{figure}[htb!]
    \centering
    \includegraphics[width=.7\linewidth]{basis_dual}
    \caption{Quadratic maximally smooth B-spline basis functions (top), associated linear basis functions (middle), and dual basis functions (bottom) for the B\'ezier $\bar{B}$ formulation.}
    \label{fig:IGAelement}
\end{figure}

\subsection{Numerical results}

In our study, a straight planar cantilever beam is clamped on the left end and a sinusoidal distributed load $f(x)=sin(\pi\dfrac{x}{l})$ is applied, as depicted in Figure \ref{fig:load_beam}. The analytical solution for vertical displacement $w$, rotation $\phi$, bending moment $M$, and transverse shear force $Q$ are given by
\begin{align}
    \begin{split}
        w(x)&=\frac{EI\left(6 \pi ^2 l^2 \sin \left(\frac{\pi  x}{l}\right)+6 \pi ^3 l x\right)+sGA\left(6 l^4 \sin \left(\frac{\pi  x}{l}\right)-6 \pi l^3 x+3 \pi ^3 l^2 x^2-\pi ^3 l x^3\right)}{6 \pi ^4 sEIGA}\\
        \phi(x)&=\frac{2 l^3 \cos \left(\frac{\pi  x}{l}\right)-2 l^3+2 \pi ^2 l^2 x-\pi ^2 l x^2}{2 \pi ^3 EI}\\
        M(x)&=\frac{l^2 \sin \left(\frac{\pi  x}{l}\right)-\pi  l^2+\pi  l x}{\pi ^2}\\
        Q(x)&=\frac{-l\cos \left(\frac{\pi  x}{l}\right)-l}{\pi}.
    \end{split}
    \label{eq:timoshenko_analytical}
\end{align}
\begin{figure}[h]
    \centering
    \includegraphics[width=0.4\linewidth]{beam_load}
    \caption{Straight planar cantilevered Timoshenko beam clamped at the left and loaded by a distributed load $f(x)$.}
    \label{fig:load_beam}
\end{figure}

The beam has a rectangular cross-section and we use the following non-dimensional sectional and material parameters: length $l=10$, width $b=1$, thickness $t=0.01$, Young's modulus $E=10^9$, Poisson's ratio $\nu=0.3$, and a shear correction factor of $s=5/6$. A comparison of the normalized error in the $L^2$ norm for $w$, $\phi$, $M$ and $Q$ versus the number of degrees of freedom for polynomial degrees $p=1,2,3$ is shown in Figure \ref{fig:timoshenko_result}. Results computed using standard finite elements are labeled $Q_1$, $Q_2$, and $Q_3$. Results computed using a global $\bar{B}$ method are labeled $\mathcal{T}^{L^2}$, those computed with the symmetric B\'ezier $\bar{B}$ method and the non-symmetric B\'ezier $\bar{B}$ method are labeled $S-\mathcal{T}^{P}$ and $NS-\mathcal{T}^{P}$, respectively. As expected, the $Q_1$ results lock and the error remains virtually unchanged as the mesh is refined. Increasing the polynomial degree does reduce the locking effect, although the reduction is minor for the $Q_2$ results. $\mathcal{T}^{L^2}$, $S-\mathcal{T}^{P}$ and $NS-\mathcal{T}^P$ are essentially locking free for all polynomial orders. The convergence rates for the $\bar{B}$ methods are at least $p+1$ for $w$, $p$ for $\phi$, $p-1$ for $M$, and $p-2$ for $Q$. These rates agree with those reported in \cite{kiendl_single-variable_2015} and are optimal. To reiterate, B\'{e}zier $\bar{B}$ methods produces the same convergence rates as the global $\bar{B}$ method {and the the error plots of $NS-\mathcal{T}^{P}$ for $\phi$, $M$ and $Q$ are identical to those of $\mathcal{T}^{L^2}$}.
\begin{figure}
    \centering
    \begin{subfigure}[b]{0.49\linewidth}        %% or \columnwidth
        \centering
        \includegraphics[width=\linewidth]{w-sin}
        \caption{}
        \vspace*{2mm}
    \end{subfigure}
    \begin{subfigure}[b]{0.49\linewidth}        %% or \columnwidth
        \centering
        \includegraphics[width=\linewidth]{phi-sin}
        \caption{}
        \vspace*{2mm}
    \end{subfigure}
    \begin{subfigure}[b]{0.49\linewidth}        %% or \columnwidth
        \centering
        \includegraphics[width=\linewidth]{M-sin}
        \caption{}
        \vspace*{2mm}
    \end{subfigure}
    \begin{subfigure}[b]{0.49\linewidth}        %% or \columnwidth
        \centering
        \includegraphics[width=\linewidth]{Q-sin}
        \caption{}
        \vspace*{2mm}
    \end{subfigure}
    \caption{Convergence studies for slenderness factor $l/t=10^{-3}$. Error in the $L^2$-norm for (a) displacement $w$, (b) rotation $\phi$, (c) bending moment $M$, and (d) shear force $Q$.}
    \label{fig:timoshenko_result}
\end{figure}

We have also studied the relationship between shear locking and decreasing slenderness ratios for $p=2$. The results are shown in Figure \ref{fig:slenderness}. For all three methods, the number of degrees of freedom are fixed, and the sectional and material parameters are the same as in the previous study. The slenderness ratio varies from $10$ to $5\times{10}^3$. $Q_2$ locks severely. The $\bar{B}$ methods, on the other hand, are locking free.
%Note that the jump in the error for at the largest slenderness for the $\bar{B}$ methods is due to numerical round-off errors. If the computation is performed with high precision floating point numbers this jump is not present.

\begin{figure}
    \centering
    \begin{subfigure}[b]{0.49\linewidth}        %% or \columnwidth
        \centering
        \includegraphics[width=\linewidth]{slenderness_w}
        \caption{}
        \vspace*{2mm}
    \end{subfigure}
    \begin{subfigure}[b]{0.49\linewidth}        %% or \columnwidth
        \centering
        \includegraphics[width=\linewidth]{slenderness_phi}
        \caption{}
        \vspace*{2mm}
    \end{subfigure}
    \begin{subfigure}[b]{0.49\linewidth}        %% or \columnwidth
        \centering
        \includegraphics[width=\linewidth]{slenderness_M}
        \caption{}
        \vspace*{2mm}
    \end{subfigure}
    \begin{subfigure}[b]{0.49\linewidth}        %% or \columnwidth
        \centering
        \includegraphics[width=\linewidth]{slenderness_Q}
        \caption{}
        \vspace*{2mm}
    \end{subfigure}
    \caption{Convergence study for increasing slenderness, $p=2$, and $\#{dof}=32$. Error in the $L^2$-norm for (a) displacement $w$, (b) rotation $\phi$, (c) bending moment $M$, and (d) shear force $Q$.}
    \label{fig:slenderness}
\end{figure}

\section{Volumetric locking: Nearly incompressible linear elasticity}
\label{sec:nearlyincompressible}
To demonstrate the use of \Bezier $\bar{B}$ {methods} to alleviate volumetric locking effects we study the nearly incompressible elasticity problem in two dimensions. We start with the small strain tensor $\boldsymbol{\varepsilon}$, which is defined as the symmetric part of the displacement gradient, i.e.,
\begin{equation}
    \varepsilon_{ij}=\dfrac{u_{i,j}+u_{j,i}}{2}.
\end{equation}
The stress tensor is related to the strain tensor through the generalized Hooke's law
\begin{equation}
    \sigma_{ij}=c_{ijkl}\varepsilon_{kl}
\end{equation}
where, for isotropic elasticity, the elastic coefficients and stress tensor can be expressed in terms of the Lam\'{e} parameters $\lambda$ and $\mu$ as
\begin{align}
    c_{ijkl}    & =\mu(\delta_{ik}\delta_{jl}+\delta_{il}\delta_{jk})+\lambda\delta_{ij}\delta_{kl} \\
    \sigma_{ij} & = \lambda\varepsilon_{kk}\delta_{ij} + 2\mu\varepsilon_{ij}.
\end{align}
The Lam\'e parameters $\lambda$ and $\mu$ are defined in terms of Young's modulus, $E$, and Poisson's ratio, $\nu$, as
\begin{align}
    \lambda & =\dfrac{\nu{E}}{(1+\nu)(1-2\nu)} \\
    \mu     & =\dfrac{\nu{E}}{2(1+\nu)}.
\end{align}
we can write the strong form of linear elasticity as
\begin{align}
    \sigma_{ij,j}+f_i & = 0 \text{ in $\Omega$}        \\
    u_i               & = g_i\text{ on $\Gamma_{g_i}$} \\
    \sigma_{ij}n_j    & = h_i\text{ on $\Gamma_{h_i}$}
\end{align}
where Dirichlet boundary conditions are applied on $\Gamma_{g_i}$, Neumann boundary conditions are applied on $\Gamma_{h_i}$, and the closure of the domain $\Omega$ is $\bar{\Omega}=\Omega\cup\Gamma_{g_i}\cup\Gamma_{h_i}$. {To demonstrate the source of volumetric locking, we introduce the pressure term}
\begin{equation}
    p=-(\lambda+2\mu/3){\epsilon}_{ii}.
\end{equation}
If $\nu\rightarrow\dfrac{1}{2}$ then $\lambda$ becomes very large and {the additional constraint $\epsilon_{ii} = 0$ is applied to the volumetric strain.}

\subsection{Symmetric \Bezier $\bar{B}$ projection}
\subsubsection{The weak form}
The $\bar{B}$ approach for nearly incompressible linear elasticity splits the strain tensor $\varepsilon$ into volumetric and deviatoric strains and then replaces the volumetric strain with a projected strain. We begin with
\begin{equation}
    \boldsymbol{\varepsilon}(\mathbf{u})=\boldsymbol{\varepsilon}^{vol}(\mathbf{u})+\boldsymbol{\varepsilon}^{dev}(\mathbf{u})
\end{equation}
where $\boldsymbol{\varepsilon}^{vol}=\dfrac{1}{3}\mathrm{tr}(\boldsymbol{\varepsilon})\mi$ is the volumetric strain and $\boldsymbol{\varepsilon}^{dev}=\boldsymbol{\varepsilon}-\dfrac{1}{3}\mathrm{tr}(\boldsymbol{\varepsilon})\mi$ is the deviatoric strain. The volumetric strain is then replaced by a projected volumetric strain $\bar{\boldsymbol{\varepsilon}}^{vol}$ and the new total strain becomes
\begin{equation}
    \bar{\boldsymbol{\varepsilon}}=\bar{\boldsymbol{\varepsilon}}^{vol}+\boldsymbol{\varepsilon}^{dev}.
\end{equation}
The weak form can then be written as: find $\mathbf{u}\in{\mathcal{S}(\Omega)}$ such that for all $\mathbf{w}\in{\mathcal{V}(\Omega)}$
\begin{equation}
    \bar{a}\langle{\mathbf{w},\mathbf{u}}\rangle=\bar{l}\langle{\mathbf{w}}\rangle
\end{equation}
where
\begin{align}
    \bar{a}\langle{\mathbf{w},\mathbf{u}}\rangle & =\int_{\Omega}\bar{\epsilon}_{ij}(\mathbf{w})c_{ijkl}\bar{\epsilon}_{kl}(\mathbf{u})d\Omega,      \\
    \bar{l}\langle{\mathbf{w}}\rangle            & =\int_{\Omega}\mathbf{w}\cdot\mathbf{f}d\Omega+\int_{\Gamma_{h}}\mathbf{w}\cdot\mathbf{h}d\Gamma.
\end{align}

\subsubsection{Discretization}
Following the same approach as was described for Timoshenko beams in Section~\ref{sec:timoshenkobeam} we define element level strain-displacement matrices in terms of the Bernstein basis
\begin{align}
    {\mathbf{B}^{dev}_e} & =
    \begin{bmatrix}
        \dfrac{2}{3}\dfrac{\partial{B}^e_{0,p}}{\partial{x}}  & -\dfrac{1}{3}\dfrac{\partial{B}^e_{0,p}}{\partial{y}} & -\dfrac{1}{3}\dfrac{\partial{B}^e_{0,p}}{\partial{z}} & \cdots & \dfrac{2}{3}\dfrac{\partial{B}^e_{p,p}}{\partial{x}}  & -\dfrac{1}{3}\dfrac{\partial{B}^e_{p,p}}{\partial{y}} & -\dfrac{1}{3}\dfrac{\partial{B}^e_{p,p}}{\partial{z}} \\
        -\dfrac{1}{3}\dfrac{\partial{B}^e_{0,p}}{\partial{x}} & \dfrac{2}{3}\dfrac{\partial{B}^e_{0,p}}{\partial{y}}  & -\dfrac{1}{3}\dfrac{\partial{B}^e_{0,p}}{\partial{z}} & \cdots & -\dfrac{1}{3}\dfrac{\partial{B}^e_{p,p}}{\partial{x}} & \dfrac{2}{3}\dfrac{\partial{B}^e_{p,p}}{\partial{y}}  & -\dfrac{1}{3}\dfrac{\partial{B}^e_{p,p}}{\partial{z}} \\
        -\dfrac{1}{3}\dfrac{\partial{B}^e_{0,p}}{\partial{x}} & -\dfrac{1}{3}\dfrac{\partial{B}^e_{0,p}}{\partial{y}} & \dfrac{2}{3}\dfrac{\partial{B}^e_{0,p}}{\partial{z}}  & \cdots & -\dfrac{1}{3}\dfrac{\partial{B}^e_{p,p}}{\partial{x}} & -\dfrac{1}{3}\dfrac{\partial{B}^e_{p,p}}{\partial{y}} & \dfrac{2}{3}\dfrac{\partial{B}^e_{p,p}}{\partial{z}}  \\
        0                                                     & \dfrac{\partial{B}^e_{0,p}}{\partial{z}}              & \dfrac{\partial{B}^e_{0,p}}{\partial{y}}              & \cdots & 0                                                     & \dfrac{\partial{B}^e_{p,p}}{\partial{z}}              & \dfrac{\partial{B}^e_{p,p}}{\partial{y}}              \\
        \dfrac{\partial{B}^e_{0,p}}{\partial{z}}              & 0                                                     & \dfrac{\partial{B}^e_{0,p}}{\partial{x}}              & \cdots & \dfrac{\partial{B}^e_{p,p}}{\partial{z}}              & 0                                                     & \dfrac{\partial{B}^e_{p,p}}{\partial{x}}              \\
        \dfrac{\partial{B}^e_{0,p}}{\partial{y}}              & \dfrac{\partial{B}^e_{0,p}}{\partial{x}}              & 0                                                     & \cdots & \dfrac{\partial{B}^e_{p,p}}{\partial{y}}              & \dfrac{\partial{B}^e_{p,p}}{\partial{x}}              & 0                                                     \\
    \end{bmatrix},
\end{align}
\begin{align}
    {\mathbf{B}_e^{vol}} & =
    \begin{bmatrix}
        \dfrac{\partial{B}^e_{0,p}}{\partial{x}} & \dfrac{\partial{B}^e_{0,p}}{\partial{y}} & \dfrac{\partial{B}^e_{0,p}}{\partial{z}} & \cdots & \dfrac{\partial{B}^e_{p,p}}{\partial{x}} & \dfrac{\partial{B}^e_{p,p}}{\partial{y}} & \dfrac{\partial{B}^e_{p,p}}{\partial{z}}
    \end{bmatrix}
\end{align}
The deviatoric part of the element stiffness matrix can then be computed from the corresponding strain-displacement matrices as
\begin{align}
    \mathbf{K}_e^{dev}
    =\mathbf{C}^e\langle {\mathbf{B}_{e}^{dev}}^T\mathbf{D}{\mathbf{B}}_{e}^{dev}\rangle (\mathbf{C}^e)^T.
\end{align}
where $\mathbf{C}^e$ is the element extraction operator for the degree $p$ spline space. The volumetric part of the stiffness matrix is computed using Bezier projection. The intermediate element matrices are
\begin{align}
    \bar{\mathbf{M}}^{vol}_e & =\bar{\mathbf{C}}^e\langle{\bar{\mathbf{B}}_e^T,\dfrac{1}{3}(3\lambda+2\mu)\bar{\mathbf{B}}_e}\rangle(\bar{\mathbf{C}}^e)^T \\
    \hat{\mathbf{P}}^{vol}_e & =\langle{(\hat{\bar{\mathbf{N}}}^e)^T, \mathbf{B}_e^{vol}}\rangle(\mathbf{C}^e)^T
\end{align}
where $\bar{\mathbf{C}}^e$ is the element extraction operator for the degree $p-1$ spline space, $\hat{\bar{\mathbf{N}}}^e$ are the dual basis functions restriced to the element, and \begin{equation}
    \bar{\mathbf{B}}_e=
    \begin{bmatrix}
        {B}^e_{0,p-1} & \cdots & {B}^e_{p-1,p-1}
    \end{bmatrix}.
\end{equation}The global stiffness matrix can then be assembled as
\begin{align}
    \mathbf{K} = \mathbf{K}^{dev} + \bar{\mathbf{K}}^{vol}_{S}
\end{align}
where
\begin{align}
    \mathbf{K}^{dev}         & =\A_e\mathbf{K}_e^{dev},                            \\
    \bar{\mathbf{K}}_S^{vol} & =\hat{\mathbf{P}}^T\bar{\mathbf{M}}\hat{\mathbf{P}} \\
    \hat{\mathbf{P}}         & =\A_e\hat{{\mathbf{P}}}^{vol}_e                     \\
    \bar{\mathbf{M}}         & =\A_e\bar{\mathbf{M}}^{vol}_e.
\end{align}
\subsection{Non-symmetric \Bezier $\bar{B}$ projection}
\subsubsection{The weak form}
{A mixed formulation for nearly incompressible elasticity can be developed by considering the pressure $p$ as an independent variable. The weak statement of the problem is then given as: find $\mathbf{u}\in{\mathcal{S}(\Omega)}$ and $p\in{L}^2(\Omega)$ such that for all $\mathbf{w}\in{\mathcal{V}(\Omega)}$ and $\delta{p}\in{L}^2(\Omega)$}
\begin{align}
    \hat{a}\langle{\mathbf{w},\mathbf{u}}\rangle-b\langle{\mathbf{w},p}\rangle                        & =l\langle{\mathbf{w}}\rangle, \\
    - b\langle{\mathbf{u},\delta{p}}\rangle-\dfrac{1}{(\lambda+2\mu/3)}\int_{\Omega}\delta{p}pd\Omega & =0,
\end{align}
where
\begin{align}
    \hat{a}\langle{\mathbf{w},\mathbf{u}}\rangle & =\int_{\Omega}\epsilon_{ij}(\mathbf{w})\hat{c}_{ijkl}\epsilon_{kl}(\mathbf{u})d\Omega,    \\
    \hat{c}_{ijkl}                               & =\mu\left(\delta_{ik}\delta_{jl}+\delta_{il}\delta_{jk}-2/3\delta_{ij}\delta_{kl}\right), \\
    b\langle{\mathbf{w},p}\rangle                & =\int_{\Omega}\epsilon_{ii}(\mathbf{w})pd\Omega.
\end{align}

\subsubsection{{Discretization}}

Following the same pattern as the non-symmetric \Bezier $\bar{B}$ method for the Timoshenko beam problem, we use the same discretization for $\mathbf{u}$ and $\mathbf{w}$ and use lower order spline basis functions and corresponding dual basis functions for the discretization of the pressure $p$ and its variation $\delta{p}$, respectively. The discretized stiffness matrix in mixed form can be written as
\begin{equation}
    \mathbf{K}_{mix}=
    \begin{bmatrix}
        \mathbf{K}^{dev}  & -\mathbf{P}^{T}                        \\
        -\hat{\mathbf{P}} & -\dfrac{1}{(\lambda+2\mu/3)}\mathbf{I}
    \end{bmatrix},
\end{equation}
{where}
\begin{equation}
    \mathbf{P}=\A_e\mathbf{P}_e^{vol},
\end{equation}
with
\begin{equation}
    \mathbf{P}_e^{vol}=\bar{\mathbf{C}}^e\langle{\bar{\mathbf{B}}_e^T,\mathbf{B}^{vol}_e}\rangle(\mathbf{C}^e)^T.
\end{equation}
By eliminating the pressure control variables, we obtain a pure displacement formulation with the stiffness matrix taking the form
\begin{equation}
    \mathbf{K} = \mathbf{K}^{dev} + \bar{\mathbf{K}}^{vol}_{NS},
\end{equation}
where
\begin{equation}
    \bar{\mathbf{K}}^{vol}_{NS}=(\lambda+2\mu/3){\mathbf{P}}^T\hat{\mathbf{P}}.
\end{equation}
We note again, that in contrast to the symmetric \Bezier $\bar{B}$ method, the assembly of the stiffness matrix in this case can be performed in the standard way with no need for global matrix operations.

\subsection{Numerical results}
{We begin this section by numerically evaluating the \textit{inf-sup} constant for the global $\bar{B}$ and non-symmetric \Bezier $\bar{B}$ methods.}
We then investigate the performance of the B\'{e}zier $\bar{B}$ method for two nearly incompressible linear elasticity problems under plane strain conditions. {For the numerical examples,} we first study the Cook's membrane problem, which is discretized with B-spline basis functions, and in the second problem we model an infinite plate with a circular hole using NURBS. Results computed using standard finite elements are labeled $Q_1$, $Q_2$, $Q_3$, and $Q_4$. Results computed using a global $\bar{B}$ method are labeled $\mathcal{T}^{L^2}$ and those computed with the {symmetric} B\'ezier $\bar{B}$ method and the {non-symmetric B\'ezier $\bar{B}$ method} are labeled $S-\mathcal{T}^{P}$ and $NS-\mathcal{T}^{P}$, respectively.

\subsubsection{{Numerical evaluation of the inf-sup condition}}

The inf-sup condition is also refered to as the Ladyzhenskaya-Babuska-Brezzi condition (or simply LBB)~\cite{babuvska1973finite, brezzi1974existence, ladyzhenskaya1969mathematical}. It is a crucial condition to ensure the solvability, stability and optimality of a mixed problem. For the nearly incompressible elasticity problem the inf-sup condition is stated as: for $\delta{p}\neq{0}$ and $\mathbf{u}\neq{0}$
\begin{equation}
    \inf_{\delta{p}\in{L^2(\Omega)}}\sup_{\mathbf{u}\in\mathcal{S}(\Omega)}\dfrac{\vert{b\langle{\mathbf{u},\delta{p}}\rangle}\vert}{\|{\delta{p}}\|_{L^2(\Omega)}\|{\mathbf{u}}\|_{H^1(\Omega)}}\geq\beta>0.
\end{equation}
In a discretized problem, the inf-sup condition requires the variable $\beta$ to be a constant that is independent of the mesh size.\par

Here, we consider the inf-sup condition of a uniformly refined quarter annulus. The geometry and boundary conditions are shown in Figure \ref{fig:quarter_annulus}. The geometry of the quarter annulus can be exactly represented using a biquadratic NURBS basis. The knot vector for the coarsest discretization is given by
\begin{align}
    \begin{split}
        \Xi_\xi\times\Xi_\eta=\lbrace{0,0,0,1,1,1}\rbrace\times\lbrace{0,0,0,1,1,1}\rbrace
    \end{split}
\end{align}
and the corresponding weights and control points associated with each basis function are given in Table \ref{table:weights} and \ref{table:control_points}. For higher-order elements and finer discretizations the weights and corresponding control points are identified by an order elevation and knot insertion algorithm, respectively. The B\'ezier mesh representation for the discretizations are shown in Figure \ref{fig:mesh_hole}.

\begin{figure}[htb!]
    \centering
    \includegraphics[width=0.5\linewidth]{annular}
    \caption{Geometry and boundary conditions for the inf-sup test.}
    \label{fig:quarter_annulus}
\end{figure}

\begin{table}
    \begin{center}
        \caption{Weights for the plate with a circular hole}\label{table:weights}
        \begin{tabular}{l@{\hskip 1cm}l@{\hskip 1cm}l@{\hskip 1cm}l}
            \hline
            i & $w_{i,1} $ & $w_{i,2}$        & $w_{i,3}$ \\
            \hline
            1 & 1          & ${1}/{\sqrt{2}}$ & 1         \\
            2 & 1          & ${1}/{\sqrt{2}}$ & 1         \\
            3 & 1          & ${1}/{\sqrt{2}}$ & 1         \\
            \hline
        \end{tabular}
    \end{center}
\end{table}

\begin{table}
    \begin{center}
        \caption{Control points for the plate with a circular hole}\label{table:control_points}
        \begin{tabular}{l@{\hskip 1cm}l@{\hskip 1cm}l@{\hskip 1cm}l}
            \hline
            i & $B_{i,1} $ & $B_{i,2}$ & $B_{i,3}$ \\
            \hline
            1 & (0,1)      & (1,1)     & (1,0)     \\
            2 & (0,2.5)    & (2.5,2.5) & (2.5,0)   \\
            3 & (0,4)      & (4,4)     & (4,0)     \\
            \hline
        \end{tabular}
    \end{center}
\end{table}
\begin{figure}
    \centering
    \begin{subfigure}[b]{0.18\linewidth}        %% or \columnwidth
        \centering
        \includegraphics[width=\linewidth]{mesh_hole_0}
    \end{subfigure}
    \begin{subfigure}[b]{0.18\linewidth}        %% or \columnwidth
        \centering
        \includegraphics[width=\linewidth]{mesh_hole_1}
    \end{subfigure}
    \begin{subfigure}[b]{0.18\linewidth}        %% or \columnwidth
        \centering
        \includegraphics[width=\linewidth]{mesh_hole_2}
    \end{subfigure}
    \begin{subfigure}[b]{0.18\linewidth}        %% or \columnwidth
        \centering
        \includegraphics[width=\linewidth]{mesh_hole_3}
    \end{subfigure}
    \begin{subfigure}[b]{0.18\linewidth}        %% or \columnwidth
        \centering
        \includegraphics[width=\linewidth]{mesh_hole_4}
    \end{subfigure}
    \caption{Sequence of meshes for inf-sup test.}
    \label{fig:mesh_hole}
\end{figure}

Only the global $\bar{B}$ method and the non-symmetric \Bezier $\bar{B}$ method are considered here, as the symmetric \Bezier $\bar{B}$ method lacks a connection to a mixed formulation. As a counter example, the well-known pair $Q_p/Q_p$ of the global $\bar{B}$ method that violates the inf-sup condition is also tested here. Our tests follow the procedure proposed by Chapelle and Bathe in \cite{chapelle_inf-sup_1993}.\par
\begin{figure}[htb!]
    \centering
    \begin{subfigure}[b]{0.31\linewidth}        %% or \columnwidth
        \centering
        \includegraphics[width=\linewidth]{beta_p_2}
    \end{subfigure}
    \begin{subfigure}[b]{0.31\linewidth}        %% or \columnwidth
        \centering
        \includegraphics[width=\linewidth]{beta_p_3}
    \end{subfigure}
    \begin{subfigure}[b]{0.31\linewidth}        %% or \columnwidth
        \centering
        \includegraphics[width=\linewidth]{beta_p_4}
    \end{subfigure}

    \caption{Inf-sup test results for nearly incompressible elasticity. The global $\bar{B}$ method, $\mathcal{T}^{L^2} Q4/Q3$, and the non-symmetric \Bezier $\bar{B}$ method, $NS - \mathcal{T}^P Q4/Q3$, do not strictly satisfy the LBB condition, but compared to the $\mathcal{T}^{L^2} Q_4/Q_4$ method, both methods reduce constraints to a favorable level. }
    \label{fig:inf_sup}
\end{figure}

Figure \ref{fig:inf_sup} shows the numerical results. As can be seen, the global $\bar{B}$ method and the non-symmetric \Bezier $\bar{B}$ method do not strictly satisfy the LBB condition since $\beta$ is not independent of the mesh size. This result is consistent with the statement made in \cite{elguedj:hal-00457010} that the global $\bar{B}$ method does not reduce the constraints sufficiently to satisfy the LBB condition. However, compared to the $Q_p/Q_p$ pair, both methods reduce constraints to a more favorable level. If we compare the results for the global $\bar{B}$ method with the non-symmetric \Bezier $\bar{B}$ method we see that their stability parameter $\beta$ decreases at the same rate and the stability parameter for the non-symmetric \Bezier $\bar{B}$ method is slightly lower than that for the global $\bar{B}$ method. These results indicate a similar optimality in convergence for both methods and a slightly higher error for the non-symmetric \Bezier $\bar{B}$ method.

\subsubsection{Cook's membrane problem}

This benchmark problem is a standard test for combined bending and shearing response. The geometry, boundary conditions, and material properties are shown in Figure \ref{fig:Cook's}. The left boundary of the tapered panel is clamped, the top and bottom edges are free with zero traction boundary conditions, and the right boundary is subjected to a uniformly distributed traction load in the $y$-direction as shown. The meshes used are shown in Figure \ref{fig:mesh_cook}.
\begin{figure}[htb!]
    \centering
    \includegraphics[width=0.5\linewidth]{Cook_s}
    \caption{Geometry, boundary conditions, and material properties for the Cook's membrane problem.}
    \label{fig:Cook's}
\end{figure}

A comparison of the displacement of the top right corner with respect to the number of elements per side is shown in Figure \ref{fig:Cook's_result}. $Q_1$ locks and mesh refinement has little impact. Locking is somewhat reduced for the higher-order elements $Q_p$, $p > 1$. The $\bar{B}$ methods perform very well for all degrees.
\begin{figure}[htb!]
    \centering
    \begin{subfigure}[b]{0.18\linewidth}        %% or \columnwidth
        \centering
        \includegraphics[width=\linewidth]{mesh_cook_0}
    \end{subfigure}
    \begin{subfigure}[b]{0.18\linewidth}        %% or \columnwidth
        \centering
        \includegraphics[width=\linewidth]{mesh_cook_1}
    \end{subfigure}
    \begin{subfigure}[b]{0.18\linewidth}        %% or \columnwidth
        \centering
        \includegraphics[width=\linewidth]{mesh_cook_2}
    \end{subfigure}
    \begin{subfigure}[b]{0.18\linewidth}        %% or \columnwidth
        \centering
        \includegraphics[width=\linewidth]{mesh_cook_3}
    \end{subfigure}
    \begin{subfigure}[b]{0.18\linewidth}        %% or \columnwidth
        \centering
        \includegraphics[width=\linewidth]{mesh_cook_4}
    \end{subfigure}
    \caption{Sequence of meshes for Cook's membrane problem.}
    \label{fig:mesh_cook}
\end{figure}

\begin{figure}[H]
    \centering
    \begin{subfigure}[b]{\textwidth}
        \centering
        \includegraphics[width=.62\linewidth]{Cook's_membrane_Q1}
    \end{subfigure}
    %
    \centering
    \begin{subfigure}[b]{\textwidth}
        \centering
        \includegraphics[width=.62\linewidth]{Cook's_membrane_Q2}
    \end{subfigure}
\end{figure}

\begin{figure}[H]
    \ContinuedFloat
    \centering

    \begin{subfigure}[b]{\textwidth}
        \centering
        \includegraphics[width=.62\linewidth]{Cook's_membrane_Q3}
    \end{subfigure}
    %
    \centering
    \begin{subfigure}[b]{\textwidth}
        \centering
        \includegraphics[width=.62\linewidth]{Cook's_membrane_Q4}
    \end{subfigure}
    \caption{Cook's membrane: comparison of the vertical displacement at the top right corner for the different methods and degrees.}
    \label{fig:Cook's_result}
\end{figure}
\subsubsection{Infinite plate with a circular hole}

The setup for the infinite plate with a circular hole problem is shown in Figure \ref{fig:platewithhole_geometry} and the discretizations are shown in Figure \ref{fig:mesh_hole}. The traction along the outer edge is evaluated from the exact solution which is given by
\begin{align}
    \begin{split}
        \sigma_{rr}(r,\theta)&=\dfrac{T_x}{2}(1-\dfrac{R_1^2}{r^2})+\dfrac{T_x}{2}(1-4\dfrac{R_1^2}{r^2}+3\dfrac{R_1^4}{r^4})cos(2\theta)\\
        \sigma_{\theta\theta}(r,\theta)&=\dfrac{T_x}{2}(1+\dfrac{R_1^2}{r^2})-\dfrac{T_x}{2}(1+3\dfrac{R_1^4}{r^4})cos(2\theta)\\
        \sigma_{r\theta}(r,\theta)&=-\dfrac{T_x}{2}(1+2\dfrac{R_1^2}{r^2}-3\dfrac{R_1^4}{r^4})sin(2\theta).
    \end{split}
\end{align}
\begin{figure}[htb!]
    \centering
    \begin{subfigure}[t]{0.5\textwidth}
        \centering
        \includegraphics[width=1\linewidth]{Platewithhole}
        \caption{Infinite plate with a hole subjected to uniaxial tension at $x=\pm\infty$.}
        \label{fig:platewithhole_geometry_a}
    \end{subfigure}%
    ~
    \begin{subfigure}[t]{0.5\textwidth}
        \centering
        \includegraphics[width=1\linewidth]{Platewithhole_b}
        \caption{A representation of the computational model.}
        \label{fig:platewithhole_geometry_b}
    \end{subfigure}
    \caption{Geometry, boundary conditions, and material properties for the infinite plate with a hole.}
    \label{fig:platewithhole_geometry}
\end{figure}

Convergence plots for the relative error of the displacement and energy in the $L^2$ norm are shown in Figure \ref{fig:platewithhole_convergence}. As can be seen, the standard $Q_p$ approximations suffer from severe volumetric locking for all orders while, on the other hand, the $\bar{B}$ methods remedy locking for all cases. {For the symmetric \Bezier $\bar{B}$ method, optimal rates are achieved in all three measures for biquadratic elements and the optimal energy convergence has been achieved for bicubic elements, but convergence has degraded in all three measures for the biquartic elements. This reduction in convergence rates results from the fact that the derivation of the symmetric \Bezier $\bar{B}$ method is purely based on the engineering analogy between the $L^2$ projection and \Bezier projection operations. The non-symmetric \Bezier $\bar{B}$ method, on the other hand, achieves optimal convergence in the displacement, stress, and energy norms for all elements with slightly higher errors than those of the global $\bar{B}$ method.}

    {Contour plots of  $\sigma_{xx}$ from the finest biquartic discretization are shown in Figure \ref{fig:platewithhole_contour}. We can see that results from all $\bar{B}$ methods are consistent with the reference solution, but using the standard finite element approach results in meaningless stresses. Figure \ref{fig:platewithhole_error_contour} shows the absolute error of $\sigma_{xx}$ from the same discretization. We can see that the projection methods produce an error of less than $.1\%$ of the maximum $\sigma_{xx}$, while the error for the standard $Q_4$ element is of the same order as the maximum $\sigma_{xx}$. We can also see that the non-symmetric method provides a slight improvement when compared to the symmetric method.}
\begin{figure}[h]
    \center
    \begin{tabular}{ccc}
        \includegraphics[width=.31\linewidth]{deformation_p_2} & \includegraphics[width=.31\linewidth]{deformation_p_3} & \includegraphics[width=.31\linewidth]{deformation_p_4} \\
        \includegraphics[width=.31\linewidth]{stress_p_2}      & \includegraphics[width=.31\linewidth]{stress_p_3}      & \includegraphics[width=.31\linewidth]{stress_p_4}      \\
        \includegraphics[width=.31\linewidth]{energy_p_2}      & \includegraphics[width=.31\linewidth]{energy_p_3}      & \includegraphics[width=.31\linewidth]{energy_p_4}
    \end{tabular}
    \caption{Convergence study of the plate with a circular hole. The relative $L^2$ error of displacement, stress and the relative error in energy norm with respect to mesh refinement.}
    \label{fig:platewithhole_convergence}
\end{figure}

\begin{figure}[htb!]
    \center
    \begin{tabular}{cc}
        \includegraphics[width=.4\linewidth]{no_stress_contour}        & \includegraphics[width=.4\linewidth]{g_stress_contour}  \\
        $Q_4$                                                          & $\mathcal{T}^{L^2} Q_4/Q_3$                             \\
        \includegraphics[width=.4\linewidth]{s_stress_contour}         & \includegraphics[width=.4\linewidth]{ns_stress_contour} \\
        $S-\mathcal{T}^{p} Q_4/Q_3$                                    & $NS-\mathcal{T}^{p} Q_4/Q_3$                            \\
        \includegraphics[width=.4\linewidth]{reference_stress_contour} & \includegraphics[width=.14\linewidth]{legend}           \\
        Reference                                                      & Legend
    \end{tabular}
    \caption{ Contour plots of $\sigma_{xx}^h$ for the plate with a circular hole ($p=4$, and the finest mesh is used). For reference the analytical solution is also plotted. }
    \label{fig:platewithhole_contour}
\end{figure}

\begin{figure}[htb!]
    \center
    \begin{tabular}{cc}
        \includegraphics[width=.44\linewidth]{no} & \includegraphics[width=.5\linewidth]{g}  \\
        $Q_4$                                     & $\mathcal{T}^{L^2} Q_4/Q_3$              \\
        \includegraphics[width=.5\linewidth]{s}   & \includegraphics[width=.5\linewidth]{ns} \\
        $S-\mathcal{T}^{p} Q_4/Q_3$               & $NS-\mathcal{T}^{p} Q_4/Q_3$
    \end{tabular}
    \caption{Contour plots of $\vert{\sigma_{xx}-\sigma_{xx}^h}\vert$ for the plate with a circular hole ($p=4$, and the finest mesh is used).}
    \label{fig:platewithhole_error_contour}
\end{figure}

\section{Conclusions}
\label{sec:conclusion}

We have presented two B\'{e}zier $\bar{B}$ projection methods, which we have called symmetric and non-symmetric \Bezier $\bar{B}$ projection, as an approach to overcome locking phenomena in structural mechanics applications of isogeometric analysis. Each approach maintains the sparsity of the resulting linear system. The methods utilize B\'ezier extraction and projection, which makes it simple to implement them in an existing finite element framework and makes it applicable to any spline representation which can be written in \Bezier form. In contrast to global $\bar{B}$ methods, which produce dense stiffness matrices, the B\'ezier $\bar{B}$ approach results in a sparse stiffness matrix while still benefiting from higher-order convergence rates. {We have made the connection between the non-symmetric method and a mixed formulation and shown that, although this method does not strictly satisfy the inf-sup condition, it reduces constraints sufficiently to provide optimal convergence rates for the problems studied here.}

We have demonstrated the performance of the approach in the context of shear deformable beams (to alleviate transverse shear locking) and nearly incompressible elasticity problems (to alleviate volumetric locking). The proposed method reduces locking errors and achieves nearly optimal convergence rates { for the symmetric method and optimal rates for the non-symmetric method}. The cases where optimal rates were not achieved {when using the the symmetric formulation are a symptom of the fact that the symmetric formulation is not directly related to a variational principle}.

{The two methods presented here provide a choice between a formulation that results in a symmetric stiffness matrix but requires matrix operations at the global level and potentially less accuracy and a formulation that results in a non-symmetric stiffness matrix that can be assembled in the standard element routine approach and achieves optimal convergence rates. The trade-offs are between higher costs in assembly for the symmetric formulation versus potentially higher costs in solving a non-symmetric system. In either case, however, the cost is less than using the standard $\bar{B}$ formulation.}

\clearpage\null\newpage


\documentclass[]{BasiliskReportMemo}
\usepackage{AVS}

\newcommand{\submiterInstitute}{Autonomous Vehicle Simulation (AVS) Laboratory,\\ University of Colorado}

\newcommand{\ModuleName}{test\textunderscore sunlineUKF}
\newcommand{\subject}{Sunline UKF Module and Test}
\newcommand{\status}{Initial document}
\newcommand{\preparer}{T. Teil}
\newcommand{\summary}{This module implements and tests a Unscented Kalman Filter in order to estimate the sunline direction.}

\begin{document}

\makeCover

%
%	enter the revision documentation here
%	to add more lines, copy the table entry and the \hline, and paste after the current entry.
%
\pagestyle{empty}
{\renewcommand{\arraystretch}{2}
\noindent
\begin{longtable}{|p{0.5in}|p{4.5in}|p{1.14in}|}
\hline
{\bfseries Rev}: & {\bfseries Change Description} & {\bfseries By} \\
\hline
Draft & Initial Revision & T. Teil \\
\hline

\end{longtable}
}

\newpage
\setcounter{page}{1}
\pagestyle{fancy}

\tableofcontents
~\\ \hrule ~\\

%\begin{figure}[htb]
%	\centerline{
%	\includegraphics[]{Figures/Fig1}
%	}
%	\caption{Sample Figure Inclusion.}
%	\label{fig:Fig1}
%\end{figure}

\section{Introduction}
The Unscented Kalman filter (UKF) in the AVS Basilisk simulation is a sequential
filter implemented to give the best estimate of the desired states.
In this method we estimate the sun heading as well as it's rate of change along the observable axes.
The UKF reads in the message written by the coarse sun sensor, and writes a message
containing the sun estimate.

This document summarizes the content of the module, how to use it, and the test that
was implemented for it. More information on the filter derivation can be found in Reference [\citenum{Teil:2018fe}], and more information on the square root unscented filter can be found in Reference [\citenum{Wan2001}] (attached alongside this document).

\subsection{Dynamics}

The states that are estimated in this filter are the sunline vector, and it's rate of change $\bm X^* = \begin{bmatrix} \bm d &  \dot{\bm d}\end{bmatrix}^T$. The star superscript represents that
this is the reference state.

The dynamics are given in equation \ref{eq:dyn}. Given the nature of the filter, there is an unobservable state component: the rotation about the $\bm d$ axis. In order to remedy this, we project the states along this axis and subtract them, in order to measure only observable state components.

\begin{equation}\label{eq:dyn}
\bm F(\bm X) = \begin{bmatrix} \bm F_1(\bm d) \\  \bm F_2(\dot{\bm d})\end{bmatrix} =  \begin{bmatrix} \dot{\bm d} - \left( (\bm d \cdot \dot{\bm d} )\frac{\bm d}{||\bm d||^2} \right) \\ - \frac{1}{\Delta t}\left( (\bm d \cdot \dot{\bm d}) \frac{\bm d}{||\bm d||^2} \right)\end{bmatrix}
\end{equation}

The measurement model is given in equation \ref{eq:meas}, and the $H$ matrix defined as $H = \left[\frac{\partial \bm G (\bm X, t_i)}{\partial \bm X}\right]^{*}$ is given in equation $\ref{eq:Hmat}$.

In this filter, the only measurements used are from the coarse sun sensor. For the $i^\mathrm{th}$ sensor, the measurement is simply given by the dot product of the sunline heading and the normal to the sensor. This yields easy partial derivatives for the H matrix, which is a matrix formed of the rows of transposed normal vectors (only for those which received a measurement). Hence the $H$ matrix has a changing size depending on the amount of measurements.

\begin{equation}\label{eq:meas}
\bm G_i(\bm X) = \bm n_i \cdot \bm d
\end{equation}

\begin{equation}\label{eq:Hmat}
\bm H(\bm X) = \begin{bmatrix} \bm n_1^T \\ \vdots \\ \bm n_i^T \end{bmatrix}
\end{equation}

\section{Filter Set-up, initialization, and I/O}

\subsection{User initialization}

In order for the filter to run, the user must set a few parameters:

\begin{itemize}
\item The unscented filter has 3 parameters that need to be set, and are best as: \\
      \texttt{ filterObject.alpha = 0.02} \\
      \texttt{ filterObject.beta = 2.0} \\
      \texttt{ filterObject.kappa = 0.0}
\item The angle threshold under which the coarse sun sensors do not read the measurement: \\
\texttt{FilterContainer.sensorUseThresh = 0.}
\item The process noise matrix: \\
   \texttt{qNoiseIn = numpy.identity(5)} \\
   \texttt{ qNoiseIn[0:3, 0:3] = qNoiseIn[0:3, 0:3]*0.01*0.01} \\
   \texttt{ qNoiseIn[3:6, 3:6] = qNoiseIn[3:6, 3:6]*0.001*0.001} \\
    \texttt{filterObject.qNoise = qNoiseIn.reshape(25).tolist()}
\item The measurement noise value, for instance: \\
 \texttt{FilterContainer.qObsVal = 0.001}
\item The initial covariance: \\
 \texttt{Filter.covar =} \\
  \texttt{ [0.4, 0.0, 0.0, 0.0, 0.0, 0.0, \\
                          0.0, 0.4, 0.0, 0.0, 0.0, 0.0, \\
                          0.0, 0.0, 0.4, 0.0, 0.0, 0.0, \\
                          0.0, 0.0, 0.0, 0.04, 0.0, 0.0, \\
                          0.0, 0.0, 0.0, 0.0, 0.04, 0.0, \\
                          0.0, 0.0, 0.0, 0.0, 0.0, 0.04]}
\item The initial state :\\
 \texttt{Filter.state =[1.0, 0.0, 0.0, 0.0, 0.0, 0.0]}
\end{itemize}
The messages must also be set as such:

\begin{itemize}
\item    \texttt{ filterObject.navStateOutMsgName = "sunline$\_$state$\_$estimate"}
\item    \texttt{ filterObject.filtDataOutMsgName = "sunline$\_$filter$\_$data"}
\item   \texttt{ filterObject.cssDataInMsgName = "css$\_$sensors$\_$data"}
\item   \texttt{ filterObject.cssConfInMsgName = "css$\_$config$\_$data"}
\end{itemize}

\subsection{Inputs and Outputs}

The UKF reads in the measurements from the coarse sun sensors. These are under the form of a list of cosine values. Knowing the normals to each of the sensors, we can therefore use them to estimate sun heading.

\section{Test Design}
The unit test for the sunlineUKF module is located in:\\

\noindent
{\tt fswAlgorithms/attDetermination/sunlineUKF/$\_$UnitTest/test$\_$SunlineUKF.py} \\

As well as another python file containing plotting functions:

\noindent
{\tt fswAlgorithms/attDetermination/sunlineUKF/$\_$UnitTest/SunlineUKF$\_$test$\_$utilities.py} \\

The test is split up into 3 subtests. The first test creaks up all of the individual filter methods and tests them individually. These notably go over the square-root unscented filter specific functions. The second test verifies that in the case where the state is zeroed out from the start of the simulation, it remains at zero. The third test verifies the behavior of the time update with a measurement modification in the middle of the run.

\subsection{Individual tests}

In each of these individual tests, random inputs are fed to the methods and their values are computed in parallel in python. These two values are then compared to assure that the correct computations are taking place.
\begin{itemize}
\item \underline{QR Decomposition}: This tests the QR decomposition function which returns just the R matrix. Tolerance to absolute error $\epsilon = 10^{-15}$.

\textcolor{ForestGreen}{Passed}
\item \underline{LU Decomposition}: This tests the LU Decomposition accuracy. Tolerance to absolute error $\epsilon = 10^{-14}$.

\textcolor{ForestGreen}{Passed}
\item \underline{LU backsolve}: This tests the LU Back-Solve accuracy. Tolerance to absolute error $\epsilon = 10^{-14}$.

\textcolor{ForestGreen}{Passed}
\item \underline{LU matrix inverse}: This tests the LU Matrix Inverse accuracy. Tolerance to absolute error $\epsilon = 10^{-14}$.

\textcolor{ForestGreen}{Passed}
\item \underline{Cholesky decomposition}: This tests the Cholesky Matrix Decomposition accuracy. Tolerance to absolute error $\epsilon = 10^{-14}$.

\textcolor{ForestGreen}{Passed}
\item \underline{L matrix inverse}: This tests the L Matrix Inverse accuracy. Tolerance to absolute error $\epsilon = 10^{-14}$.

\textcolor{ForestGreen}{Passed}

\item \underline{U matrix inverse}: This tests the U Matrix Inverse accuracy. Tolerance to absolute error $\epsilon = 10^{-12}$.

\textcolor{ForestGreen}{Passed}
\end{itemize}

\subsection{Static Propagation}

\input{AutoTeX/StatesPlotprop.tex}

This test also takes no measurements in, and propagates with the expectation of no change. It then tests that the states and covariance are as expected throughout the time of simulation. Plotted results are seen in Figure \ref{fig:StatesPlotprop}. We indeed see that the state and covariance that evolve nominally and without bias .

Tolerance to absolute error: $\epsilon = 10^{-10}$

\subsection{Full Filter test}

This test the filter working from start to finish. No measurements are taken in for the first 20 time steps. Then a heading is given through the CSS message. Halfway through the simulation, measurements stop, and 20 time steps later a different heading is read. The filter must be robust and detect this change. This test is parametrized for different test lengths, different initial conditions, different measured headings, and with or without measurement noise. All these are successful.

\vspace{0.2cm}
Tolerance to absolute error without measurement noise: $\epsilon = 10^{-10}$

\textcolor{ForestGreen}{Passed}

Plotted results are seen in Figures \ref{fig:StatesPlotupdate}, and \ref{fig:PostFitupdate}. Figure \ref{fig:StatesPlotupdate} shows the state error and covariance over the run. We see the covariance initially grow, then come down quickly as measurements are used. It grows once again as the measurements stop before bringing the state error back to zero with a change in sun heading.

Figure \ref{fig:PostFitupdate} shows the post fit residuals for the filter, with no measurement noise. We see that the observations are read in well an that the residuals are brought back down to zero.

\input{AutoTeX/StatesPlotupdate.tex}
\input{AutoTeX/PostFitupdate.tex}

\bibliographystyle{AAS_publication}   % Number the references.
\bibliography{references}   % Use references.bib to resolve the labels.

\end{document}


%==============================================================================
\chapter{Correlator of Field Strength}
\label{chap:corr_field}
%==============================================================================

Having revealed the discrepancy in the kinematic description of Hawking
radiation, namely as either a pure or a thermal and mixed state, the author
will show the difference in a physically relevant form. Recall that the
particle-number expectations of the pure and mixed states are the same,
i.e.\ the diagonal elements of the density operators in the particle-number
basis are the same. Hence one seeks operators revealing the off-diagonal
elements of the density operator.

%------------------------------------------------------------------------------
\section{Correlator and Fluctuation of Fourier Modes}
\label{sec:corr_Fourier}
%------------------------------------------------------------------------------

A natural candidate to reveal the off-diagonal elements of the density
operators is the correlator. Bearing in mind the correlator of generalised
Gaussian wave functions (see \cref{eq:multi-har-cor}), the correlator of the
wave functional \cref{eq:squeezed-wave-functional} can be read off as
\begin{align}
\abr{\rfun{g^\dagger}{p_1}\rfun{g}{p_2}}_{\chi_b} &=
\frac{1}{2}\rbr{\abr{\rfun{g_\Re}{p_1}\rfun{g_\Re}{p_2}}_{\chi_b}+\abr{
\rfun{g_\Im}{p_1}\rfun{g_\Im}{p_2}}_{\chi_b}}
= \frac{1}{2}\frac{\tanh\frac{\pp p_1}{2\lambda}}{p_1} \rfun{\delta}{p_1 -
p_2} \nonumber \\
&\propto \frac{1}{8T_\text{HD}}\frac{\rfun{\tanh}{q/4}}{q/4} =
\frac{1}{8T_\text{HD}}\rbr{1 + \rfun{\Omicron}{q}}
\label{eq:correlator-pure}
\end{align}
by substituting
\begin{equation}
\rfun{g}{p} = 2^{-1/2} \rbr{\rfun{g_\Re}{p} + \ii \rfun{g_\Im}{p}},
\end{equation}
where $2^{-1/2}\rfun{g_\Re}{p}$ and $2^{-1/2}\rfun{g_\Im}{p}$ are the
real and imaginary part of $\rfun{g}{p}$, respectively. In the last line of
\cref{eq:correlator-pure}, the delta function is ignored, and the dimensionless
parameter
\begin{equation}
	q \coloneqq p_1/T_\text{HD} \equiv 2\pp p_1/\lambda
\end{equation}
has been used. By the same argument, one also solves the correlator
\begin{equation}
\abr{\rfun{g^\dagger}{p_1}\rfun{g}{p_2}}_\text{vac} =
\frac{1}{2\vbr{p_1}}\rfun{\delta}{p_1-p_2} \propto
\frac{1}{2 T_\text{HD}} q^{-1}
\label{eq:correlator-vacuum}
\end{equation}
for the vacuum wave functional $\cfun{\exp}{-\int_{-\infty}^{+\infty}\dd p \,
\vbr{p}\vbr{\rfun{g}{p}}^2}$.
%\begin{equation}
%\label{eq:vacuum-wave-functional-g}
%\end{equation}
For the thermal state, on the other hand, the correlator follows from
\cref{eq:correlator-multiple-thermal}, so that
\begin{align}
\abr{\rfun{g^\dagger}{p_1}\rfun{g}{p_2}}_\text{th} &=
\frac{\coth\frac{\pp p_1}{\lambda}}{2 p_1} \rfun{\delta}{p_1-p_2}
\nonumber \\
&\propto \frac{1}{4T_\text{HD}} \frac{\rfun{\coth}{q/2}}{q/2}
= \frac{1}{4T_\text{HD}}\rbr{\rbr{\frac{q}{2}}^{-2} + \frac{1}{3} +
\rfun{\Omicron}{q}}.
\label{eq:correlator-thermal}
\end{align}

One sees immediately that
\cref{eq:correlator-pure,eq:correlator-vacuum,eq:correlator-thermal} vanish
identically for $p_1 \neq p_2$, which is due to the absence of interaction in
the scalar field. The remaining diagonal terms have the meaning of
\emph{fluctuation} in field strength, because $\abr{g} \equiv 0$, so that
\begin{equation}
	\abr{\rbr{\Delta g}^2} = \abr{g^2} - \abr{g}^2 \equiv \abr{g^2}.
\end{equation}
Ignoring the $\rfun{\delta}{0}$ divergence, the fluctuations are plotted in
\cref{fig:fluc-Fourier}.

\begin{figure}
\begin{center}
\input{./graphics/graph_fluc_fourier}
\end{center}
\caption[Fluctuations of the Fourier modes]{Fluctuations of the Fourier modes
of the field, plotted in log--log scales. The critical energy scale is the
Hawking temperature, below which the various fluctuations depart. The
discrepancy between the pure and thermal descriptions is most significant for
low-energy modes, while for high energies the fluctuations of them and
the vacuum state are practically the same. Moreover, compared with vacuum, the
low-energy fluctuation of thermal case is enhanced, so it diverges faster than
that of vacuum; for the pure description, however, the fluctuation is
suppressed, such that it converges to a constant of order unity and does not
diverge any more. \label{fig:fluc-Fourier}}
\end{figure}

%------------------------------------------------------------------------------
\section{Discussion}
\label{sec:corr-discussion}
%------------------------------------------------------------------------------

It has been noticed that the fluctuation discussed above has been extensively
used in cosmology, see e.g.\ \cite{Glenz2009}. The fluctuation in the
radiation field, however, looks different from that in cosmology and thus
remains yet to be explained.

Moreover, the most natural candidate to reveal the off-diagonal elements is the
correlator in \emph{real space}, which is just the Fourier transform of the
correlator calculated above. Unfortunately, the transformation has yet to be
made for the thermal state due to an infra-red divergence.

%%% Local Variables:
%%% mode: latex
%%% TeX-master: "../mythesis"
%%% End:


% Created 2021-07-08 Thu 10:15
% Intended LaTeX compiler: pdflatex
\documentclass[presentation,aspectratio=1610]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{grffile}
\usepackage{longtable}
\usepackage{wrapfig}
\usepackage{rotating}
\usepackage[normalem]{ulem}
\usepackage{amsmath}
\usepackage{textcomp}
\usepackage{amssymb}
\usepackage{capt-of}
\usepackage{hyperref}
\usepackage{khpreamble}
\usepackage{amssymb}
\DeclareMathOperator{\shift}{q}
\DeclareMathOperator{\diff}{p}
\usetheme{default}
\author{Kjartan Halvorsen}
\date{2021-07-08}
\title{Discretizing continuous-time controllers}
\hypersetup{
 pdfauthor={Kjartan Halvorsen},
 pdftitle={Discretizing continuous-time controllers},
 pdfkeywords={},
 pdfsubject={},
 pdfcreator={Emacs 26.3 (Org mode 9.4.6)},
 pdflang={English}}
\begin{document}

\maketitle

\section{Intro}
\label{sec:org5096880}

\section{Discretization}
\label{sec:org497335f}
\begin{frame}[label={sec:orga5cf6e7}]{Context}
\begin{itemize}
\item Controller \(F(s)\) obtained from a design in continuous time.
\item Need discrete approxmation in order to implement on a computer
\end{itemize}

\begin{center}
 \includegraphics[width=0.7\linewidth]{../../figures/fig8-1.png}\\
 \footnotesize Source: Åström \& Wittenmark
\end{center}
\end{frame}

\section{Warm-up: Differentiation}
\label{sec:org1fa17cb}

\begin{frame}[label={sec:org07d6f70}]{Warm-up exercise}
\begin{columns}
\begin{column}{0.4\columnwidth}
\begin{center}
\includegraphics[width=\linewidth]{../../figures/block-simple-derivative}
\end{center}

\alert{Draw the Bode diagram for the transfer function}
\end{column}
\begin{column}{0.6\columnwidth}
\begin{center}
\includegraphics[width=\linewidth]{../../figures/bode-derivative-empty}
\end{center}
\end{column}
\end{columns}
\end{frame}

\begin{frame}[label={sec:org2b5bba8}]{Discrete-time differentiation}
\begin{center}
\begin{tabular}{lll}
\includegraphics[width=0.3\linewidth]{../../figures/block-simple-shift-z} & \(\Leftrightarrow\) & \includegraphics[width=0.3\linewidth]{../../figures/block-simple-shift}\\
\end{tabular}
\end{center}

\begin{columns}
\begin{column}{0.4\columnwidth}
\vspace*{5mm}

\includegraphics[width=\linewidth]{../../figures/block-simple-discrete-derivative-fwd}

\textcolor{white}{Space}

\begin{center}
\includegraphics[width=\linewidth]{../../figures/block-simple-discrete-derivative}
\end{center}
\end{column}

\begin{column}{0.6\columnwidth}
\end{column}
\end{columns}
\end{frame}

\begin{frame}[label={sec:orgc048ecb}]{Discretization methods}
\begin{enumerate}
\item Forward difference. Substitute
\[ s = \frac{z-1}{h} \] in \(F(s)\) to get
\[ F_d(z) = F(s')|_{s'=\frac{z-1}{h}}. \]
\item Backward difference. Substitute
\[ s = \frac{z-1}{zh} \] in \(F(s)\) to get
\[ F_d(z) = F(s')|_{s'=\frac{z-1}{zh}}. \]
\end{enumerate}
\end{frame}
\begin{frame}[label={sec:org6c3e541}]{Discretization methods, contd.}
\begin{enumerate}
\setcounter{enumi}{2}
\item Tustin's method (also known as the bilinear transform). Substitute
\[ s = \frac{2}{h}\frac{z-1}{z+1} \] in \(F(s)\) to get
\[ F_d(z) = F(s')|_{s'=\frac{2}{h}\cdot \frac{z-1}{z+1}}. \]
\item Ramp invariance. This is similar to ZoH, which is step-invariant approximation.
Since a unit ramp has z-transform \(\frac{zh}{(z-1)^2}\) and Laplace-transform \(1/s^2\),  the discretization becomes
\[ F_d(z) = \frac{(z-1)^2}{zh} \ztrf{\laplaceinv{\frac{F(s)}{s^2}}}. \]
\end{enumerate}
\end{frame}

\begin{frame}[label={sec:orgcde3040}]{Frequency warping using Tustin's}
\begin{center}
\includegraphics[width=0.6\linewidth]{../../figures/fig8_3.png}
\end{center}
The infinite positive imaginary axis in the s-plane is mapped to the finite-length upper half of the unit circle in the z-plane.
\end{frame}
\begin{frame}[label={sec:org92aad28}]{Exercise}
Find the discrete approximation of the lead-compensator \(F(s) = \frac{s+b}{s+a}\), and determine the pole for
\begin{enumerate}
\item Forward difference. Substitute
\[ F_d(z) = F(s')|_{s'=\frac{z-1}{h}}. \]
\item Backward difference. Substitute
\[ F_d(z) = F(s')|_{s'=\frac{z-1}{zh}}. \]
\item Tustin's approximation
\[ F_d(z) = F(s')|_{s'=\frac{2}{h}\cdot \frac{z-1}{z+1}}. \]
\end{enumerate}
\end{frame}
\begin{frame}[label={sec:org4007077}]{Forward difference exercise}
\begin{center}
\includegraphics[width=\linewidth]{../../figures/forward-diff-exercise}
\end{center}
\end{frame}

\begin{frame}[label={sec:org912e773}]{Backward difference exercise}
\begin{center}
\includegraphics[width=\linewidth]{../../figures/backward-diff-exercise}
\end{center}
\end{frame}
\end{document}


\documentclass[11pt, letterpaper]{article}

\input{packages.tex}

\author{Thomas Alexander, Zachary Schoenfeld}

\title{Project: Optimal Control Theory with Qiskit Pulse}

% Full command definitions
\input{imports/quantum_info.tex}

\begin{document}
\maketitle
\tableofcontents

\section{Introduction}
Optimal control theory studies how to optimally (given an objective) manipulate a quantum system
to guide a state through a desired evolution given available classical
stimulus sources. Qiskit Pulse exposes control of quantum computing
stimulus sources through a standardized API, making lab-level experiments
possible through the cloud. In Qiskit a quantum circuit is lowered to a pulse
schedule through a scheduling procedure using predefined gate to pulse schedule
calibrations.

The aim of this project is to explore incorporating optimal control theory
into the Qiskit compilation pipeline with the aim of enabling on the fly
gate design of arbitrary unitary evolutions for applications in Qiskit Aqua.
Specifically you will examine implementing GRAPE \cite{khanejaOptimalControlCoupled2005c} on
a single-qubit IBM Quantum device.
This idea was explored in the work of Shi et. al. \cite{shiOptimizedCompilationAggregated2019b}
(see Figure \ref{fig:compilationpipeline}) with their focus on dynamic gate
aggregation and design.

\begin{figure}[hbt!]
 \centering
 \includegraphics[width=\linewidth]{../figures/yunong_pipeline.png}
 \caption{Compilation pipeline proposed by Shi et. al., reproduced from \cite{shiOptimizedCompilationAggregated2019b}.}
 \label{fig:compilationpipeline}
\end{figure}

We will begin to build out this functionality into Qiskit.
You will take the first exploratory steps of performing optimal control on actual qubits with Qiskit
Pulse and then come up with a proposal for how to add this functionality
to the Qiskit compilation pipeline in production.

\subsection{Overall Goals}
\begin{itemize}
\item Design and implement an optimal pulse control pipeline for constructing single qubit quantum gates
\item Develop your physics and software skills by applying them to optimal control theory
\item Gain exposure to the agile development processes and working with a full stack team across software and hardware
\item Have some fun!
\end{itemize}

\subsubsection{Technical Goals}
\begin{itemize}
\item Understand in a broad sense the engineering of superconducting qubits \cite{blaisCavityQuantumElectrodynamics2004c, krantzQuantumEngineerGuide2019a}.
\item Bootstrap control of a qubit with Qiskit Pulse. See \cite{CalibratingQubitsQiskit}.
\item Model the Hamiltonian of your system and simulate it.
\item Understand the goal of optimal control and how GRAPE works \cite{khanejaOptimalControlCoupled2005c}.
\item Select a Python GRAPE package for incorporation into Qiskit. Examples include \cite{QuantumOptimalControl, SchusterLabQuantumoptimalcontrol2020, abdelhafezGradientbasedOptimalControl2019, QuantumUtilsMathematica}.
\item Estimate the Hamiltonian of a single qubit with Qiskit Pulse \cite{alexanderNotebooksDataQiskitPulse2020b, hincksHamiltonianLearningOnline2018, sheldonProcedureSystematicallyTuning2016b}.
\item Design arbitrary single qubit gates with Grape and Qiskit Pulse and characterize the gates with quantum process tomography \cite{alexanderNotebooksDataQiskitPulse2020b}.
\item Hack automated gate design into the Qiskit compilation pipeline.
\item Write a report reviewing the relevant underlying theory, your methodology and findings performing optimal control theory with Qiskit pulse.
Include a design section proposing how to implement automated gate aggregation \cite{shiOptimizedCompilationAggregated2019b} and compilation within Qiskit and any improvements that might be required.
\item Stretch goals (in no particular order other than what would be most fun for me)

\begin{itemize}
\item Estimate the Hamiltonian for a two-qubit system and design a two-qubit gate with Qiskit Pulse and GRAPE.
\item Reduce the runtime of an Aqua application with automated gate design.
\item Design a gate aggregation pass in the Qiskit transpiler to work with your pulse designer.
\item Suggest how to improve the usability of the Qiskit Pulse simulator.
\end{itemize}
\end{itemize}

\subsection{Workflow}
Due to the nature of the situation with Covid-19 the internship will be remote.
Fortunately, this project is focused on Qiskit Pulse, which gives hardware access
through the cloud. To help facilitate work both Thomas Alexander and
Zachary Schoenfeld will be providing supervision. Ben will partcipate in the
pulse teams agile sprints, demos and board. We will hold short, daily video
calls to synchronize our work. There will also be many other remote activities
setup for interns to network and socialize through the IBM Quantum Internship
program.\\
%
\\
%
IBM Quantum intern hub: \url{https://w3.ibm.com/w3publisher/quantum-interns}.

\subsection{Approximate Timeline (Subject to Change)}

Dates: 6/5/20-8/7/20 (8 weeks) \\
\\
%
Weeks 1, 2
\begin{itemize}
\item Onboard
	\begin{itemize}
		\item Get onto w3, Slack, join standups and agile
	\end{itemize}
\item Gain familiarity with IBM's quantum systems and pulse-level control (ask for more papers!)
\item Use Qiskit pulse to calibrate a qubit on a live device
\item \textit{Suggestion}: Draft notes as you go. This will make writing the final report easier!
\end{itemize}
Weeks 3, 4
\begin{itemize}
\item Model a 1q Hamiltonian with arbitrary drive pulse and simulate its evolution
	\begin{itemize}
		\item It may also be interesting to learn how to analytically solve this Hamiltonian for simple pulses shapes (RWA, etc)
	\end{itemize}
\item Learn GRAPE and explore possible open source packages for implementation into Qiskit
\end{itemize}
Weeks 5, 6
\begin{itemize}
\item Use chosen GRAPE package and Qiskit pulse to construct arbitrary 1q gates in an optimal fashion
\item Characterize these gates with Quantum Process Tomography
\item Begin to integrate GRAPE into the Qiskit compilation pipeline
\end{itemize}
Weeks 7, 8
\begin{itemize}
\item As time permits, think about how to add gate aggregation passes \cite{shiOptimizedCompilationAggregated2019b} to your work (design is more important; can implement if time)
\item Write up a report detailing the theory you learned about optimal pulse control, GRAPE and how you implemented it in Qiskit. More details provided in the \textbf{Goals} section.
\item As time permits, work on the stretch goals outlined in the \textbf{Goals} section
\item Offboard
\end{itemize}

\bibliographystyle{unsrt}
\bibliography{bibliography}

\end{document}