1

I am writing a general optimization problem using beamer environment. However, my objective function and all other constraints are right justified. Since some constraints equations are big as compared to other, the resulting output does not look good. What I want is to make a center justification of all my equations. Can anyone tell me how to do it?

\begin{equation*}
\begin{aligned}
& \color{red} \underset{\textbf{X}}{\text{minimize}}
& \color{red} \sum_{k\in G} \eta_k \\
& \text{subject to}
& P_{Gk}^{min}-P_{D_k} \leqslant Tr\{\textbf{Y}_kW\}\leqslant P_{Gk}^{max}-P_{D_k}\\
&& Q_{Gk}^{min}-Q_{D_k} \leqslant Tr\{\bar{\textbf{Y}}_kW\}\leqslant Q_{Gk}^{max}-Q_{D_k}\\
&& (V_{k}^{min})^2 \leqslant Tr\{M_kW\}\leqslant (V_{k}^{max})^2 \\
&& Tr\{M_{lm}W\}  \leqslant (\Delta V_{lm}^{max})^2\\
&&\begin{bmatrix}
\alpha Tr\{\textbf{Y}_kW\}-\eta_k+a_k & \sqrt{\gamma}Tr\{\textbf{Y}_kW\} +b_k\\
\sqrt{\gamma}Tr\{\textbf{Y}_kW\} +b_k & -1
\end{bmatrix} \preceq 0\\
&& \begin{bmatrix}
-(S_{lm,max})^2 & Tr\{\textbf{Y}_{lm}W\}&Tr\{\bar{\textbf{Y}}_{lm}W\}\\
Tr\{\textbf{Y}_{lm}W\}& -1 & 0\\
Tr\{\bar{\textbf{Y}}_{lm}W\} & 0 &-1\\
\end{bmatrix}\preceq 0
\end{aligned}
\end{equation*}
  • 1
    Welcome to TeX.SX! Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – BambOo Sep 5 '18 at 8:34
1

Here is one way to format it. Note that the first two lines overlap the constraints.

\documentclass{article}
\usepackage{mathtools,amssymb}
\usepackage{xcolor}
\usepackage{showframe}% debug only
\begin{document}


\begin{flalign*}
\mathrlap{\color{red} \underset{\textbf{X}}{\text{minimize}} \sum_{k\in G} \eta_k} &&&& \\
\rlap{subject to}
&& P_{Gk}^{\min}-P_{D_k} \leqslant Tr\{\textbf{Y}_kW\}&\leqslant P_{Gk}^{max}-P_{D_k} \\
&& Q_{Gk}^{min}-Q_{D_k} \leqslant Tr\{\bar{\textbf{Y}}_kW\}&\leqslant Q_{Gk}^{max}-Q_{D_k}\\
&& (V_{k}^{min})^2 \leqslant Tr\{M_kW\}&\leqslant (V_{k}^{max})^2 \\
&& Tr\{M_{lm}W\}  &\leqslant (\Delta V_{lm}^{max})^2\\
&& \begin{bmatrix}
\alpha Tr\{\textbf{Y}_kW\}-\eta_k+a_k & \sqrt{\gamma}Tr\{\textbf{Y}_kW\} +b_k\\
\sqrt{\gamma}Tr\{\textbf{Y}_kW\} +b_k & -1
\end{bmatrix} &\preceq 0\\
&& \begin{bmatrix}
-(S_{lm,max})^2 & Tr\{\textbf{Y}_{lm}W\}&Tr\{\bar{\textbf{Y}}_{lm}W\}\\
Tr\{\textbf{Y}_{lm}W\}& -1 & 0\\
Tr\{\bar{\textbf{Y}}_{lm}W\} & 0 &-1\\
\end{bmatrix}&\preceq 0
\end{flalign*}
\end{document}

demo

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.