My answer use the specific package optidef
: a LaTeX library for optimization problems with the [short]
option (with the short code) and without it.
I have cleaned a bit your preamble deleting the \usepackage{amsmath}
and leaving \usepackage{mathtools}
that is a supremum package. I have used:
\usepackage{geometry}
\usepackage{parskip}
just to have an equilibrium for the a4paper
and to have not the indent space to begin of a paragraph. Using the option mini!
you create the subequations and without !
you have a only numbered equation. In addition I have used other specific commands like \lvert
and \rvert
, typical to create \abs
command.
\documentclass[12pt,twoside]{report}
\usepackage[utf8]{inputenc}
\usepackage{mathtools}
\usepackage{amssymb}
\usepackage{textcomp}
\usepackage{hyperref}
\usepackage{geometry}
\usepackage[short]{optidef}
\usepackage{parskip}
\begin{document}
Objective:
\begin{mini!}
{}{\sum_{i=1}^{N} \sum_{s=1}^{C} \sum_{r=1}^{H} \sum_{k=1}^{G} \sum_{t=1}^{T} y_{\textup{isrk}}^{t} \protect \label{eq:3.1}}{}{}
\addConstraint {\lvert p_i-\sum_{s=1}^{C} \sum_{r=1}^{H} \sum_{k=1}^{G} \sum_{t=1}^{T} v_{\textup{isrk}}^{t}\rvert}{\leq \delta,}{\quad\forall{i}\in\{{1,\ldots, N}\}}
\addConstraint { \text{left side} }{=\text{right side},}{\quad \forall{i}\in\{{1,\ldots,N}\}}
\end{mini!}
\begin{mini}
{}{\sum_{i=1}^{N} \sum_{s=1}^{C} \sum_{r=1}^{H} \sum_{k=1}^{G} \sum_{t=1}^{T} y_{\textup{isrk}}^{t} \protect \label{eq:3.2}}{}{}
\addConstraint {\lvert p_i-\sum_{s=1}^{C} \sum_{r=1}^{H} \sum_{k=1}^{G} \sum_{t=1}^{T} v_{\textup{isrk}}^{t}\rvert}{\leq \delta,}{\quad\forall{i}\in\{{1,\ldots, N}\}}
\addConstraint { \text{left side} }{=\text{right side},}{\quad \forall{i}\in\{{1,\ldots,N}\}}
\end{mini}
\end{document}
Deleting the option [short]
, you will have the full words (minimize and subject to):
\documentclass[12pt,twoside]{report}
\usepackage[utf8]{inputenc}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage{textcomp}
\usepackage{hyperref}
\usepackage{geometry}
\usepackage{optidef}
\usepackage{parskip}
\begin{document}
Objective:
\begin{mini!}
{}{\sum_{i=1}^{N} \sum_{s=1}^{C} \sum_{r=1}^{H} \sum_{k=1}^{G} \sum_{t=1}^{T} y_{\textup{isrk}}^{t} \protect \label{eq:3.1}}{}{}
\addConstraint {\lvert p_i-\sum_{s=1}^{C} \sum_{r=1}^{H} \sum_{k=1}^{G} \sum_{t=1}^{T} v_{\textup{isrk}}^{t}\rvert}{\leq \delta,}{\quad\forall{i}\in\{{1,\ldots, N}\}}
\addConstraint { \text{left side} }{=\text{right side},}{\quad \forall{i}\in\{{1,\ldots,N}\}}
\end{mini!}
\begin{mini}
{}{\sum_{i=1}^{N} \sum_{s=1}^{C} \sum_{r=1}^{H} \sum_{k=1}^{G} \sum_{t=1}^{T} y_{\textup{isrk}}^{t} \protect \label{eq:3.2}}{}{}
\addConstraint {\lvert p_i-\sum_{s=1}^{C} \sum_{r=1}^{H} \sum_{k=1}^{G} \sum_{t=1}^{T} v_{\textup{isrk}}^{t}\rvert}{\leq \delta,}{\quad\forall{i}\in\{{1,\ldots, N}\}}
\addConstraint { \text{left side} }{=\text{right side},}{\quad \forall{i}\in\{{1,\ldots,N}\}}
\end{mini}
\end{document}
Addendum 1: Just after the comment of nice user @Zarko I have put another row to write long condition which OP put in separate lines in equations.
\documentclass[12pt,twoside]{report}
\usepackage[utf8]{inputenc}
\usepackage{amssymb}
\usepackage{mathtools}
\usepackage{textcomp}
\usepackage{hyperref}
\usepackage{geometry}
\usepackage{optidef}
\usepackage{parskip}
\begin{document}
Objective:
\begin{mini!}
{}{\sum_{i=1}^{N} \sum_{s=1}^{C} \sum_{r=1}^{H} \sum_{k=1}^{G} \sum_{t=1}^{T} y_{isrk}^{t} \protect \label{eq:3.1}}{}{}
\addConstraint{\lvert p_i-\sum_{s=1}^{C} \sum_{r=1}^{H} \sum_{k=1}^{G} \sum_{t=1}^{T} v_{isrk}^{t}\rvert}{\leq \delta,}{\qquad\forall{i}\in\{1,\ldots, N\}}
\addConstraint{\sum_{i=1}^{N} x_{isrk}^{t}\leq \sum_{i=1}^{N}(u_{isrk}^{t}-u_{is(r+1)k}^{t}),\protect \label{eq:3.3}}{\quad}{\quad\begin{matrix}
\forall s \in \{1,\ldots,C\},\\
r \in \{1,\ldots, H-1\}, \\
k \in \{1,\ldots,G\}, \\
t \in \{1,\ldots,T\}
\end{matrix}}
\end{mini!}
\end{document}
The other equations can be added using a mechanism of the same design.
Addendum 2: Given the request of @A Azab as by comment the \addConstraint
have almost 3 arguments. I have done several tests and in the first argument you can't split the equations like in your code. But in the third argument you can achieve your request with some unrefined and rough tricks.
\addConstraint{first argument}{second argument}{third argument}
See the part:
\addConstraint{
\sum_{i=1}^{N} v_{isrk}^{t} + \sum_{i=1}^{N} y_{isrk}^{t} +\sum_{i=1}^{N} x_{isrk}^{t}}{\leq 1}{\begin{matrix}
& \\[3.5em]
\hspace{-5cm} \forall i\in \{1,\ldots,N\}, s \in \{1,\ldots,C\},r \in\{1,\ldots,H\}\protect\label{eq:3.8}
\end{matrix}}
\documentclass[12pt,twoside]{report}
\usepackage[utf8]{inputenc}
\usepackage{mathtools}
\usepackage{amssymb}
\usepackage{textcomp}
\usepackage{hyperref}
\usepackage{geometry}
\usepackage{optidef}
\usepackage{parskip}
\begin{document}
Objective:
\begin{mini!}
{}{\sum_{i=1}^{N} \sum_{s=1}^{C} \sum_{r=1}^{H} \sum_{k=1}^{G} \sum_{t=1}^{T} y_{isrk}^{t} \protect \label{eq:3.1}}{}{}
\addConstraint{\lvert p_i-\sum_{s=1}^{C} \sum_{r=1}^{H} \sum_{k=1}^{G} \sum_{t=1}^{T} v_{isrk}^{t}\rvert}{\leq \delta,}{\qquad\forall{i}\in\{1,\ldots, N\}}
\addConstraint{
\sum_{i=1}^{N} v_{isrk}^{t} + \sum_{i=1}^{N} y_{isrk}^{t} +\sum_{i=1}^{N} x_{isrk}^{t}}{\leq 1}{\begin{matrix}
& \\[3.5em]
\hspace{-5cm} \forall i\in \{1,\ldots,N\}, s \in \{1,\ldots,C\},r \in\{1,\ldots,H\}\protect\label{eq:3.8}
\end{matrix}}
\end{mini!}
\end{document}
Best Answer
If you are using
amsmath
, just redefine\tagform@
in this wayMWE
EDIT
As egreg notices, you might want
\eqref
to keep the parenthesis when printing the reference. In this case, replace the above code withMWE:
Output: