# Software profesional en Acústica 2020-21 (M2i)

*This notebook contains a modification of the notebook [FEM_Helmholtz_equation](https://github.com/spatialaudio/computational_acoustics/blob/master/FEM_Helmholtz_equation.ipynb), created by Sascha Spors, Frank Schultz, Computational Acoustics Examples, 2018. The text/images are licensed under [Creative Commons Attribution 4.0](https://creativecommons.org/licenses/by/4.0/). The code is released under the [MIT license](https://opensource.org/licenses/MIT).*

# Numerical Solution of the Helmholtz Equation using the Finite Element Method

This notebook illustrates the numerical solution of the wave equation for harmonic excitation using the so called [Finite Element Method](https://en.wikipedia.org/wiki/Finite_element_method) (FEM). The method aims at an approximate solution by subdividing the area of interest into smaller parts with simpler geometry, linking these parts together and applying methods from the calculus of variations to solve the problem numerically. The FEM is a well established method for the numerical approximation of the solution of partial differential equations (PDEs). The solutions of PDEs are often known analytically only for rather simple geometries. FEM based simulations allow to gain insights into other more complex cases.

## Problem Statement

The inhomogeneous linear [wave equation](https://en.wikipedia.org/wiki/Wave_equation) is given as

\begin{equation}
\Delta p(\mathbf{x}, t) - \frac{1}{c^2} \frac{\partial^2}{\partial t^2} p(\mathbf{x}, t) = - q(\mathbf{x}, t) ,
\end{equation}

where $p(\mathbf{x}, t)$ denotes the sound pressure at position $\mathbf{x}$, $c$ the speed of sound and $q(\mathbf{x}, t)$ the inhomogeneity.
For an harmonic excitation $q(\mathbf{x}, t) = \Re \{ Q(\mathbf{x}, \omega) \mathrm{e}^{\mathrm{j} \omega t} \}$ with frequency $\omega = 2 \pi f$ we choose the Ansatz $p(\mathbf{x}, t) = \Re \{ P(\mathbf{x}, \omega) \mathrm{e}^{\mathrm{j} \omega t} \}$ for the sound pressure.
Introduction of the complex quantities into the wave equation yields

\begin{equation}
\Delta P(\mathbf{x}, \omega) \mathrm{e}^{\mathrm{j} \omega t} + \frac{\omega^2}{c^2} P(\mathbf{x}, \omega) \mathrm{e}^{\mathrm{j} \omega t} = - Q(\mathbf{x}, \omega) \mathrm{e}^{\mathrm{j} \omega t} ,
\end{equation}

and canceling out the $\mathrm{e}^{\mathrm{j} \omega t}$ terms yields the [Helmholtz equation](https://en.wikipedia.org/wiki/Helmholtz_equation)

\begin{equation}
\Delta P(\mathbf{x}, \omega) + \frac{\omega^2}{c^2} P(\mathbf{x}, \omega) = - Q(\mathbf{x}, \omega) .
\end{equation}

We aim for a numerical solution of the Helmholtz equation on the domain $V$ with respect to the homogeneous Dirichlet boundary condition

\begin{equation}
P(\mathbf{x}, \omega) = 0 \qquad \text{for } x \in \partial V
\end{equation}

or the homogeneous Neumann boundary condition

\begin{equation}
\frac{\partial}{\partial n} P(\mathbf{x}, \omega) = 0 \qquad \text{for } x \in \partial V ,
\end{equation}

where $\partial V $ denotes the boundary of $V$.

## Variational Formulation

The FEM is based on expressing the partial differential equation (PDE) to be solved in its [variational](https://en.wikipedia.org/wiki/Calculus_of_variations) or weak form.
The first step towards this formulation is to multiply the Helmholtz equation by the test function $V(\mathbf{x}, \omega)$

\begin{equation}
\Delta P(\mathbf{x}, \omega) \cdot V(\mathbf{x}, \omega)  + \frac{\omega^2}{c^2} P(\mathbf{x}, \omega) \cdot V(\mathbf{x}, \omega) = - Q(\mathbf{x}, \omega) \cdot V(\mathbf{x}, \omega) ,
\end{equation}

followed by integration over the domain $V$

\begin{equation}
\int_V \Delta P(\mathbf{x}, \omega) \cdot V(\mathbf{x}, \omega) \mathrm{d}x  + \frac{\omega^2}{c^2} \int_V P(\mathbf{x}, \omega) \cdot V(\mathbf{x}, \omega) \mathrm{d}x = - \int_V Q(\mathbf{x}, \omega) \cdot V(\mathbf{x}, \omega) \mathrm{d}x ,
\end{equation}

where $\mathrm{d}x$ denotes a suitably chosen differential element for integration.
Application of [Green's first identity](https://en.wikipedia.org/wiki/Green%27s_identities) yields

\begin{equation}
{-} \int_V \nabla P(\mathbf{x}, \omega) \cdot \nabla V(\mathbf{x}, \omega) \mathrm{d}x  + \int_{\partial V} V(\mathbf{x}, \omega) \frac{\partial}{\partial n}  P(\mathbf{x}, \omega) \mathrm{d}s + \frac{\omega^2}{c^2} \int_V P(\mathbf{x}, \omega) V(\mathbf{x}, \omega) \mathrm{d}x = - \int_V Q(\mathbf{x}, \omega) V(\mathbf{x}, \omega) \mathrm{d}x .
\end{equation}

This way the differential order of the first integral is lowered which is advisable for application of the FEM.
The second integral vanishes as

* the variation formulation requires $V(\mathbf{x}, \omega) = 0$ on $\partial V$ where $P(\mathbf{x}, \omega)$ is known - here by the pure Dirichlet boundary condition - or
* due to a pure homogeneous Neumann boundary condition $\frac{\partial}{\partial n} P(\mathbf{x}, \omega)$ on $\partial V$.

This results in the variational/weak formulation of the Helmholtz equation

\begin{equation}
{-} \int_V \nabla P(\mathbf{x}, \omega) \cdot \nabla V(\mathbf{x}, \omega) \mathrm{d}x  + \frac{\omega^2}{c^2} \int_V P(\mathbf{x}, \omega) V(\mathbf{x}, \omega) \mathrm{d}x = - \int_V Q(\mathbf{x}, \omega) V(\mathbf{x}, \omega) \mathrm{d}x .
\end{equation}

It is common to express the integral equation above in terms of the bilinear $a(P, V)$ and linear $L(V)$ forms

\begin{equation}
a(P, V) = \frac{\omega^2}{c^2} \int_V P(\mathbf{x}, \omega) V(\mathbf{x}, \omega) \mathrm{d}x - \int_V \nabla P(\mathbf{x}, \omega) \cdot \nabla V(\mathbf{x}, \omega) \mathrm{d}x ,
\end{equation}

\begin{equation}
L(V) = - \int_V Q(\mathbf{x}, \omega) V(\mathbf{x}, \omega) \mathrm{d}x ,
\end{equation}

where

\begin{equation}
a(P, V) = L(V) .
\end{equation}

## Numerical Solution

The numerical solution of the variational problem is based on [FEniCS](https://fenicsproject.org/), an open-source framework for numerical solution of PDEs.
Its high-level Python interface `dolfin` is used in the following to define the problem and compute its solution.
The implementation is based on the variational formulation derived above.
It is common in the FEM to denote the solution of the problem by $u$ and the test function by $v$.
The definition of the problem in FEniCS is very close to the mathematical formulation of the problem.
We limit ourselves to real-valued $P(\mathbf{x}, \omega)$ due to the assumption of Dirichlet or Neumann boundary conditions.

For the subsequent examples the solution of the inhomogeneous wave equation for a point source $Q(\mathbf{x}) = \delta(\mathbf{x}-\mathbf{x_s})$ at position $\mathbf{x_s}$ is computed using the FEM.
A function is defined for this purpose, accompanied by a plotting routine for the resulting sound field.

```python
import dolfin
import mshr
import matplotlib.pyplot as plt
%matplotlib inline

def FEM_Helmholtz(mesh, frequency, xs, neumann_bc=True, c=343):
    '''numerical solution of the Helmholtz equation using the FEM'''

    # squared wavenumber
    k2 = dolfin.Constant(2*dolfin.pi*frequency/c)**2

    # define function space
    V = dolfin.FunctionSpace(mesh, "CG", 2)

    # define boundary conditions
    if neumann_bc:
        bcs = None
    else:
        bcs = dolfin.DirichletBC(V, dolfin.Constant(0), "on_boundary")

    # define variational problem
    u = dolfin.TrialFunction(V)
    v = dolfin.TestFunction(V)

    a = k2 * dolfin.inner(u, v) * dolfin.dx - dolfin.inner(dolfin.nabla_grad(u), dolfin.nabla_grad(v)) * dolfin.dx
    L = dolfin.Constant(0) * v * dolfin.dx

    A, b = dolfin.assemble_system(a, L, bcs)

    # define inhomogenity
    delta = dolfin.PointSource(V, xs, -1)  # to account for negative sign in inhomogeneity
    delta.apply(b)

    # compute solution
    u = dolfin.Function(V)
    dolfin.solve(A, u.vector(), b)

    return u

def plot_soundfield(u):
    '''plot solution of FEM-based simulation'''
    fig = plt.figure(figsize=(10,10))
    fig = dolfin.plot(u)
    plt.title(r'$P(\mathbf{x}, \omega)$')
    plt.xlabel(r'$x$ / m')
    plt.ylabel(r'$y$ / m')
    plt.colorbar(fig, fraction=0.038, pad=0.04);
```

### Sound Field in a Rectangular Room with Sound-Hard Boundaries

The two-dimensional sound field in a rectangular room whose height is very small compared to the wavelength and with rigid boundaries (Neumann boundary condition) is computed for the frequency $f=120$ Hz and source position $x_s = (1.2,3.2)$ m.

```python
# define geometry and mesh
mesh = dolfin.RectangleMesh(dolfin.Point(0,0), dolfin.Point(5,4), 200, 200, "right/left")

# compute solution
u = FEM_Helmholtz(mesh, 120, dolfin.Point(1.2,3.2))

# plot sound field
plot_soundfield(u)
plot_soundfield(abs(u))
plt.title(r'$|P(\mathbf{x}, \omega)|$');
```

### Sound Field in Two Coupled Rectangular Rooms

The two-dimensional sound field in two coupled rectangular rooms with sound-hard boundaries (Neumann boundary condition) is computed for the frequency $f=120$ Hz and source position $x_s = (2,0.5)$ m. First the geometry is defined and plotted, for which the mesh is generated with a low number of elements for ease of illustration. A higher resolution is then used for the simulations.

```python
# define geometry and mesh
domain = mshr.Rectangle(dolfin.Point(0, 0), dolfin.Point(3,4)) + \
         mshr.Rectangle(dolfin.Point(3, 1.5), dolfin.Point(3.5, 2.5)) + \
         mshr.Rectangle(dolfin.Point(3.5, 0), dolfin.Point(6, 4))
mesh2 = mshr.generate_mesh(domain, 20)

dolfin.plot(mesh2);
```

```python
# compute solution
mesh2 = mshr.generate_mesh(domain, 100)
u = FEM_Helmholtz(mesh2, 120, dolfin.Point(2, .5))

# plot sound field
plot_soundfield(u)
plot_soundfield(abs(u))
plt.title(r'$|P(\mathbf{x}, \omega)|$');
```

**Copyright**

This notebook is provided as [Open Educational Resource](https://en.wikipedia.org/wiki/Open_educational_resources). Feel free to use the notebook for your own purposes. The text is licensed under [Creative Commons Attribution 4.0](https://creativecommons.org/licenses/by/4.0/), the code of the IPython examples under the [MIT license](https://opensource.org/licenses/MIT).


```python
from scipy import signal
from scipy.signal import freqs
import numpy as np  #Importa libreria numerica
import sympy as sym #simbolica
import matplotlib.pyplot as plt #importa matplotlib solo pyplot

sym.init_printing() #activa a jupyter para mostrar simbolicamente el output
%matplotlib widget
```

```python
# Parametros de Entrada
FS=5000*10;
fp=[800, 1250]; #Banda de Paso [Hz]
fs=[200, 5000]; #Banda de Rechazo [Hz]
Wp=np.dot(2*np.pi,fp); #Banda de Paso [rad/s]
Ws=np.dot(2*np.pi,fs); #Banda de Rechazo [rad/s]
Ap=0.25; #Atenuacion maxima en Banda de Paso [dB]
As=30; #%Atenuacion minima en Banda de Rechazo [dB]

```

```python
N, Wn = signal.cheb1ord(Wp, Ws, Ap, As, analog=True)
b, a = signal.cheby1(N, Ap, Wn, btype='bandpass', analog=True)
w, h = signal.freqs(b, a)
```

```python
Filtro=signal.TransferFunction(b,a) #Funcion de transferencia calculada
#Implementacion como PasaAlto/PasaBajo
sos = signal.cheby1(N, Ap, Wn, btype='bandpass', output='sos', analog=True)
PasaBajo=signal.TransferFunction(2*sos[0,:3],sos[0,3:])
PasaAlto=signal.TransferFunction(1/2*sos[1,:3],sos[1,3:])
```

```python
plt.figure()
plt.semilogx(w, 20 * np.log10(abs(h)))
plt.title('Chebyshev I ')
plt.xlabel('Frecuencia [rad/seg]')
plt.ylabel('Amplitud [dB]')
plt.grid(which='both', axis='both')
plt.show()
```

    Canvas(toolbar=Toolbar(toolitems=[('Home', 'Reset original view', 'home', 'home'), ('Back', 'Back to previous …

```python

```

    TransferFunctionContinuous(
    array([16420899.35090685,        0.        ,        0.        ]),
    array([1.00000000e+00, 5.08000167e+03, 9.58572335e+07, 2.00550427e+11,
           1.55854546e+15]),
    dt: None
    )

```python
PasaAlto
```

    TransferFunctionContinuous(
    array([0.5, 0. , 0. ]),
    array([1.00000000e+00, 1.89557535e+03, 2.35000932e+07]),
    dt: None
    )

```python
PasaBajo
```

    TransferFunctionContinuous(
    array([32841798.70181369,        0.        ,        0.        ]),
    array([1.00000000e+00, 3.18442632e+03, 6.63208202e+07]),
    dt: None
    )


```python
# ref https://www.coder.work/article/5024474

from sympy.diffgeom import Manifold, Patch, CoordSystem, TensorProduct
# from sympy.abc import theta, eta, psi
import sympy as sym

x,y,z,a = sym.symbols("x y z a")
m = Manifold("M",3)
patch = Patch("P",m)

cartesian = CoordSystem("cartesian",patch)
# toroidal = CoordSystem("toroidal",patch)
toroidal = CoordSystem("toroidal", patch, ["eta", "theta", "psi"])
eta, theta, phi = toroidal.coord_functions()

from sympy import sin,cos,sinh,cosh
toroidal.connect_to(cartesian,[eta,theta,psi],
[(a*sinh(eta)*cos(psi))/(cosh(eta) - cos(theta)),
 (a*sinh(eta)*sin(psi))/(cosh(eta) - cos(theta)),
 (a*sin(theta))/(cosh(eta) - cos(theta))],inverse=False)

g = sym.Matrix([[a**2/(cos(theta) - cosh(eta))**2,        0,           0],
                [0,           a**2/(cos(theta) - cosh(eta)),           0],
                [0,   0,   a**2*sinh(eta)**2/(cos(theta) - cosh(eta))**2]])

diff_forms = toroidal.base_oneforms()
metric_diff_form = sum([TensorProduct(di, dj)*g[i, j] for i, di in enumerate(diff_forms) for j, dj in enumerate(diff_forms)])

from sympy.diffgeom import metric_to_Riemann_components
metric_to_Riemann_components(metric_diff_form)
```

$\displaystyle \left[\begin{matrix}\left[\begin{matrix}0 & 0 & 0\\0 & 0 & 0\\0 & 0 & 0\end{matrix}\right] & \left[\begin{matrix}0 & \frac{a^{2} \left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right) \left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sin{\left(\mathbf{\theta} \right)}}{4 \left(\cos{\left(\mathbf{\theta} \right)} - \cosh{\left(\mathbf{\eta} \right)}\right)^{2} \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)} + \frac{a^{2} \left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right) \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{4 \left(\cos{\left(\mathbf{\theta} \right)} - \cosh{\left(\mathbf{\eta} \right)}\right)^{4}} - \frac{3 \left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right)^{2}}{4 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} - \frac{\left(- 2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} + 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh{\left(\mathbf{\eta} \right)}}{2 \left(\cos{\left(\mathbf{\theta} \right)} - \cosh{\left(\mathbf{\eta} \right)}\right)^{2}} - \frac{\left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh{\left(\mathbf{\eta} \right)}}{4 \left(\cos{\left(\mathbf{\theta} \right)} - \cosh{\left(\mathbf{\eta} \right)}\right)^{2}} - \frac{- 2 \sin^{2}{\left(\mathbf{\theta} \right)} + 2 \cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)} - \frac{\left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right) \cosh{\left(\mathbf{\eta} \right)}}{2 \left(\cos{\left(\mathbf{\theta} \right)} - \cosh{\left(\mathbf{\eta} \right)}\right)^{2}} - \frac{\left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{\left(\cos{\left(\mathbf{\theta} \right)} - \cosh{\left(\mathbf{\eta} \right)}\right)^{3}} & 0\\- \frac{a^{2} \left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right) \left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sin{\left(\mathbf{\theta} \right)}}{4 \left(\cos{\left(\mathbf{\theta} \right)} - \cosh{\left(\mathbf{\eta} \right)}\right)^{2} \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)} - \frac{a^{2} \left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right) \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{4 \left(\cos{\left(\mathbf{\theta} \right)} - \cosh{\left(\mathbf{\eta} \right)}\right)^{4}} + \frac{3 \left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right)^{2}}{4 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} + \frac{\left(- 2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} + 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh{\left(\mathbf{\eta} \right)}}{2 \left(\cos{\left(\mathbf{\theta} \right)} - \cosh{\left(\mathbf{\eta} \right)}\right)^{2}} + \frac{\left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh{\left(\mathbf{\eta} \right)}}{4 \left(\cos{\left(\mathbf{\theta} \right)} - \cosh{\left(\mathbf{\eta} \right)}\right)^{2}} + \frac{- 2 \sin^{2}{\left(\mathbf{\theta} \right)} + 2 \cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)} + \frac{\left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right) \cosh{\left(\mathbf{\eta} \right)}}{2 \left(\cos{\left(\mathbf{\theta} \right)} - \cosh{\left(\mathbf{\eta} \right)}\right)^{2}} + \frac{\left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{\left(\cos{\left(\mathbf{\theta} \right)} - \cosh{\left(\mathbf{\eta} \right)}\right)^{3}} & 0 & 0\\0 & 0 & 0\end{matrix}\right] & \left[\begin{matrix}0 & 0 & - \frac{a^{2} \left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right) \left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right)^{2} \sinh^{2}{\left(\mathbf{\eta} \right)}}{4 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{3}} + \frac{\left(- 2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} + 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \left(- \frac{a^{2} \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} - \frac{a^{2} \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}}{\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}}\right)}{a^{2}} + \frac{\left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \left(- \frac{a^{2} \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} - \frac{a^{2} \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}}{\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}}\right)}{2 a^{2}} + \frac{\left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right) \left(- \frac{a^{2} \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \left(4 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 4 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{3}} - \frac{2 a^{2} \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}}{\left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} - \frac{a^{2} \left(2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} - 2 \sinh^{2}{\left(\mathbf{\eta} \right)} - 2 \cosh^{2}{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} - \frac{a^{2} \sinh^{2}{\left(\mathbf{\eta} \right)}}{\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}} - \frac{a^{2} \cosh^{2}{\left(\mathbf{\eta} \right)}}{\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}}\right)}{a^{2}} - \frac{\left(- \frac{a^{2} \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} - \frac{a^{2} \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}}{\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}}\right) \left(\frac{a^{2} \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} + \frac{a^{2} \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}}{\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}}\right) \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}}{a^{4} \sinh^{2}{\left(\mathbf{\eta} \right)}}\\0 & 0 & \frac{a^{2} \left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right) \left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{3}{\left(\mathbf{\eta} \right)}}{4 \left(\cos{\left(\mathbf{\theta} \right)} - \cosh{\left(\mathbf{\eta} \right)}\right)^{2} \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)} + \frac{\left(- 2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} + 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \left(- \frac{a^{2} \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} - \frac{a^{2} \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}}{\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}}\right)}{a^{2}} + \frac{\left(- \frac{a^{2} \left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}}{\left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} - \frac{a^{2} \left(4 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 4 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{3}} + \frac{a^{2} \sin{\left(\mathbf{\theta} \right)} \sinh^{3}{\left(\mathbf{\eta} \right)}}{\left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}}\right) \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)}{a^{2}}\\\frac{a^{2} \left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right) \left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right)^{2} \sinh^{2}{\left(\mathbf{\eta} \right)}}{4 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{3}} - \frac{\left(- 2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} + 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \left(- \frac{a^{2} \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} - \frac{a^{2} \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}}{\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}}\right)}{a^{2}} - \frac{\left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \left(- \frac{a^{2} \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} - \frac{a^{2} \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}}{\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}}\right)}{2 a^{2}} - \frac{\left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right) \left(- \frac{a^{2} \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \left(4 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 4 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{3}} - \frac{2 a^{2} \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}}{\left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} - \frac{a^{2} \left(2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} - 2 \sinh^{2}{\left(\mathbf{\eta} \right)} - 2 \cosh^{2}{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} - \frac{a^{2} \sinh^{2}{\left(\mathbf{\eta} \right)}}{\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}} - \frac{a^{2} \cosh^{2}{\left(\mathbf{\eta} \right)}}{\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}}\right)}{a^{2}} + \frac{\left(- \frac{a^{2} \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} - \frac{a^{2} \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}}{\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}}\right) \left(\frac{a^{2} \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} + \frac{a^{2} \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}}{\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}}\right) \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}}{a^{4} \sinh^{2}{\left(\mathbf{\eta} \right)}} & - \frac{a^{2} \left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right) \left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{3}{\left(\mathbf{\eta} \right)}}{4 \left(\cos{\left(\mathbf{\theta} \right)} - \cosh{\left(\mathbf{\eta} \right)}\right)^{2} \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)} - \frac{\left(- 2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} + 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \left(- \frac{a^{2} \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} - \frac{a^{2} \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}}{\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}}\right)}{a^{2}} - \frac{\left(- \frac{a^{2} \left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}}{\left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} - \frac{a^{2} \left(4 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 4 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{3}} + \frac{a^{2} \sin{\left(\mathbf{\theta} \right)} \sinh^{3}{\left(\mathbf{\eta} \right)}}{\left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}}\right) \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)}{a^{2}} & 0\end{matrix}\right]\\\left[\begin{matrix}0 & \frac{a^{4} \left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right)^{2} \left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sin{\left(\mathbf{\theta} \right)}}{4 \left(\cos{\left(\mathbf{\theta} \right)} - \cosh{\left(\mathbf{\eta} \right)}\right)^{2} \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} + \frac{a^{4} \left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right)^{2} \sinh^{2}{\left(\mathbf{\eta} \right)}}{4 \left(\cos{\left(\mathbf{\theta} \right)} - \cosh{\left(\mathbf{\eta} \right)}\right)^{4}} - \frac{a^{2} \left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right) \left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right)^{2}}{4 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{3}} + \frac{a^{2} \left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right) \left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \left(4 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 4 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right)}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{3}} - \frac{a^{2} \left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right) \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh{\left(\mathbf{\eta} \right)}}{4 \left(\cos{\left(\mathbf{\theta} \right)} - \cosh{\left(\mathbf{\eta} \right)}\right)^{2} \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)} + \frac{a^{2} \left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right) \left(- 2 \sin^{2}{\left(\mathbf{\theta} \right)} + 2 \cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right)}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} + \frac{a^{2} \left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right) \cosh{\left(\mathbf{\eta} \right)}}{2 \left(\cos{\left(\mathbf{\theta} \right)} - \cosh{\left(\mathbf{\eta} \right)}\right)^{2}} + \frac{a^{2} \left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{\left(\cos{\left(\mathbf{\theta} \right)} - \cosh{\left(\mathbf{\eta} \right)}\right)^{3}} - \frac{\left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sin{\left(\mathbf{\theta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} - \frac{\sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos{\left(\mathbf{\theta} \right)} - \cosh{\left(\mathbf{\eta} \right)}\right)^{2}} & 0\\- \frac{a^{4} \left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right)^{2} \left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sin{\left(\mathbf{\theta} \right)}}{4 \left(\cos{\left(\mathbf{\theta} \right)} - \cosh{\left(\mathbf{\eta} \right)}\right)^{2} \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} - \frac{a^{4} \left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right)^{2} \sinh^{2}{\left(\mathbf{\eta} \right)}}{4 \left(\cos{\left(\mathbf{\theta} \right)} - \cosh{\left(\mathbf{\eta} \right)}\right)^{4}} + \frac{a^{2} \left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right) \left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right)^{2}}{4 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{3}} - \frac{a^{2} \left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right) \left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \left(4 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 4 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right)}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{3}} + \frac{a^{2} \left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right) \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh{\left(\mathbf{\eta} \right)}}{4 \left(\cos{\left(\mathbf{\theta} \right)} - \cosh{\left(\mathbf{\eta} \right)}\right)^{2} \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)} - \frac{a^{2} \left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right) \left(- 2 \sin^{2}{\left(\mathbf{\theta} \right)} + 2 \cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right)}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} - \frac{a^{2} \left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right) \cosh{\left(\mathbf{\eta} \right)}}{2 \left(\cos{\left(\mathbf{\theta} \right)} - \cosh{\left(\mathbf{\eta} \right)}\right)^{2}} - \frac{a^{2} \left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{\left(\cos{\left(\mathbf{\theta} \right)} - \cosh{\left(\mathbf{\eta} \right)}\right)^{3}} + \frac{\left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sin{\left(\mathbf{\theta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} + \frac{\sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos{\left(\mathbf{\theta} \right)} - \cosh{\left(\mathbf{\eta} \right)}\right)^{2}} & 0 & 0\\0 & 0 & 0\end{matrix}\right] & \left[\begin{matrix}0 & 0 & 0\\0 & 0 & 0\\0 & 0 & 0\end{matrix}\right] & \left[\begin{matrix}0 & 0 & - \frac{a^{4} \left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right)^{2} \left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{3}{\left(\mathbf{\eta} \right)}}{4 \left(\cos{\left(\mathbf{\theta} \right)} - \cosh{\left(\mathbf{\eta} \right)}\right)^{2} \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} - \frac{a^{2} \left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right) \left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \left(4 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 4 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{3}} - \frac{a^{2} \left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right) \left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}}{\left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} + \frac{a^{2} \left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right) \sin{\left(\mathbf{\theta} \right)} \sinh^{3}{\left(\mathbf{\eta} \right)}}{\left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} - \frac{\left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right) \left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \left(- \frac{a^{2} \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} - \frac{a^{2} \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}}{\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}}\right)}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)} + \frac{\left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right) \left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \left(\frac{a^{2} \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} + \frac{a^{2} \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}}{\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}}\right)}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)} + \frac{\left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{3}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}}\\0 & 0 & - \frac{a^{4} \left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right)^{2} \left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sin{\left(\mathbf{\theta} \right)} \sinh^{2}{\left(\mathbf{\eta} \right)}}{4 \left(\cos{\left(\mathbf{\theta} \right)} - \cosh{\left(\mathbf{\eta} \right)}\right)^{2} \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} + \frac{a^{2} \left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right) \left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right)^{2} \sinh^{2}{\left(\mathbf{\eta} \right)}}{4 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{3}} - \frac{a^{2} \left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right) \left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \left(4 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 4 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{3}} - \frac{a^{2} \left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right) \left(- 2 \sin^{2}{\left(\mathbf{\theta} \right)} + 2 \cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} + \frac{\left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right) \left(- \frac{a^{2} \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} - \frac{a^{2} \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}}{\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}}\right) \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right) \sinh{\left(\mathbf{\eta} \right)}}{2 \left(\cos{\left(\mathbf{\theta} \right)} - \cosh{\left(\mathbf{\eta} \right)}\right)^{2}} + \frac{\left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sin{\left(\mathbf{\theta} \right)} \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}}\\\frac{a^{4} \left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right)^{2} \left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{3}{\left(\mathbf{\eta} \right)}}{4 \left(\cos{\left(\mathbf{\theta} \right)} - \cosh{\left(\mathbf{\eta} \right)}\right)^{2} \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} + \frac{a^{2} \left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right) \left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \left(4 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 4 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{3}} + \frac{a^{2} \left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right) \left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}}{\left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} - \frac{a^{2} \left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right) \sin{\left(\mathbf{\theta} \right)} \sinh^{3}{\left(\mathbf{\eta} \right)}}{\left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} + \frac{\left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right) \left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \left(- \frac{a^{2} \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} - \frac{a^{2} \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}}{\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}}\right)}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)} - \frac{\left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right) \left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \left(\frac{a^{2} \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} + \frac{a^{2} \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}}{\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}}\right)}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)} - \frac{\left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{3}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} & \frac{a^{4} \left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right)^{2} \left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sin{\left(\mathbf{\theta} \right)} \sinh^{2}{\left(\mathbf{\eta} \right)}}{4 \left(\cos{\left(\mathbf{\theta} \right)} - \cosh{\left(\mathbf{\eta} \right)}\right)^{2} \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} - \frac{a^{2} \left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right) \left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right)^{2} \sinh^{2}{\left(\mathbf{\eta} \right)}}{4 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{3}} + \frac{a^{2} \left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right) \left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \left(4 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 4 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{3}} + \frac{a^{2} \left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right) \left(- 2 \sin^{2}{\left(\mathbf{\theta} \right)} + 2 \cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} - \frac{\left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right) \left(- \frac{a^{2} \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} - \frac{a^{2} \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}}{\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}}\right) \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right) \sinh{\left(\mathbf{\eta} \right)}}{2 \left(\cos{\left(\mathbf{\theta} \right)} - \cosh{\left(\mathbf{\eta} \right)}\right)^{2}} - \frac{\left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sin{\left(\mathbf{\theta} \right)} \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} & 0\end{matrix}\right]\\\left[\begin{matrix}0 & 0 & \frac{a^{2} \left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right) \left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right)^{2}}{4 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{3}} + \frac{\left(- 2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} + 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \left(\frac{a^{2} \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} + \frac{a^{2} \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}}{\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}}\right)}{a^{2} \sinh^{2}{\left(\mathbf{\eta} \right)}} - \frac{\left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \left(\frac{a^{2} \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} + \frac{a^{2} \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}}{\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}}\right)}{2 a^{2} \sinh^{2}{\left(\mathbf{\eta} \right)}} - \frac{2 \left(\frac{a^{2} \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} + \frac{a^{2} \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}}{\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}}\right) \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right) \cosh{\left(\mathbf{\eta} \right)}}{a^{2} \sinh^{3}{\left(\mathbf{\eta} \right)}} + \frac{\left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right) \left(\frac{a^{2} \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \left(4 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 4 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{3}} + \frac{2 a^{2} \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}}{\left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} + \frac{a^{2} \left(2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} - 2 \sinh^{2}{\left(\mathbf{\eta} \right)} - 2 \cosh^{2}{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} + \frac{a^{2} \sinh^{2}{\left(\mathbf{\eta} \right)}}{\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}} + \frac{a^{2} \cosh^{2}{\left(\mathbf{\eta} \right)}}{\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}}\right)}{a^{2} \sinh^{2}{\left(\mathbf{\eta} \right)}} + \frac{\left(\frac{a^{2} \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} + \frac{a^{2} \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}}{\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}}\right)^{2} \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}}{a^{4} \sinh^{4}{\left(\mathbf{\eta} \right)}}\\0 & 0 & - \frac{a^{2} \left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right) \left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh{\left(\mathbf{\eta} \right)}}{4 \left(\cos{\left(\mathbf{\theta} \right)} - \cosh{\left(\mathbf{\eta} \right)}\right)^{2} \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)} + \frac{\left(- 2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} + 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \left(\frac{a^{2} \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} + \frac{a^{2} \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}}{\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}}\right)}{a^{2} \sinh^{2}{\left(\mathbf{\eta} \right)}} + \frac{\left(\frac{a^{2} \left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}}{\left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} + \frac{a^{2} \left(4 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 4 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{3}} - \frac{a^{2} \sin{\left(\mathbf{\theta} \right)} \sinh^{3}{\left(\mathbf{\eta} \right)}}{\left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}}\right) \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)}{a^{2} \sinh^{2}{\left(\mathbf{\eta} \right)}}\\- \frac{a^{2} \left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right) \left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right)^{2}}{4 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{3}} - \frac{\left(- 2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} + 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \left(\frac{a^{2} \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} + \frac{a^{2} \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}}{\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}}\right)}{a^{2} \sinh^{2}{\left(\mathbf{\eta} \right)}} + \frac{\left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \left(\frac{a^{2} \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} + \frac{a^{2} \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}}{\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}}\right)}{2 a^{2} \sinh^{2}{\left(\mathbf{\eta} \right)}} + \frac{2 \left(\frac{a^{2} \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} + \frac{a^{2} \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}}{\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}}\right) \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right) \cosh{\left(\mathbf{\eta} \right)}}{a^{2} \sinh^{3}{\left(\mathbf{\eta} \right)}} - \frac{\left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right) \left(\frac{a^{2} \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \left(4 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 4 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{3}} + \frac{2 a^{2} \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}}{\left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} + \frac{a^{2} \left(2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} - 2 \sinh^{2}{\left(\mathbf{\eta} \right)} - 2 \cosh^{2}{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} + \frac{a^{2} \sinh^{2}{\left(\mathbf{\eta} \right)}}{\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}} + \frac{a^{2} \cosh^{2}{\left(\mathbf{\eta} \right)}}{\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}}\right)}{a^{2} \sinh^{2}{\left(\mathbf{\eta} \right)}} - \frac{\left(\frac{a^{2} \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} + \frac{a^{2} \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}}{\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}}\right)^{2} \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}}{a^{4} \sinh^{4}{\left(\mathbf{\eta} \right)}} & \frac{a^{2} \left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right) \left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh{\left(\mathbf{\eta} \right)}}{4 \left(\cos{\left(\mathbf{\theta} \right)} - \cosh{\left(\mathbf{\eta} \right)}\right)^{2} \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)} - \frac{\left(- 2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} + 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \left(\frac{a^{2} \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} + \frac{a^{2} \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}}{\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}}\right)}{a^{2} \sinh^{2}{\left(\mathbf{\eta} \right)}} - \frac{\left(\frac{a^{2} \left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}}{\left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} + \frac{a^{2} \left(4 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 4 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{3}} - \frac{a^{2} \sin{\left(\mathbf{\theta} \right)} \sinh^{3}{\left(\mathbf{\eta} \right)}}{\left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}}\right) \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)}{a^{2} \sinh^{2}{\left(\mathbf{\eta} \right)}} & 0\end{matrix}\right] & \left[\begin{matrix}0 & 0 & - \frac{a^{2} \left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right) \left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh{\left(\mathbf{\eta} \right)}}{4 \left(\cos{\left(\mathbf{\theta} \right)} - \cosh{\left(\mathbf{\eta} \right)}\right)^{2} \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)} + \frac{\left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right)}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} - \frac{\sin{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)}}{\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}}\\0 & 0 & - \frac{a^{2} \left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right) \left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sin{\left(\mathbf{\theta} \right)}}{4 \left(\cos{\left(\mathbf{\theta} \right)} - \cosh{\left(\mathbf{\eta} \right)}\right)^{2} \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)} + \frac{3 \left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right)^{2}}{4 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} + \frac{- 2 \sin^{2}{\left(\mathbf{\theta} \right)} + 2 \cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)} + \frac{\left(\frac{a^{2} \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} + \frac{a^{2} \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}}{\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}}\right) \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}}{2 a^{2} \left(\cos{\left(\mathbf{\theta} \right)} - \cosh{\left(\mathbf{\eta} \right)}\right)^{2} \sinh{\left(\mathbf{\eta} \right)}}\\\frac{a^{2} \left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right) \left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh{\left(\mathbf{\eta} \right)}}{4 \left(\cos{\left(\mathbf{\theta} \right)} - \cosh{\left(\mathbf{\eta} \right)}\right)^{2} \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)} - \frac{\left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right)}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} + \frac{\sin{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)}}{\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}} & \frac{a^{2} \left(\frac{\cos{\left(\mathbf{\theta} \right)}}{a^{2}} - \frac{\cosh{\left(\mathbf{\eta} \right)}}{a^{2}}\right) \left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sin{\left(\mathbf{\theta} \right)}}{4 \left(\cos{\left(\mathbf{\theta} \right)} - \cosh{\left(\mathbf{\eta} \right)}\right)^{2} \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)} - \frac{3 \left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right)^{2}}{4 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} - \frac{- 2 \sin^{2}{\left(\mathbf{\theta} \right)} + 2 \cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)} - \frac{\left(\frac{a^{2} \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} + \frac{a^{2} \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}}{\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}}\right) \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}}{2 a^{2} \left(\cos{\left(\mathbf{\theta} \right)} - \cosh{\left(\mathbf{\eta} \right)}\right)^{2} \sinh{\left(\mathbf{\eta} \right)}} & 0\end{matrix}\right] & \left[\begin{matrix}0 & \frac{\left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right)}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} - \frac{\sin{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)}}{\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}} - \frac{\left(- 2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} + 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \left(\frac{a^{2} \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} + \frac{a^{2} \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}}{\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}}\right)}{a^{2} \sinh^{2}{\left(\mathbf{\eta} \right)}} - \frac{\left(\frac{a^{2} \left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}}{\left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} + \frac{a^{2} \left(4 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 4 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{3}} - \frac{a^{2} \sin{\left(\mathbf{\theta} \right)} \sinh^{3}{\left(\mathbf{\eta} \right)}}{\left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}}\right) \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)}{a^{2} \sinh^{2}{\left(\mathbf{\eta} \right)}} & 0\\- \frac{\left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right)}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} + \frac{\sin{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)}}{\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}} + \frac{\left(- 2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} + 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \left(\frac{a^{2} \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} + \frac{a^{2} \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}}{\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}}\right)}{a^{2} \sinh^{2}{\left(\mathbf{\eta} \right)}} + \frac{\left(\frac{a^{2} \left(2 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 2 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}}{\left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}} + \frac{a^{2} \left(4 \sin{\left(\mathbf{\theta} \right)} \cos{\left(\mathbf{\theta} \right)} - 4 \sin{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \left(2 \cos{\left(\mathbf{\theta} \right)} \sinh{\left(\mathbf{\eta} \right)} - 2 \sinh{\left(\mathbf{\eta} \right)} \cosh{\left(\mathbf{\eta} \right)}\right) \sinh^{2}{\left(\mathbf{\eta} \right)}}{2 \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{3}} - \frac{a^{2} \sin{\left(\mathbf{\theta} \right)} \sinh^{3}{\left(\mathbf{\eta} \right)}}{\left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)^{2}}\right) \left(\cos^{2}{\left(\mathbf{\theta} \right)} - 2 \cos{\left(\mathbf{\theta} \right)} \cosh{\left(\mathbf{\eta} \right)} + \cosh^{2}{\left(\mathbf{\eta} \right)}\right)}{a^{2} \sinh^{2}{\left(\mathbf{\eta} \right)}} & 0 & 0\\0 & 0 & 0\end{matrix}\right]\end{matrix}\right]$


