Solution (source code)

= Solution

The <quasi-geostrophic potential-vorticity equation> is the leading balanced form of <potential-vorticity conservation> for an inviscid rotating fluid with <stable density stratification>, small <Rossby number> and an <adiabatic process> for each <fluid element>. Its parent conservation law is <Ertel potential vorticity> conservation. Horizontal <geostrophic balance>, vertical <hydrostatic balance>, and the <beta-plane approximation> reduce it to advection of one scalar by the leading horizontal <geostrophic flow>.

One can see its origin by combining the vertical <vorticity equation> with the thermal equation. Set $D_g=\partial_t+\mathbf u_g\cdot\nabla_h$, $\mathbf u_g=(-\psi_y,\psi_x)$, and $\zeta_g=\nabla_h^2\psi$. The <quasi-geostrophic approximation> gives
$$
D_g(\zeta_g+f_0+\beta y)=f_0w_z,
\qquad
D_gb+N^2w=0,\qquad b=f_0\psi_z.
$$
Here $b$ is the <buoyancy perturbation> relative to the reference <stable density stratification>, $N=N(z)$ its <buoyancy frequency>, and $w$ the small vertical <velocity>. The stretching of absolute <vorticity> in the first equation is offset by the change of <stratification> represented by the second. More precisely,
$$
D_g\partial_z\left(\frac{f_0b}{N^2}\right)
=\partial_z\left(\frac{f_0D_gb}{N^2}\right)
-\frac{f_0}{N^2}(\partial_z\mathbf u_g)\cdot\nabla_hb
=-f_0w_z.
$$
The last <dot product> is zero because <thermal-wind balance> makes $\partial_z\mathbf u_g$ perpendicular to $\nabla_hb$. Adding therefore yields
$$
\boxed{D_gq=0,\qquad
q=\underbrace{\nabla_h^2\psi}_{\text{relative vorticity}}
+\underbrace{f_0+\beta y}_{\text{planetary vorticity}}
+\underbrace{\partial_z\left(\frac{f_0^2}{N^2}\psi_z\right)}_{\text{stratification/stretching contribution}}.}
$$
The constant $f_0$ has no effect on the tendency, but its inclusion makes the connection with absolute <vorticity> clear. Vertical <advection> of $q$ is beyond the retained order; the vertical <velocity> has already supplied the stretching and thermodynamic terms.

For a simple balanced weather forecast, the essential cycle is \b[diagnose, advect, invert]:

* Use observed <pressure> or <geopotential> and <temperature> to construct a balanced initial <quasi-geostrophic streamfunction>, its interior <potential vorticity>, and the upper and lower boundary <buoyancy>.
* Evolve $q$ with $q_t=-\mathbf u_g\cdot\nabla_hq$ for a small time step. For flat rigid boundaries, also evolve their thermal data with $D_gb=0$ there. Appropriate lateral <boundary conditions> and any known large-scale circulation must accompany these fields.
* Recover the new <streamfunction> by <stratified quasi-geostrophic inversion>:
$$
\left[\nabla_h^2+\partial_z\left(\frac{f_0^2}{N^2}\partial_z\right)\right]\psi
=q-f_0-\beta y.
$$
This is an <elliptic boundary value problem>, not a local algebraic diagnosis. Its solution supplies the next <geostrophic flow> and, through $b=f_0\psi_z$, the next thermal field. Repeat the cycle to move the balanced weather systems forward.

Interior <potential vorticity> alone is insufficient: boundary thermal anomalies can induce flow even with zero interior anomaly, as in the <Eady model>. The method filters fast <inertia-gravity waves> and is useful for large-scale extratropical weather, while tropical dynamics, <convection>, moisture, friction and diabatic heating require additional physics. If vertical motion is wanted, the <quasi-geostrophic omega equation> supplies a further diagnostic calculation.