Solution (source code)

= Solution

Choose a reference circular orbit at $r_0$, and use local coordinates $x=r-r_0$, $y=r_0[\phi-\Omega_0t]$, with the frame rotating at $\Omega=\Omega_0=\Omega(r_0)$. Linearizing differential rotation in the <shearing sheet> gives the background flow
$$
\mathbf u_0=-2Ax\mathbf e_y,\qquad
\boxed{A=-\frac12r_0\Omega'(r_0),\qquad \Omega=\Omega(r_0)}.
$$
Thus the velocity perturbation is measured relative to this background. The local <orbital shear parameter> is $q=2A/\Omega=-d\ln\Omega/d\ln r$; <Keplerian rotation> has $q=3/2$ and $A=3\Omega/4$. Rotation supplies the <Coriolis force>, while the linear shear supplies the terms proportional to $A$.

For constant density, $\psi$ is the total-pressure potential after background force balance has been subtracted:
$$
\boxed{\psi=\frac{p}{\rho}+\frac{B^2}{2\mu_0\rho}}
$$
up to a function of time and any prescribed perturbation potential that is absorbed into it. The magnetic-pressure gradient has been combined with the gas-pressure gradient, leaving magnetic tension as $\mathbf B\cdot\nabla\mathbf B/(\mu_0\rho)$. The pressure also enforces incompressibility. In the unstratified <shearing box> here, the tidal/background terms have already been removed in deriving the perturbation equations; no independent vertical stratification is being evolved.