# FATE-Ranking

```python
import warnings
warnings.filterwarnings('ignore')
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
from csrank import FATEObjectRanker
```

    Using TensorFlow backend.

## The medoid problem

```python
from csrank import SyntheticDatasetGenerator
```

In the medoid problem the goal of the learner is to sort a set of randomly generated points based on their distance to the _medoid_.
This problem is inspired by the setting of ranking similarity learning, where the goal is to learn a similarity function from triplets of objects.

We will generate a random dataset where each instance contains 5 objects and 2 features for easy plotting.

```python
seed = 123
n_train = 10000
n_test = 10000
n_features = 2
n_objects = 5
gen = SyntheticDatasetGenerator(dataset_type='medoid', random_state=seed,
                                n_train_instances=n_train,
                                n_test_instances=n_test,
                                n_objects=n_objects,
                                n_features=n_features)
```

```python
X_train, Y_train, X_test, Y_test = gen.get_single_train_test_split()
```

Let us plot a random instance. The points are ranked by distance to the medoid. The medoid itself gets always gets the index 0.

```python
fig, ax = plt.subplots(figsize=(5,5))
inst = np.random.choice(n_train)
ax.scatter(X_train[inst][:, 0], X_train[inst][:, 1])
for i in range(n_objects):
    ax.text(X_train[inst, i, 0]+0.01,
            X_train[inst, i, 1]+0.01,
            s=int(Y_train[inst, i]))
```

