Solution (source code)

= Solution

Use $D=\partial_t+w\partial_z$, $w=v_z$, and a prime for $\partial_z$. For the <plane-parallel magnetohydrodynamic flow with imposed shear>, $\nabla\cdot\mathbf u=w'$, while
$$
(\mathbf u\cdot\nabla)\mathbf u
=w\mathbf v'+a v_x\mathbf e_y,\qquad
(\mathbf B\cdot\nabla)\mathbf u
=B_z\mathbf v'+a B_x\mathbf e_y.
$$
The solenoidal <magnetic field> constraint gives $B_z'=0$. The $z$ component of the <MHD induction equation> then gives $\partial_tB_z=0$. Thus \b[$B_z$ is constant in both space and time].

Use the <magnetic tension> and <magnetic pressure> decomposition
$$
\mathbf f_L=\frac{B_z}{\mu_0}\mathbf B'
-\left(\frac{B^2}{2\mu_0}\right)'\mathbf e_z.
$$
The <continuity equation> and momentum equation now reduce to
$$
\boxed{\begin{aligned}
D\rho&=-\rho w',\\
Dv_x&=\frac{B_z}{\mu_0\rho}B_x',\\
Dv_y+a v_x&=\frac{B_z}{\mu_0\rho}B_y',\\
Dw&=-g-\frac1\rho\left(p+\frac{B^2}{2\mu_0}\right)'.
\end{aligned}}
$$
The transverse components of the <MHD induction equation> are
$$
\boxed{DB_x=B_zv_x'-B_xw',\qquad
DB_y=B_zv_y'+aB_x-B_yw'.}
$$
The terms involving $a$ respectively accelerate the flow across the imposed <shear flow> and wind the transverse <magnetic field>. The closure is the <isothermal equation of state> $p=c_s^2\rho$, as printed in the PDF.