Latex repeat equation numbering (unwanted)

I'm using the equation environment in my latex document. All went ok until half a chapter when I find the two equation have the same equation number (3.44). Why could this happens? Moreover, from that point to the end of the document, all the equations that are within the same subsection/section have the same numbering.

This is the crucial point of the document: At first

$$\mathbf { L } \hat { \mathbf { U } } _ { \mathcal { K } } = \hat { \mathbf { U } } _ { \mathcal { K } } \mathbf { C } _ { \mathcal { K } }$$


that currently follow the equation numbering order and it is (3.44). Then I insert two equation that must not to be numbered, thus I used the tag environment:

$$\quad &\min _ { \mathbf { L } \in \mathbb { R } ^ { N \times N } , \mathrm { C } _ { \mathcal { K } } \in \mathbb { R } ^ { K \times K } } f ( \mathbf { L } , \mathbf { Y } , \hat { \mathbf { S } } ) \tag{\mathcal{P}_{L}}$$
$$\notag \quad \quad & & & & \left. \begin{array} { c l } { \text { s.t. } } & { \mathbf { L } \in \mathcal { L } , \operatorname { tr } ( \mathbf { L } ) = p } \\ { } & { \mathbf { L } \hat { \mathbf { U } } _ { \mathcal { K } } = \hat { \mathbf { U } } _ { \mathcal { K } } \mathbf { C } _ { \mathcal { K } } , \mathbf { C } _ { \mathcal { K } \succeq } \mathbf { 0 } } \end{array} \right\} \triangleq \mathcal { X } \left( \hat { \mathbf { U } } _ { \mathcal { K } } \right)$$

$$\quad &\min _ { \mathbf { L } \in \mathbb { R } ^ { N \times N } \atop \mathrm { C } _ { \mathcal { K } } \in \mathbb { R } ^ { K \times K } } f _ { 1 } ( \mathbf { L } , \mathbf { Y } , \mu ) \triangleq \mathrm { TV } ( \mathbf { L } , \mathbf { Y } ) + \mu \| \mathbf { L } \| _ { F } ^ { 2 } \tag{\mathcal{P}_{L_{1}}}$$
$$\notag \left. \begin{array} { c l } { \text { s.t. } } & \quad \left( \mathbf { L } , \mathbf { C } _ { \mathcal { K } } \right) \in \mathcal { X } \left( \hat { \mathbf { U } } _ { \mathcal { K } } \right)$$


that has no equation number but the tag filled. Then when writing

$$\operatorname { tr } \left( \mathbf { Y } ^ { T } \mathbf { L Y } \right) = \operatorname { tr } \left( \mathbf { S } _ { \mathcal { K } } ^ { T } \mathbf { \Lambda } _ { \mathcal { K } } \mathbf { S } _ { \mathcal { K } } \right) = \operatorname { tr } \left( \hat { \mathbf { S } } _ { \mathcal { K } } ^ { T } \mathbf { C } _ { \mathcal { K } } \hat { \mathbf { S } } _ { \mathcal { K } } \right)$$


it has still equation number 3.44. Why?

EDIT: I wrote the two consecutive equation environemt to obtain the following effect

