## The governing equations

\begin{align}
  \partial_t \mathbf u 
      = &- (\mathbf{u}.\nabla) \mathbf{u} - c^2 \nabla h - f\mathbf{e_z} \times 
\mathbf u  \\
  \partial_t h 
      =& - \nabla. (h \mathbf u)
\end{align}

Equations may also be written in the \textit{rotational form} as:
    
\begin{equation}
 \partial_t \mathbf u 
 = - \nabla |\mathbf u|^2/2 - c^2 \nabla h - \zeta \times \mathbf u
\end{equation}
where, $\zeta$
represents absolute vorticity, i.e. the sum of vorticity and system rotation.


## Linearised governing equations

### without beta effect
  \begin{align}
    \partial_t \mathbf u =& - c^2 \nabla \eta - f\mathbf{e_z} \times \mathbf u  \\
    \partial_t \eta =& - \nabla.  \mathbf u 
  \end{align}
  
Taking curl and divergence of the linearized equation for momentum  gives the following evolution equations with change of variables:

  \begin{align}
    \partial_t \zeta =& - f \delta\\ 
    \partial_t \delta =&  f \zeta - c^2 \nabla^2 \eta \\
    \partial_t \eta =& - \delta
  \end{align}
   

as an eigenvalue problem:
\begin{align}
 i\omega
   \begin{Bmatrix}
       \hat{\zeta} \\ \hat{\delta} \\c\kappa\hat{\eta}
  \end{Bmatrix}
  = i
  \begin{bmatrix}
     0 & if & 0 \\
   -if &  0 & -ic\kappa \\
     0 & ic\kappa & 0 
  \end{bmatrix}
  \begin{Bmatrix}
       \hat{\zeta} \\ \hat{\delta} \\c\kappa\hat{\eta}
  \end{Bmatrix}
\end{align}
where, $\kappa = |\mathbf{k}|$.

### with beta effect
  \begin{align}
    \partial_t u =& - c^2 \partial_x \eta + (f+\beta y)v  \\
    \partial_t v =& - c^2 \partial_y \eta - (f+\beta y)u  \\
    \partial_t \eta =& - \nabla.  \mathbf u 
  \end{align}

#### IMPORTANT: must be derived from spherical coordinates!
But instead if we use the nabla operator from the cartesian coordinates, and take curl of the coriolis term:

$$ [\nabla \times ({(f + \beta y)\hat{e}_z \times \mathbf{u}})].\hat{e}_z $$



$$ = [(f + \beta y)\hat e_z \delta - \mathbf{u} (\nabla . \hat e_z  (f + \beta y)) +(\mathbf{u}.\nabla)\hat e_z(f + \beta y) - ((f + \beta y) \hat e_z . \nabla) \mathbf{u}].\hat{e}_z $$

We remove:
* Term ... because we assume the vertical velocity \pa
$w << (u, v)$.


Taking curl and divergence of the linearized equation for momentum  gives the following evolution equations with change of variables:
$$
  \begin{align}
    \partial_t \zeta =& - f \delta  - v \beta \\ 
    \partial_t \delta =&  f \zeta + u \beta - c^2 \nabla^2 \eta \\
    \partial_t \eta =& - \delta
  \end{align}
$$

Apply helmholtz decomposition,

$\mathbf u = - (\nabla \times e_z \psi) + \nabla \chi$

\begin{align}
        u &= -\psi_y + \chi_x \\
        v &= \psi_x + \chi_y \\
        \zeta &= \nabla^2 \psi \\
        \delta &= \nabla^2 \chi
\end{align}

as an eigenvalue problem:
\begin{align}
 &i\omega
   \begin{Bmatrix}
       \hat{\psi} \\ \hat{\chi} \\ c\hat{\eta}/\kappa
  \end{Bmatrix}\\
 =&
  \begin{bmatrix}
     -i\beta k_x/\kappa^2 & f - i\beta k_y/\kappa^2 & 0 \\
     -f-i\beta k_y/\kappa^2 &  +i\beta k_x/\kappa^2 & c \kappa \\
     0 & -c\kappa & 0 
  \end{bmatrix}
  \begin{Bmatrix}
       \hat{\psi} \\ \hat{\chi} \\ c\hat{\eta}/\kappa
  \end{Bmatrix}
\end{align}


\begin{align}
 =& i
  \begin{bmatrix}
     -\beta k_x/\kappa^2 & -if - \beta k_y/\kappa^2 & 0 \\
     if-\beta k_y/\kappa^2 &  \beta k_x/\kappa^2 & -ic \kappa \\
     0 & ic\kappa & 0 
  \end{bmatrix}
  \begin{Bmatrix}
       \hat{\psi} \\ \hat{\chi} \\ c\hat{\eta}/\kappa
  \end{Bmatrix}
\end{align}


```python
# coding: utf-8
from sympy import *
from sympy.abc import psi, chi, eta, omega

init_printing()
f, ck, c = symbols('f ck c', real=True)
sigma, kappa, beta = symbols(r'\sigma \kappa \beta', real=True)
kx, ky, kh =  symbols('k_x k_y k_h', real=True)
u,v =  symbols('u v')

def subsigma(M):
    M = M.subs(f**2 + ck**2,  sigma**2)
    M = M.subs(f**2 + c**2*kappa**2, sigma**2)
    return M
    
def simplifysigma(M):
    M = M.subs(sigma, sqrt(f**2 + ck**2) )
    M = simplify(M)
    return subsigma(M)
    
def subkappa(M):
    M = M.subs(kx**2 + ky**2,  kappa**2)
    M = M.subs(kh*kh.conjugate(), kappa**2)
    M = M.subs(kx*kx.conjugate() + ky*ky.conjugate(), kappa**2)
    return M

def simplifykappa(M):
    M = M.subs(kappa, sqrt(kx**2 + ky**2))
    M = M.subs(kh, sqrt(kx**2 + ky**2))
    M = simplify(M)
    return subkappa(M)
    
def subck(M):
    return M.subs(ck,c*kappa)
```


