[Tex/LaTex] How to write the number of equations in optimization problem

alignequationsmath-mode

I am writing to assign numbers to my equations in an optimization problem. However, Latex keeps giving one number for the single problem. How can to write it?

My code is

\begin{equation}
\begin{aligned} 
& \underset{\mathbf{x}}{\text{maximize}}
& & \sum_{m}^{M} \sum_{k}^{K} \sum_{n}^{N} R_{m,k,n}^{T,UL} x_{m,k,n}  \\
& \text{subject to}
& & \sum_{m}^{M} \sum_{k}^{K} x_{m,k,n} \leq 1, \; \forall n. \\
& & & \sum_{n}^{N} x_{m,k,n} \leq 1, \; \forall m,k. 
\end{aligned}
\end{equation}   

Best Answer

Here are two possible solutions. Note that I've reduced the number of alignment points relative to your original code. In the second solution, only the two constraint equations are aligned relative to each other.

enter image description here

\documentclass{article}
\usepackage{amsmath} % for align environment
\usepackage{bm}      % for \bm macro
\begin{document}

First possibility:
\begin{align} 
\max_{\bm{x}} \quad
& \sum_{m=1}^{M} \sum_{k=1}^{K} \sum_{n=1}^{N} R_{m,k,n}^{T,\mathit{UL}} x_{m,k,n}  \\
\text{subject to}\quad
&\sum_{m=1}^{M} \sum_{k=1}^{K} x_{m,k,n} \leq 1 \quad \forall n \\
&\sum_{n=1}^{N} x_{m,k,n} \leq 1 \quad \forall m,k. 
\end{align} 

Second possibility:
\begin{equation} 
\max_{\bm{x}} \quad
\sum_{m=1}^{M} \sum_{k=1}^{K} \sum_{n=1}^{N} R_{m,k,n}^{T,\mathit{UL}} x_{m,k,n} 
\end{equation}
\begin{subequations}
\begin{align}
\text{subject to}\quad
&\sum_{m=1}^{M} \sum_{k=1}^{K} x_{m,k,n} \leq 1 \quad \forall n \\
&\sum_{n=1}^{N} x_{m,k,n} \leq 1 \quad \forall m,k. 
\end{align} 
\end{subequations}
\end{document}
Related Question