[Tex/LaTex] Numbering equations in an optimization problem

math-modenumbering

I am trying to assign numbers to my equations in an optimization problem, however Latex keeps giving one number for the single problem. I have checked multiple sources for any advice, but I have yet to find one satisfactory.

The model is as follows:

\begin{equation} 

\begin{aligned}

& \underset{k=1, t\epsilon T, p\epsilon P}{\text{Max}}
& &\sum_{p\epsilon P}(a_{p,k,t}x_{p,t})+\sum_{t=1}^{T}{(1+r)}^{T-t}y_t  \\

& \text{subject to} 
& & f\sum_{ p\epsilon P}x_{p,t}+y_t=B_t , & \forall t \\

&&& k\geq m_k , & \forall k \\

&&& p_i\geq g_{pi,pj} , & \forall i \vee j && j \neq i \\

&&& \sum_{p\epsilon P}\sum_{t\epsilon T} (a_{p,k,t}x_{p,t})+\sum_{t=1}^{T}{(1+r)}^{T-t}y_t \geq B_F \\

\end{aligned}

\end{equation}

I synthesize that the problem is due to me using only one equation format, but I've tried with several, but that only gave me errors.

Thanks in advance.

Best Answer

Do you mean to use the align environment instead of the aligned environment? aligned creates only one equation number for the whole environment. align creates a separate equation number for each new line in the environment.

If you want to omit numbering on specific equations, you can do so with the \nonumber command.enter image description here

Try this code instead:

\documentclass{article}
    \usepackage{amsmath,amssymb,amsfonts,amsthm}
\title{Equation Numbering}
\begin{document}
\maketitle


  \begin{align}
    & \underset{k=1, t\epsilon T, p\epsilon P}{\text{Max}}
    & &\sum_{p\epsilon P}(a_{p,k,t}x_{p,t})+\sum_{t=1}^{T}{(1+r)}^{T-t}y_t  \\
%
    & \text{subject to} 
    & & f\sum_{ p\epsilon P}x_{p,t}+y_t=B_t , & \forall t \\
%
    &&& k\geq m_k , & \forall k \nonumber \\
%
    &&& p_i\geq g_{pi,pj} , & \forall i \vee j && j \neq i \nonumber \\
%
    &&& \sum_{p\epsilon P}\sum_{t\epsilon T}
    (a_{p,k,t}x_{p,t})+\sum_{t=1}^{T}{(1+r)}^{T-t}y_t \geq B_F
  \end{align}
\end{document}
Related Question