[Tex/LaTex] Getting extra equation numbers using align environment

alignnumbering

so I'm having an issue with equation numbers and the align environment. This has happened with several of my equation blocks where there is an extra equation number in there for no reason that I can see. I've tried using \nonumber in several places but cannot seem to locate where the issue is coming from. My code is:

\begin{align}
    P(t) &= \frac{3}{2}\left[v_d(t)i_d(t)\right] \\
    Q(t) &= \frac{3}{2}\left[-v_d(t)i_q(t)\right] \\
\end{align}

and it looks like:

Extra equation number

Can anyone shed any light on this. I can split these into two separate equations instead of using align, but the thing is I have some really long equations that need to be split over multiple lines as well that I need a single equation number for. If someone could at least suggest a work around for me, I'd really appreciate it.

\begin{align}
P(t) &= \frac{\left(Re\left\{\overrightarrow{v}(t)\overrightarrow{i}(t)\right\} + Re\left\{\overrightarrow{v}(t)\overrightarrow{i}(t)^*\right\}\right)}{2} \nonumber \\
     &\qquad + \frac{\left(Re\left\{\overrightarrow{v}(t)\overrightarrow{i}(t)e^{-j\frac{4\pi}{3}}\right\} + Re\left\{\overrightarrow{v}(t)\overrightarrow{i}(t)^*\right\}\right)}{2} \\
     &\qquad + \frac{\left(Re\left\{\overrightarrow{v}(t)\overrightarrow{i}(t)e^{-j\frac{8\pi}{3}}\right\} + Re\left\{\overrightarrow{v}(t)\overrightarrow{i}(t)^*\right\}\right)}{2} \nonumber \\
\end{align}

Same problem for multiline equation

Best Answer

Just omit the line-break directive at the end of the final equation in a given align group. E.g.,

\begin{align}
    P(t) &= \tfrac{3}{2}[v_d(t)i_d(t)] \\
    Q(t) &= \tfrac{3}{2}[-v_d(t)i_q(t)] % <- no "\\" directive
\end{align}

As the code shows, I would also (a) remove the \left and \right qualifiers as they actually don't do anything for the cases at hand and (b) replace \frac with \tfrac.

If you have a multi-line equation that should be assigned just one equation number, don't use an align environment. Instead, use a split environment inside an equation environment.

By the way, the arrows produced by \overrightarrow look disproportionately large; consider using \vec instead. For arrows (and other diacritics) set above the characters i and j, it's traditional to omit the "dot", i.e., to use a "dotless" i and j; this may be achieved in math mode by writing \imath and \jmath. Separately, I again would not use \left and \right to autosize the round parentheses and curly braces; consider using \bigl and \bigr instead. (By the way, the outermost round parentheses may be omitted in all three rows, right?)

enter image description here

\documentclass{article}
\usepackage{amsmath}
\numberwithin{equation}{section}
\begin{document}

\setcounter{section}{1} % just for this example 
\setcounter{equation}{31}
\begin{align}
    P(t) &= \tfrac{3}{2}[v_d(t)i_d(t)] \\
    Q(t) &= \tfrac{3}{2}[-v_d(t)i_q(t)] 
\end{align}

\setcounter{equation}{20} % just for this example
\begin{equation}\begin{split}
P(t) 
&= \frac{
\Re\bigl\{\vec{v}(t)\vec{\imath}(t)\bigr\} + 
\Re\bigl\{\vec{v}(t)\vec{\imath}(t)^*\bigr\}}{2} \\
&\quad+ \frac{
\Re\bigl\{\vec{v}(t)\vec{\imath}(t)e^{-j\frac{4\pi}{3}}\bigr\} + 
\Re\bigl\{\vec{v}(t)\vec{\imath}(t)^*\bigr\}}{2} \\
&\quad+ \frac{
\Re\bigl\{\vec{v}(t)\vec{\imath}(t)e^{-j\frac{8\pi}{3}}\bigr\} + 
\Re\bigl\{\vec{v}(t)\vec{\imath}(t)^*\bigr\}}{2} 
\end{split}\end{equation}
\end{document}
Related Question