Solution (source code)

= Solution

Use the <Galerkin method>, rather than pointwise equality: products generate harmonics outside the retained five-dimensional space. Put $X=\alpha x$, $Z=\pi z$, and denote the five prefactors by
$$
P={2\sqrt2\beta\over\alpha}a,\quad T={2\sqrt2\over\beta}b,\quad C=-c/\pi,\quad
D={2\sqrt2\pi\over\alpha\beta}d,\quad E=e/\alpha.
$$
The retained <streamfunction> is $P\sin X\sin Z$, the retained temperature perturbation is $T\cos X\sin Z+C\sin2Z$, and the retained magnetic-flux perturbation is $D\sin X\cos Z+E\sin2X$. These satisfy all the stated boundary conditions. Let $J(f,g)=f_xg_z-f_zg_x$, the <streamfunction advection bracket>. <Orthogonality> of the <sine> and <cosine> modes gives the following coefficients of the retained harmonics:
$$
\begin{aligned}
J(\psi,\Delta\psi)&=0,\\
[J(\psi,\theta)]_{\cos X\sin Z}&=-\alpha\pi PC=\alpha Pc,\\
[J(\psi,\theta)]_{\sin2Z}&=\alpha\pi PT/2,\\
[J(\psi,A)]_{\sin X\cos Z}&=\alpha\pi PE,\\
[J(\psi,A)]_{\sin2X}&=-\alpha\pi PD/2,\\
[J(A,\Delta A)]_{\sin X\sin Z}&=\alpha\pi DE(3\alpha^2-\pi^2).
\end{aligned}
$$
For example the $C$ contribution to the temperature bracket is $\alpha\pi PC[\cos X\sin3Z-\cos X\sin Z]$. The magnetic bracket follows by writing $A=A_D+A_E$: $J(A,\Delta A)=(\beta^2-4\alpha^2)J(A_D,A_E)$ and $J(A_D,A_E)=\alpha\pi DE(\sin3X-\sin X)\sin Z$. These identities exhibit both the retained terms and discarded harmonics.

Before rescaling time, the projected coefficient equations are
$$
\begin{aligned}
-\beta^2\dot P&=\sigma\beta^4P-\sigma rR_0\alpha T+\sigma\zeta Q[\beta^2\pi D+\alpha\pi DE(3\alpha^2-\pi^2)],\\
\dot T+\alpha Pc&=-\beta^2T+\alpha P,\\
-\dot c/\pi+\alpha\pi PT/2&=4\pi c,\\
\dot D+\alpha\pi PE&=-\zeta\beta^2D+\pi P,\\
\dot E-\alpha\pi PD/2&=-4\zeta\alpha^2E.
\end{aligned}
$$
Substitute the prefactors and divide time derivatives by $\beta^2$. With $\tau=\beta^2t$, $\varpi=4\pi^2/\beta^2$ and $q=\pi^2Q/\beta^4$, the resulting <five-mode vertical-field magnetoconvection> equations are
$$
\boxed{\begin{aligned}
a'&=-\sigma a+\sigma rb-\sigma\zeta qd-\sigma\zeta q(3-\varpi)ed,\\
b'&=a-b-ac,\\c'&=\varpi(-c+ab),\\
d'&=a-\zeta d-ae,\\e'&=-(4-\varpi)\zeta e+\varpi ad.
\end{aligned}}
$$
Here primes denote differentiation in $\tau$. The factor $3-\varpi$ is $(3\alpha^2-\pi^2)/\beta^2$, which checks the magnetic nonlinear sign. There is a terminology qualification in the source: on this thermal diffusion time scale, its $\zeta$ is the <magnetic-to-thermal diffusivity ratio> $\eta/\kappa$. The conventional <magnetic Prandtl number> is $\nu/\eta=\sigma/\zeta$, where $\sigma$ is the <Prandtl number>. The displayed equations and subsequent calculation use the source's $\zeta$ unchanged.