How to align multiple elements across align and its nested aligned?

The following requirements are satisfied:

  1. A single align is used
  2. LHS aligned
  3. Equal signs aligned
  4. \text{}s aligned
  5. Giving a number and a unique label to the first equation while giving another label and a number to the last two equations that is vertically centered between both of them.

You can go further and right-align \Omega, \Gamma_l, r=l_r, but I considered it ugly and decided not to do it.

\documentclass{article}    
\usepackage{amsmath,amsfonts,amssymb}

\begin{document}

\begin{align}
  \partial_t^\alpha T       &= \left(\frac{1}{r} \partial_r T+\partial_r^2 T+\partial_z^2 T \right) & \hspace{-9ex} & \text{in~ } \Omega \label{eq:first} \\
  \makebox[0pt]{subject to} &                                                                       & \hspace{-9ex} & \notag                              \\
  \partial_{n_l} T          &= \frac{e^{-2r^2}}{N_k}n_z-B_iT                                        & \hspace{-9ex} & \text{on~ } \Gamma_l, \notag        \\[-\normalbaselineskip]
                            &                                                                       & \hspace{-9ex} & \label{eq:lasttwo}                  \\
  \partial_r T              &= -B_iT                                                                & \hspace{-9ex} & \text{on~ } r=l_r,\notag
\end{align}

\end{document}

enter image description here


I would do that with alignat which gives full control on the alignment columns spacing, and no \intertext. The \mathrlap command from mathtools (which loadsamsmath`) is useful to neutralise the aligned environment width and have a correct spacing in the lines above.

Unrelated: needless to load amsfontswhen you load amssymb.

\documentclass{article}

\usepackage{mathtools}
\usepackage{amssymb}
\usepackage{optidef}

\begin{document}

    \begin{alignat}{3}
    &\partial_t^\alpha T & &=\left( \frac{1}{r}\, \partial_r T+%
    \partial_r^2 T+%
    \partial_z^2 T \right) &\quad &\text{in}~\Omega \\
    %\intertext[0ex]{subject to}
    \text{subject to} & \notag \\[-2ex]
    &\mathrlap{\begin{alignedat}{2}
    \partial_{n_l} T &= \frac{e^{-2r^2}}{N_k}n_z-B_iT &\quad \text{on}~&\Gamma_l, \\
    %
    \partial_{r} T &= -B_iT
    & \text{on}~&r=l_r,
    \end{alignedat}}
    \end{alignat}

\end{document} 

enter image description here

Edit: a variant:

    \begin{alignat}{4}
     & & \qquad&\partial_t^\alpha T & &=\left( \frac{1}{r}\, \partial_r T+%
    \partial_r^2 T+%
    \partial_z^2 T \right) &\quad &\text{in}~\Omega \\
    %\intertext[0ex]{subject to}
    & \text{subject to} & & \notag \\[-2ex]
     & & &\mkern-3.6mu\mathrlap{\begin{alignedat}{2}
    \partial_{n_l} T &= \frac{e^{-2r^2}}{N_k}n_z-B_iT &\quad \text{on}~&\Gamma_l, \\
    %
    \partial_{r} T &= -B_iT
    & \text{on}~&r=l_r,
    \end{alignedat}}
    \end{alignat}

enter image description here