## The FATE network
The first-aggregate-then-evaluate approach learns an embedding of each object and then aggregates that into a _context_:
\begin{equation}
	\mu_{C(\vec{x})} = \frac{1}{|C(\vec{x})|} \sum_{\vec{y} \in C(\vec{x})} \phi(\vec{y})
\end{equation}
and then scores each object $\vec{x}$ using a generalized utility function $U (\vec{x}, \mu_{C(\vec{x})})$

```python
from keras.optimizers import SGD
from csrank import FATEObjectRanker
from csrank.losses import smooth_rank_loss
fate = FATEObjectRanker(
    n_object_features=n_features,
    loss_function=smooth_rank_loss,
    optimizer=SGD(lr=1e-4, nesterov=True, momentum=0.9))
```

We will run the training for only 10 epochs to get an idea of the convergence:

```python
fate.fit(X_train, Y_train, verbose=True, epochs=10)
```

    Train on 9000 samples, validate on 1000 samples
    Epoch 1/10
    9000/9000 [==============================] - 6s 632us/step - loss: 17.6640 - zero_one_rank_loss_for_scores_ties: 0.3784 - zero_one_rank_loss_for_scores: 0.3784 - val_loss: 17.4572 - val_zero_one_rank_loss_for_scores_ties: 0.3570 - val_zero_one_rank_loss_for_scores: 0.3570
    Epoch 2/10
    9000/9000 [==============================] - 2s 222us/step - loss: 17.1047 - zero_one_rank_loss_for_scores_ties: 0.3199 - zero_one_rank_loss_for_scores: 0.3199 - val_loss: 17.1056 - val_zero_one_rank_loss_for_scores_ties: 0.3023 - val_zero_one_rank_loss_for_scores: 0.3023
    Epoch 3/10
    9000/9000 [==============================] - 2s 225us/step - loss: 16.5706 - zero_one_rank_loss_for_scores_ties: 0.2779 - zero_one_rank_loss_for_scores: 0.2779 - val_loss: 17.2872 - val_zero_one_rank_loss_for_scores_ties: 0.3058 - val_zero_one_rank_loss_for_scores: 0.3058
    Epoch 4/10
    9000/9000 [==============================] - 2s 226us/step - loss: 16.3942 - zero_one_rank_loss_for_scores_ties: 0.2632 - zero_one_rank_loss_for_scores: 0.2632 - val_loss: 16.2413 - val_zero_one_rank_loss_for_scores_ties: 0.2583 - val_zero_one_rank_loss_for_scores: 0.2583
    Epoch 5/10
    9000/9000 [==============================] - 2s 224us/step - loss: 16.2025 - zero_one_rank_loss_for_scores_ties: 0.2559 - zero_one_rank_loss_for_scores: 0.2559 - val_loss: 16.7568 - val_zero_one_rank_loss_for_scores_ties: 0.3008 - val_zero_one_rank_loss_for_scores: 0.3008
    Epoch 6/10
    9000/9000 [==============================] - 2s 224us/step - loss: 16.0721 - zero_one_rank_loss_for_scores_ties: 0.2486 - zero_one_rank_loss_for_scores: 0.2486 - val_loss: 16.8292 - val_zero_one_rank_loss_for_scores_ties: 0.3022 - val_zero_one_rank_loss_for_scores: 0.3022
    Epoch 7/10
    9000/9000 [==============================] - 2s 230us/step - loss: 16.0405 - zero_one_rank_loss_for_scores_ties: 0.2498 - zero_one_rank_loss_for_scores: 0.2498 - val_loss: 15.9915 - val_zero_one_rank_loss_for_scores_ties: 0.2447 - val_zero_one_rank_loss_for_scores: 0.2447
    Epoch 8/10
    9000/9000 [==============================] - 2s 226us/step - loss: 16.0027 - zero_one_rank_loss_for_scores_ties: 0.2476 - zero_one_rank_loss_for_scores: 0.2476 - val_loss: 16.1705 - val_zero_one_rank_loss_for_scores_ties: 0.2479 - val_zero_one_rank_loss_for_scores: 0.2479
    Epoch 9/10
    9000/9000 [==============================] - 2s 231us/step - loss: 15.9558 - zero_one_rank_loss_for_scores_ties: 0.2448 - zero_one_rank_loss_for_scores: 0.2448 - val_loss: 16.0216 - val_zero_one_rank_loss_for_scores_ties: 0.2408 - val_zero_one_rank_loss_for_scores: 0.2408
    Epoch 10/10
    9000/9000 [==============================] - 2s 225us/step - loss: 15.9439 - zero_one_rank_loss_for_scores_ties: 0.2457 - zero_one_rank_loss_for_scores: 0.2457 - val_loss: 16.4365 - val_zero_one_rank_loss_for_scores_ties: 0.2620 - val_zero_one_rank_loss_for_scores: 0.2620

```python
scores = fate.predict_scores(X_test)
```

```python
from csrank.metrics import zero_one_rank_loss_for_scores
from keras import backend as K
K.eval(zero_one_rank_loss_for_scores(Y_test, scores))
```

    0.2638101

Not converged yet, but let us visualize the scores it assigns to test instances:

```python
fig, ax = plt.subplots(figsize=(5,5))
inst = np.random.choice(n_test)
ax.scatter(X_test[inst][:, 0], X_test[inst][:, 1])
for i in range(n_objects):
    ax.text(X_test[inst, i, 0]+0.01,
            X_test[inst, i, 1]+0.01,
            s=int(Y_test[inst, i]))
    ax.text(X_test[inst, i, 0]+0.01,
            X_test[inst, i, 1]-0.025,
            s='{:.1f}'.format(scores[inst][i]),
            color='b')
```

```python

```