[Tex/LaTex] missing { inserted. \end{gather}

equations

I try to write this code but I have a Missing { inserted error.
Can anyone help me?

\begin{gather}
\begin{split}
 \mathop{\min}\limits_{P_{ng},P_l,R_n,Z_l,\theta _n \in \,\,\Omega ^{OTS}} & {\mathop {\max}\limits_{P_{nd} \in \,\,US}
 \quad \overbrace {\sum\limits_{\forall n \in {\Omega ^N}} {\sum\limits_{\forall g \in {\Omega ^{G - n}}} {{C_{ng}}{P_{ng}}} } }^{{\rm{T1}}}+\\
 &\overbrace {\sum\limits_{\forall n \in {\Omega ^N}} {VOLL_n} \cdot {R_n} }^{\rm{T2}}}\\
\end{split}
\end{gather}

Best Answer

You're using too many unnecessary braces and it's easy to lose oneself in balancing them.

Here's a reduced (and improved version):

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{equation}
\begin{split}
 \min_{\substack{P_{ng},P_l,R_n,Z_l,\\\theta_n \in\Omega^{OTS}}}
 \max_{P_{nd} \in \,\,US}
 \quad &
 \overbrace{
   \sum_{\forall n \in \Omega^N}
   \sum_{\forall g \in \Omega^{G - n}}
   C_{ng}P_{ng}
  }^{\mathrm{T}1}+{}\\
 &\overbrace{
    \sum_{\forall n \in \Omega^N} \mathit{VOLL}_n \cdot R_n
  }^{\mathrm{T}2}\\
\end{split}
\end{equation}

\end{document}

Note that \max and \min are already math operators taking limits; with \substack it's possible to break a long condition into several lines. Also \rm should never be used, \mathrm is the right command. For VOLL it's better to use \mathit because it's a single variable name, not the product of four quantities. The same might apply to US and OTS, check their meaning.

I'd remove all \forall, which are generally not used in that context (but it depends on the field of research).

enter image description here