• It is strange unless you have some special changes. Please show us a compilable code so that we can have some tests.
– user156344
Mar 27 '19 at 15:16
• Why isn't it compilable? Mar 27 '19 at 15:18
• Of course all the above codes are not compilable, because they don't have \documentclass{}, \begin{document}, etc.
– user156344
Mar 27 '19 at 15:18
• You get a huge number of errors from that input. Whatever happens next is not reliable until you fix the errors. Mar 27 '19 at 15:22
• If you want a totally unnumbered equation, use the starred form of the environment. Al;so, rather than putting two equation environments directly after one another, consider using one of the multi0-line display environments provided by amsmath. (To see the documentation, at a command line prompt, type texdoc amsmath'.) Mar 27 '19 at 15:24

You get a huge number of errors from that input. Whatever happens next is not reliable until you fix the errors.

Here's a fixed version:

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

\DeclareMathOperator{\tr}{tr}

\begin{document}

\begin{align}
&\min_{\substack{
\mathbf{L}\in\mathbb{R}^{N\times N} \\
\mathbf{C}_{\mathcal{K}}\in\mathbb{R}^{K\times K}
}} f(\mathbf{L},\mathbf{Y},\hat{\mathbf{S}})
\tag{$\mathcal{P}_{L}$}
\\
\notag
\left.\begin{array}{@{}ll@{}}
\text{s.t.} & \mathbf{L}\in\mathcal{L},\tr(\mathbf{L})=p\\
& \mathbf{L}\hat{\mathbf{U}}_{\mathcal{K}}=
\hat{\mathbf{U}}_{\mathcal{K}}\mathbf{C}_{\mathcal{K}},
\mathbf{C}_{\mathcal{K}\succeq\mathbf{0}}
\end{array}\right\}
\triangleq\mathcal{X}(\hat{\mathbf{U}}_{\mathcal{K}})
\\[2ex]
&\min_{\substack{
\mathbf{L}\in\mathbb{R}^{N\times N} \\
\mathbf{C}_{\mathcal{K}}\in\mathbb{R}^{K\times K}
}} f_{1}(\mathbf{L},\mathbf{Y},\mu)\triangleq
\mathrm{TV}(\mathbf{L},\mathbf{Y})+\mu\|\mathbf{L}\|_{F}^{2}
\tag{$\mathcal{P}_{L_{1}}$}
\\
\notag
\,\begin{array}{@{}ll@{}}
\text{s.t.} & (\mathbf{L},\mathbf{C}_{\mathcal{K}})\in\mathcal{X}
(\hat{\mathbf{U}}_{\mathcal{K}})
\end{array}
\end{align}

$$\tr(\mathbf{Y}^{T}\mathbf{LY})= \tr(\mathbf{S}_{\mathcal{K}}^{T} \mathbf{\Lambda}_{\mathcal{K}} \mathbf{S}_{\mathcal{K}})= \tr(\hat{\mathbf{S}}_{\mathcal{K}}^{T} \mathbf{C}_{\mathcal{K}} \hat{\mathbf{S}}_{\mathcal{K}})$$

\end{document}


With different alignment. A couple of tricks are needed to move s.t to the left with the brace on the right hand side.

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

\DeclareMathOperator{\tr}{tr}

\begin{document}

\begin{align}
&\min_{\substack{
\mathbf{L}\in\mathbb{R}^{N\times N} \\
\mathbf{C}_{\mathcal{K}}\in\mathbb{R}^{K\times K}
}} f(\mathbf{L},\mathbf{Y},\hat{\mathbf{S}})
\tag{$\mathcal{P}_{L}$}
\\
\notag
&\left.\kern-\nulldelimiterspace
\begin{array}{@{}l@{}}
\mathbf{L}\in\mathcal{L},\tr(\mathbf{L})=p\\
\mathbf{L}\hat{\mathbf{U}}_{\mathcal{K}}=
\hat{\mathbf{U}}_{\mathcal{K}}\mathbf{C}_{\mathcal{K}},
\mathbf{C}_{\mathcal{K}\succeq\mathbf{0}}
\end{array}\right\}
\triangleq\mathcal{X}(\hat{\mathbf{U}}_{\mathcal{K}})
\\[2ex]
&\min_{\substack{
\mathbf{L}\in\mathbb{R}^{N\times N} \\
\mathbf{C}_{\mathcal{K}}\in\mathbb{R}^{K\times K}
}} f_{1}(\mathbf{L},\mathbf{Y},\mu)\triangleq
\mathrm{TV}(\mathbf{L},\mathbf{Y})+\mu\|\mathbf{L}\|_{F}^{2}
\tag{$\mathcal{P}_{L_{1}}$}
\\
\notag
$$\tr(\mathbf{Y}^{T}\mathbf{LY})= \tr(\mathbf{S}_{\mathcal{K}}^{T} \mathbf{\Lambda}_{\mathcal{K}} \mathbf{S}_{\mathcal{K}})= \tr(\hat{\mathbf{S}}_{\mathcal{K}}^{T} \mathbf{C}_{\mathcal{K}} \hat{\mathbf{S}}_{\mathcal{K}})$$
`