Replacing eqnarray
by align
the result is not perfectly aligned, but I looks like it is and I think nicer than with eqnarray
.
Following Ian's suggestion diag
and nondiag
are declared math operators. Also parenthesis sizes has been adjusted.
After Mico's comment a new command dotstar
has been declared. It's not clear for me what it does.
\documentclass{article}
\usepackage[fleqn]{amsmath}
\usepackage{txfonts}
\DeclareMathOperator{\diag}{diag}
\DeclareMathOperator{\nondiag}{nondiag}
\newcommand\dotstar{\mathbin{.*}}
\begin{document}
\begin{align}
\label{eq1}
\diag\frac{\partial P}{\partial \theta} & =
\diag\left(-\diag(V)\left[Gdiag(V)\sin(Abus)^{T}-B\diag(V)cos(Abus)^{T}\right]\right.
\nonumber\\
&\quad \left.-\diag(V).^{2}\diag\left(\diag(B)\right)\right) \\
\label{eq2}
\nondiag\frac{\partial P}{\partial \theta} & =
VV^{T}\dotstar G\dotstar\sin(Abus)-VV^{T}\dotstar B\dotstar\cos(Abus)
\end{align}
Replace the diagnol elements of the (\ref{eq2}) with the elements of the
(\ref{eq1}), we will get the complete $\partial P/\partial \theta$
\begin{align}
\label{eq3}
\diag\frac{\partial P}{\partial V} & =
\diag\left(G\diag(V)\cos(Abus)^{T}+B\diag(V)sin(Abus)^{T}\right.
\nonumber\\
&\quad +\Bigl.\diag(V)\diag\left(\diag(G)\right)\Bigr) \\
\label{eq4}
\nondiag\frac{\partial P}{\partial V}&=
\diag(V)G\dotstar\cos(Abus) + \diag(V)B\dotstar\sin(Abus)
\end{align}
Replace the diagnol elements of the (\ref{eq4}) with the elements of the
(\ref{eq3}), we will get the complete $\partial P/\partial V$
\end{document}
But if you want all equations perfectly aligned, insert the middle paragraph inside a \intertext
command.
\documentclass{article}
\usepackage[fleqn]{amsmath}
\usepackage{txfonts}
\DeclareMathOperator{\diag}{diag}
\DeclareMathOperator{\nondiag}{nondiag}
\newcommand\dotstar{\mathbin{.*}}
\begin{document}
\begin{align}
\label{eq1}
\diag\frac{\partial P}{\partial \theta} & =
\diag\left(-\diag(V)\left[Gdiag(V)\sin(Abus)^{T}-B\diag(V)cos(Abus)^{T}\right]\right.
\nonumber\\
&\quad \left.-\diag(V).^{2}\diag\left(\diag(B)\right)\right) \\
\label{eq2}
\nondiag\frac{\partial P}{\partial \theta} & =
VV^{T}\dotstar G\dotstar\sin(Abus)-VV^{T}\dotstar B\dotstar\cos(Abus)
%\end{align}
\intertext{Replace the diagnol elements of the (\ref{eq2}) with the elements of the
(\ref{eq1}), we will get the complete $\partial P/\partial \theta$}
%\begin{align}
\label{eq3}
\diag\frac{\partial P}{\partial V} & =
\diag\left(G\diag(V)\cos(Abus)^{T}+B\diag(V)sin(Abus)^{T}\right.
\nonumber\\
&\quad +\Bigl.\diag(V)\diag\left(\diag(G)\right)\Bigr) \\
\label{eq4}
\nondiag\frac{\partial P}{\partial V}&=
\diag(V)G\dotstar\cos(Abus) + \diag(V)B\dotstar\sin(Abus)
\end{align}
Replace the diagnol elements of the (\ref{eq4}) with the elements of the
(\ref{eq3}), we will get the complete $\partial P/\partial V$
\end{document}
.*
do? Is it even an operator? Similarly, what does.^{2}
do?