```python
A = Matrix(([-beta*kx/kappa**2, -1j*f - beta*ky/kappa**2, 0],
            [1j*f - beta*ky/kappa**2, beta*kx/kappa**2, -1j*c*kappa],
            [0,1j*c*kappa,0]))

```


```python
A
```


```python
Ah = A.conjugate().transpose()
Ah - A
```


```python
A.det()
```


```python
A.conjugate().transpose()
```


```python
charpoly = A.charpoly(omega)
```


```python
chareqn = Eq(subsigma(simplify(charpoly.expand())),0)
```


```python
chareqn
```


```python
solve(chareqn, omega)
```


```python
L = A.eigenvals()
X = A.eigenvects()
```


```python
L
```


```python
A
```


```python
XX = A.diagonalize()[0]
XX = subsigma(XX)
sig = sqrt(f**2 + ck**2)

NORM = eye(3)
NORM[0,0] = f/sig
NORM[1,1] = ck/(sig*sqrt(2))
NORM[2,2] = ck/(sig*sqrt(2))
XN = subsigma(XX*NORM)

#CONJ = eye(3)
#CONJ[1,1] = -1
#XNCT = (CONJ*XN).transpose()
XNCT = XN.conjugate().transpose()
#XNCT = subsigma(XNCT)
 
#------------Check-----------#
ID = simplifysigma(XN*XNCT)
print 'Identity matrix:'
```


```python
ID
```


```python
print 'Norm. Eigenvector matrix Xn:'
```


```python
XN
```


```python
W = Matrix( [psi, -phi, c*eta/kappa] ) * kappa ** 2
U = Matrix( [u,v,eta] )
P = Matrix(( [-1j*ky, 1j*kx, 0],[1j*kx,1j*ky,0],[0,0,kappa] ))

Pinv = simplifykappa(P.inv())
XNCTinv = simplifysigma(XNCT.inv())

Q = Pinv*(XNCTinv)
Q = simplifysigma(Q)
Q = simplifykappa(Q)
Q = subck(Q)
```


```python
print 'inversion:'; Pinv
```


```python
U,Q,W
```


```python
NORM = eye(3)
NORM[2,2] = c
U = NORM*U
#Q = NORM*Q
#W = NORM*W
```


```python
U, Q, W
```


```python
#RHS BB*
N = XNCT*W
B = expand(subck(N / kappa))
B = simplifysigma(B)
```


```python
collect_list = [psi*psi.conjugate(), eta*eta.conjugate(), phi*phi.conjugate(),
                psi*phi.conjugate(), psi*eta.conjugate(),
                phi*psi.conjugate(), phi*eta.conjugate(),
                eta*psi.conjugate(), eta*phi.conjugate()]
```


```python
BB2 = subck(simplifykappa(expand(B.conjugate().dot(B))))
collect(BB2,collect_list)
```


```python
kappa**2 * psi*psi.conjugate() + kappa**2 * phi*phi.conjugate() + c**2 * eta*eta.conjugate()
```


```python
#LHS uu*
U.transpose().conjugate()*U
```


```python
simplifykappa(Q.transpose()*Q)
```


```python
#U=[Q]W
QW = Q*W
```


```python
#collect(subck(simplifykappa(expand(QW.transpose().conjugate()*QW))), collect_list)
QW2 = QW.conjugate().dot(QW)
QW2 = simplifysigma(subck((simplifykappa(expand(QW.conjugate().dot(QW))))))
QW2 = collect(QW2,collect_list)
QW2
```


```python
simplifykappa(collect( U.conjugate().dot((P.conjugate().transpose()*P)*U) , 
        [u*u.conjugate(), v*v.conjugate(), eta*eta.conjugate()]))
```


```python
subkappa(P.conjugate().transpose()*P)
```


```python
P*P.conjugate().transpose()
```


```python
P
```


```python
XNCT*XN
```


```python
simplifysigma(_)
```


```python
P
```


```python
P*U
```


```python
Q
```


```python
Q*kappa*abs(sigma)
```


```python
XNCT*P/kappa
```


```python
subck(XNCT)*W/kappa
```


```python
Pinv,XNCTinv
```


```python
Q
```


```python
W,P,U
```


```python
P*U
```


```python
Q = kappa*Pinv*(XNCTinv)
Q = simplifysigma(Q)
Q = simplifykappa(Q)
Q = subck(Q)
Q*W
```


```python
simplify(Q*B)
```


```python
Q
```


```python

```

ca13958d47460ad8ea85487fc5c8bca5eaedc921
ipynb
Jupyter Notebook
Jupyter/normalmode_nb-beta.ipynb
ashwinvis/spectral_energy_budget_sw1l
1c0cccc895f9055838d7164f132c7475d01e1f6d
CC-BY-4.0
2020-07-05T11:03:01.000Z
2020-07-05T11:03:01.000Z
Jupyter/normalmode_nb-beta.ipynb
ashwinvis/spectral_energy_budget_sw1l
1c0cccc895f9055838d7164f132c7475d01e1f6d
CC-BY-4.0
Jupyter/normalmode_nb-beta.ipynb
ashwinvis/spectral_energy_budget_sw1l
1c0cccc895f9055838d7164f132c7475d01e1f6d
CC-BY-4.0
Qwen/Qwen-72B
1. YES
2. YES