Eu escrevi o problema de otimização em anexo. Mas, como pode ser visto, as equações (1c)-(1j) são muito próximas uma da outra. Quero adicionar um pequeno espaço entre cada equação. Qual é a maneira mais legal de fazer isso?
Muito obrigado!!
\documentclass[review,12pt]{elsarticle}
\usepackage{array}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{setspace}
\usepackage{subfigure}
\DeclareMathOperator{\Tr}{Tr}
\DeclareMathOperator{\rank}{rank}
\DeclareMathOperator{\diag}{diag}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{footnote}
\makesavenoteenv{tabular}
\makesavenoteenv{table}
\newcommand{\tightermath}{%
\setlength{\thickmuskip}{.3\thickmuskip}
\setlength{\medmuskip}{.3\medmuskip}
\setlength{\thinmuskip}{.3\thinmuskip}}
\onehalfspacing
\begin{document}
\begin{figure}[h]
\begin{subequations}
\setlength\parindent{0pt}
\rule{\columnwidth}{1pt}
\textbf{M2:} \textbf{SDP-based OPF} \\
\rule[1ex]{\columnwidth}{1pt}
\vspace*{-1.5\baselineskip}
\begin{flalign}
\mathbf{M2: } \underset{\Psi}{\mathbf{minimize}}\ f(\Psi)&&&
\end{flalign}
\vspace*{-1.5\baselineskip}
\begin{flalign}
&\mathbf{variable:}\hspace{1em}\mathbf{W}&\\
& \hspace{5.7em}P_{g_k}^\varphi, Q_{g_k}^\varphi \hspace{2em}\forall \varphi \in \eta_{k}, \forall k \in N & \nonumber
\end{flalign}
$\mathbf{subject}$ $\mathbf{to:}$
\begin{flalign}
& \Tr(\mathbf{\Psi}_{k,nw_p}^\varphi \mathbf{W}) + P_{l_k}^\upsilon = 0, \hspace{11.7em}\forall \varphi \in \eta_k, \upsilon \in \chi_k, k \in N\backslash G \label{eq:PBL2}\\
& \Tr(\mathbf{\Psi}_{k,nw_q}^\varphi \mathbf{W}) + Q_{l_k}^\upsilon-y_{c_k}^\upsilon \Tr(\mathbf{\Psi}_{k,nw_v}^\varphi\mathbf{W}) = 0, \hspace{3em}\forall \varphi \in \eta_k, \upsilon \in \chi_k, k \in N\backslash G \label{eq:QBL2} \\
& \underline{P}_{g_i} \leq \Tr(\mathbf{\Psi}_{i,nw_p}^\varphi \mathbf{W}) {+} P_{l_i}^\upsilon \leq \overline{P}_{g_i}, \hspace{8.8em}\forall \varphi \in \eta_i, \upsilon \in \chi_i, i \in G \label{eq:PBG2}\\
& \underline{Q}_{g_i} \leq \Tr(\mathbf{\Psi}_{i,nw_q}^\varphi \mathbf{W}) {+} Q_{l_i}^\upsilon \leq \overline{Q}_{g_i}, \hspace{8.8em}\forall \varphi \in \eta_i, \upsilon \in \chi_i, i \in G \label{eq:QBG2}\\
& (\underline{V}_k)^2 \leq \Tr(\mathbf{\Psi}_{k,nw_v}^\varphi \mathbf{W}) \leq (\overline{V_k})^2, \hspace{9.0em}\forall \varphi \in \eta_k, k \in N^+ \label{eq:Vol2} \\
& [\mathbf{W}]_{\eta_0 \times \eta_0} = \mathbf{V}_0 \mathbf{V}_0^H \\
& \mathbf{W} \succeq 0, \\
& \rank(\mathbf{W}) = 1 \label{rank_con}
\end{flalign}
\rule[1ex]{\columnwidth}{1pt}
\end{subequations}
\end{figure}
\end{document}
Responder1
As linhas são particularmente estreitas por causa de \onehalfspacing
. Remova.
\documentclass[review,12pt]{elsarticle}
\usepackage{amsmath}
\DeclareMathOperator{\Tr}{Tr}
\DeclareMathOperator{\rank}{rank}
\DeclareMathOperator{\diag}{diag}
\begin{document}
\begin{figure}[ht]
\setlength{\abovedisplayskip}{0pt}
\setlength{\belowdisplayskip}{0pt}
\begin{subequations}
\hrule height 1pt\kern6pt
\textbf{M2:} \textbf{SDP-based OPF}
\kern6pt\hrule height 1pt
\begin{flalign}
&\textbf{M2: } \operatorname*{\mathbf{minimize}}_{\Psi} f(\Psi)&& \\
&\textbf{variable:}\quad
\begin{aligned}[t]
&\mathbf{W}\\[-\jot]
&P_{g_k}^\varphi, Q_{g_k}^\varphi \qquad \forall \varphi \in \eta_{k}, \forall k \in N
\end{aligned} &&
\\
& \textbf{subject to:} && \nonumber
\\
&\! \Tr(\mathbf{\Psi}_{k,nw_p}^\varphi \mathbf{W}) + P_{l_k}^\upsilon = 0,
&& \forall \varphi \in \eta_k, \upsilon \in \chi_k, k \in N\backslash G
\label{eq:PBL2}
\\
&\! \Tr(\mathbf{\Psi}_{k,nw_q}^\varphi \mathbf{W})
+ Q_{l_k}^\upsilon-y_{c_k}^\upsilon \Tr(\mathbf{\Psi}_{k,nw_v}^\varphi\mathbf{W}) = 0,
&&\forall \varphi \in \eta_k, \upsilon \in \chi_k, k \in N\backslash G
\label{eq:QBL2}
\\
& \underline{P}_{g_i} \leq \Tr(\mathbf{\Psi}_{i,nw_p}^\varphi \mathbf{W})
+ P_{l_i}^\upsilon \leq \overline{P}_{g_i},
&&\forall \varphi \in \eta_i, \upsilon \in \chi_i, i \in G
\label{eq:PBG2}
\\
& \underline{Q}_{g_i} \leq \Tr(\mathbf{\Psi}_{i,nw_q}^\varphi \mathbf{W})
+ Q_{l_i}^\upsilon \leq \overline{Q}_{g_i},
&&\forall \varphi \in \eta_i, \upsilon \in \chi_i, i \in G
\label{eq:QBG2}
\\
& (\underline{V}_k)^2 \leq \Tr(\mathbf{\Psi}_{k,nw_v}^\varphi \mathbf{W}) \leq (\overline{V_k})^2,
&&\forall \varphi \in \eta_k, k \in N^+
\label{eq:Vol2}
\\
& [\mathbf{W}]_{\eta_0 \times \eta_0} = \mathbf{V}_0 \mathbf{V}_0^H
\\
& \mathbf{W} \succeq 0,
\\
&\! \rank(\mathbf{W}) = 1
\label{rank_con}
\end{flalign}
\kern6pt\hrule height 1pt
\end{subequations}
\end{figure}
\end{document}
Fiz também algumas outras alterações para evitar adivinhar os espaços.
Responder2
Aumentar o espaço entre duas linhas individuais é feito anexando um valor a \\
, por exemplo
\\[2ex]
Se você quiser fazer isso para todas as linhas de um display, então o TeX simples tem o comando \openup
normalmente usado como
\openup 2\jot
onde \jot
é uma quantidade padrão de espaço. Isso amsmath
está embutido internamente nos comandos, e para chegar lá você precisa ajustar a macro \spread@equation
. O código abaixo é 3\jot
por exagero.
\documentclass{article}
\usepackage[fleqn]{amsmath}
\DeclareMathOperator{\Tr}{Tr}
\DeclareMathOperator{\rank}{rank}
\setlength{\mathindent}{0pt}
\begin{document}
\begin{subequations}
\setlength{\parindent}{0pt} \setlength{\abovedisplayskip}{0pt}
\setlength{\belowdisplayskip}{0pt}
\makeatletter
\def\spread@equation{\reset@strutbox@
\openup3\jot \let\spread@equation\@empty}
\makeatother
\rule{\columnwidth}{1pt}
\textbf{M2:} \textbf{SDP-based OPF}
\rule[1ex]{\columnwidth}{1pt}
\begin{gather}
\textbf{M2:} \qquad \operatorname*{minimize}_{\Psi} f(\Psi)\\
\textbf{variables:} \quad\begin{aligned}[t] &\mathbf{W}\\
&P_{g_k}^\varphi, Q_{g_k}^\varphi \qquad \forall \varphi \in
\eta_{k}, \forall k \in N
\end{aligned}\\
\textbf{subject to:} \nonumber\\
\Tr(\mathbf{\Psi}_{k,nw_p}^\varphi \mathbf{W}) + P_{l_k}^\upsilon
= 0, \qquad\forall \varphi \in \eta_k, \upsilon \in \chi_k, k \in
N\backslash G,
\label{eq:PBL2}\\
\Tr(\mathbf{\Psi}_{k,nw_q}^\varphi \mathbf{W}) +
Q_{l_k}^\upsilon-y_{c_k}^\upsilon
\Tr(\mathbf{\Psi}_{k,nw_v}^\varphi\mathbf{W}) = 0, \quad\forall
\varphi \in \eta_k, \upsilon \in \chi_k, k \in
N\backslash G \label{eq:QBL2}, \\
\underline{P}_{g_i} \leq \Tr(\mathbf{\Psi}_{i,nw_p}^\varphi
\mathbf{W}) {+} P_{l_i}^\upsilon \leq \overline{P}_{g_i},
\qquad\forall \varphi \in \eta_i, \upsilon \in \chi_i, i \in
G, \label{eq:PBG2}\\
\underline{Q}_{g_i} \leq \Tr(\mathbf{\Psi}_{i,nw_q}^\varphi
\mathbf{W}) {+} Q_{l_i}^\upsilon \leq \overline{Q}_{g_i},
\qquad\forall \varphi \in \eta_i, \upsilon \in \chi_i, i \in
G, \label{eq:QBG2}\\
(\underline{V}_k)^2 \leq \Tr(\mathbf{\Psi}_{k,nw_v}^\varphi
\mathbf{W}) \leq (\overline{V_k})^2, \qquad\forall \varphi \in
\eta_k, k \in N^+, \label{eq:Vol2} \\
[\mathbf{W}]_{\eta_0 \times \eta_0} = \mathbf{V}_0 \mathbf{V}_0^H \\
\mathbf{W} \succeq 0, \\
\rank(\mathbf{W}) = 1. \label{rank_con}
\end{gather}
\rule[1ex]{\columnwidth}{1pt}
\end{subequations}
\end{document}
Observe que eliminei parte do espaço vertical ajustando variáveis internas em vez de adicionar \vspace
comandos ad hoc.