如何修改具有长分子和正常分母的等式?

如何修改具有长分子和正常分母的等式?

我有一个来自 Mathematica 的长方程,其中分子很长,分母有正常元素。

\begin{equation}
P_1(t)= \frac{\exp \left(-\frac{1}{4} t \left(\sqrt{-6 \lambda _{\text{G1}} \mu _{\text{G1}}+\lambda _{\text{G1}}^2+\mu _{\text{G1}}^2}+3 \lambda _{\text{G1}}+3 \mu _{\text{G1}}\right)\right) \left(\lambda _{\text{G1}}^3 \left(\mu _{\text{G1}} \left(2 \exp \left(\frac{1}{4} t \left(\sqrt{-6 \lambda _{\text{G1}} \mu _{\text{G1}}+\lambda _{\text{G1}}^2+\mu _{\text{G1}}^2}+3 \lambda _{\text{G1}}+3 \mu _{\text{G1}}\right)\right)-4 e^{\frac{1}{2} t \sqrt{-6 \lambda _{\text{G1}} \mu _{\text{G1}}+\lambda _{\text{G1}}^2+\mu _{\text{G1}}^2}}-4\right)-\sqrt{-6 \lambda _{\text{G1}} \mu _{\text{G1}}+\lambda _{\text{G1}}^2+\mu _{\text{G1}}^2} \left(e^{\frac{1}{2} t \sqrt{-6 \lambda _{\text{G1}} \mu _{\text{G1}}+\lambda _{\text{G1}}^2+\mu _{\text{G1}}^2}}-1\right)\right)-\lambda _{\text{G1}}^2 \mu _{\text{G1}} \left(\mu _{\text{G1}} \left(10 \exp \left(\frac{1}{4} t \left(\sqrt{-6 \lambda _{\text{G1}} \mu _{\text{G1}}+\lambda _{\text{G1}}^2+\mu _{\text{G1}}^2}+3 \lambda _{\text{G1}}+3 \mu _{\text{G1}}\right)\right)+11 e^{\frac{1}{2} t \sqrt{-6 \lambda _{\text{G1}} \mu _{\text{G1}}+\lambda _{\text{G1}}^2+\mu _{\text{G1}}^2}}+11\right)+3 \sqrt{-6 \lambda _{\text{G1}} \mu _{\text{G1}}+\lambda _{\text{G1}}^2+\mu _{\text{G1}}^2} \left(e^{\frac{1}{2} t \sqrt{-6 \lambda _{\text{G1}} \mu _{\text{G1}}+\lambda _{\text{G1}}^2+\mu _{\text{G1}}^2}}-1\right)\right)+2 \lambda _{\text{G1}} \mu _{\text{G1}}^2 \left(\mu _{\text{G1}} \left(-5 \exp \left(\frac{1}{4} t \left(\sqrt{-6 \lambda _{\text{G1}} \mu _{\text{G1}}+\lambda _{\text{G1}}^2+\mu _{\text{G1}}^2}+3 \lambda _{\text{G1}}+3 \mu _{\text{G1}}\right)\right)+e^{\frac{1}{2} t \sqrt{-6 \lambda _{\text{G1}} \mu _{\text{G1}}+\lambda _{\text{G1}}^2+\mu _{\text{G1}}^2}}+1\right)+\sqrt{-6 \lambda _{\text{G1}} \mu _{\text{G1}}+\lambda _{\text{G1}}^2+\mu _{\text{G1}}^2} \left(e^{\frac{1}{2} t \sqrt{-6 \lambda _{\text{G1}} \mu _{\text{G1}}+\lambda _{\text{G1}}^2+\mu _{\text{G1}}^2}}-1\right)\right)+2 \mu _{\text{G1}}^4 \exp \left(\frac{1}{4} t \left(\sqrt{-6 \lambda _{\text{G1}} \mu _{\text{G1}}+\lambda _{\text{G1}}^2+\mu _{\text{G1}}^2}+3 \lambda _{\text{G1}}+3 \mu _{\text{G1}}\right)\right)+\lambda _{\text{G1}}^4 \left(e^{\frac{1}{2} t \sqrt{-6 \lambda _{\text{G1}} \mu _{\text{G1}}+\lambda _{\text{G1}}^2+\mu _{\text{G1}}^2}}+1\right)\right)}{2 \left(-3 \lambda _{\text{G1}}^3 \mu _{\text{G1}}-16 \lambda _{\text{G1}}^2 \mu _{\text{G1}}^2-3 \lambda _{\text{G1}} \mu _{\text{G1}}^3+\lambda _{\text{G1}}^4+\mu _{\text{G1}}^4\right)},
\end{equation}

答案1

可能的解决方案:

\documentclass{article}

\usepackage[margin = 2.5cm]{geometry}
\usepackage{amsmath}

\newcommand*\Index[1]{#1_{\text{G1}}}
\newcommand*\Expo{e^{\frac{1}{2}tW}}
\newcommand*\spc{\mkern -5mu}

\begin{document}

\noindent Set
\begin{align*}
  W
  = \sqrt{\Index{\lambda}^{2} + \Index{\mu}^{2} - 6\Index{\lambda}\Index{\mu}}
\end{align*}
and let
\begin{align*}
  P_{\text{num}}(t)
  &= \exp\spc\left(-\frac{1}{4}t\left(W + 3\Index{\lambda} + 3\Index{\mu}\right)\right)\\
  &\hphantom{{}=} \cdot \Biggl[\Index{\lambda}^{3}\biggl(\Index{\mu}\biggl(2\exp\spc\left(\frac{1}{4}t \left(W + 3\Index{\lambda} + 3\Index{\mu}\right)\right) - 4\Expo - 4\biggr) - W\left(\Expo - 1\right)\biggr)\\
  &\hphantom{{}= \cdot \Biggl[} - \Index{\lambda}^{2}\Index{\mu}\left(\Index{\mu} \left(10\exp\spc\left(\frac{1}{4}t\left(W + 3\Index{\lambda} + 3\Index{\mu}\right)\right) + 11\Expo + 11\right) + 3W\left(\Expo - 1\right)\right)\\
  &\hphantom{{}= \cdot \Biggl[} + 2\Index{\lambda}\Index{\mu}^{2}\left(\Index{\mu} \left(-5\exp\spc\left(\frac{1}{4}t\left(W + 3\Index{\lambda} + 3\Index{\mu}\right)\right) + \Expo + 1\right) + W\left(\Expo - 1\right)\right)\\
  &\hphantom{{}= \cdot \Biggl[} + 2\Index{\mu}^{4}\exp\spc\left(\frac{1}{4}t\left(W + 3\Index{\lambda} + 3\Index{\mu}\right)\right) + \Index{\lambda}^{4}\left(\Expo + 1\right)\Biggr]{\mkern -3mu},\\[0.5ex]
  P_{\text{denom}}(t)
  &= 2{\mkern -3mu}\left(\Index{\lambda}^{4} + \Index{\mu}^{4} - 3\Index{\lambda}^{3}\Index{\mu} - 3\Index{\lambda}\Index{\mu}^{3} - 16\Index{\lambda}^{2}\Index{\mu}^{2}\right){\mkern -3mu}.
\end{align*}
Then
\begin{equation*}
  P_{1}(t)
  = \frac{P_{\text{num}}(t)}{P_{\text{denom}}(t)}.
\end{equation*}

\end{document}

输出1

更新

这是一个改进的版本:

\documentclass{article}

\usepackage{amsmath}

\newcommand*\Index[1]{#1_{\text{G1}}}

\begin{document}

\noindent Set
\begin{align*}
  U
  &= \sqrt{\Index{\lambda}^{2} + \Index{\mu}^{2} - 6\Index{\lambda}\Index{\mu}},\\
  V
  &= \frac{1}{4}t(U + 3\Index{\lambda} + 3\Index{\mu}),\\
  W
  &= \exp{\mkern -8mu}\left(\frac{1}{2}tU\right){\mkern -5mu},
\end{align*}
and let
\begin{align*}
  P_{\text{num}}(t)
  &= \exp(-V)\\
  &\hphantom{{}=} \cdot \Bigl[\Index{\lambda}^{3}\bigl(2\Index{\mu}(\exp(V) - 2W - 2) - U(W - 1)\bigr)\\
  &\hphantom{{}= \cdot \Bigl[} - \Index{\lambda}^{2}\Index{\mu}\bigl(\Index{\mu} (10\exp(V) + 11W + 11) + 3U(W - 1)\bigr)\\
  &\hphantom{{}= \cdot \Bigl[} + 2\Index{\lambda}\Index{\mu}^{2}\bigl(\Index{\mu} (-5\exp(V) + W + 1) + U(W - 1)\bigr)\\
  &\hphantom{{}= \cdot \Bigl[} + 2\Index{\mu}^{4}\exp(V) + \Index{\lambda}^{4}(W + 1)\Bigr]{\mkern -3mu},\\[0.5ex]
  P_{\text{denom}}(t)
  &= 2{\mkern -3mu}\left(\Index{\lambda}^{4} + \Index{\mu}^{4} - 3\Index{\lambda}^{3}\Index{\mu} - 3\Index{\lambda}\Index{\mu}^{3} - 16\Index{\lambda}^{2}\Index{\mu}^{2}\right){\mkern -4mu}.
\end{align*}
Then
\begin{equation*}
  P_{1}(t)
  = \frac{P_{\text{num}}(t)}{P_{\text{denom}}(t)}.
\end{equation*}

\end{document}

输出2

更新 2

还有另一个版本:

\documentclass{article}

\usepackage{amsmath}

\newcommand*\Index[1]{#1_{\text{G1}}}

\begin{document}

\noindent Set
\begin{align*}
  U
  &= \sqrt{\Index{\lambda}^{2} + \Index{\mu}^{2} - 6\Index{\lambda}\Index{\mu}},\\
  V
  &= \frac{1}{4}t(U + 3\Index{\lambda} + 3\Index{\mu}),\\
  W
  &= \exp{\mkern -6.5mu}\left(\tfrac{1}{2}tU\right){\mkern -5mu},\\
  X
  &= \exp(V),\\
  Y
  &= U(W - 1),\\
  Z
  &= W + 1,
\end{align*}
and let
\begin{align*}
  P_{\text{num}}(t)
  &= \frac{1}{X}{\mkern -2mu}\Bigl[\Index{\lambda}^{3}\bigl(2\Index{\mu}(X - 2Z) - Y\bigr) - \Index{\lambda}^{2}\Index{\mu}\bigl(\Index{\mu} (10X + 11Z) + 3Y\bigr)\\
  &\hphantom{{}= \frac{1}{X}{\mkern -2mu}\Bigl[} + 2\Index{\lambda}\Index{\mu}^{2}\bigl(\Index{\mu} (-5X + Z) + Y\bigr) + 2\Index{\mu}^{4}X + \Index{\lambda}^{4}Z\Bigr]{\mkern -2mu},\\[0.5ex]
  P_{\text{denom}}(t)
  &= 2{\mkern -3mu}\left(\Index{\lambda}^{4} + \Index{\mu}^{4} - 3\Index{\lambda}\Index{\mu}{\mkern -4mu}\left(\Index{\lambda}^{2} + \Index{\mu}^{2}\right){\mkern -4mu} - 16\Index{\lambda}^{2}\Index{\mu}^{2}\right){\mkern -3mu}.
\end{align*}
Then
\begin{equation*}
  P_{1}(t)
  = \frac{P_{\text{num}}(t)}{P_{\text{denom}}(t)}.
\end{equation*}

\end{document}

输出3

我更喜欢这个解决方案。

答案2

我认为,就与读者沟通而言,将很长的分母拆分成多行较短的行没有什么好处。使用反复出现的更简单的符号来简化整个表达式可能更好。本质上,我建议比 Svend Tveskæg 走得更远。我使用BCD下面的;您可能可以想出更具描述性的符号……

在此处输入图片描述

\documentclass{article}
\usepackage{mathtools}
\newcommand\tg{\text{G1}}
\newcommand\ltg{\lambda_{\tg}}
\newcommand\mtg{\mu_{\tg}}
\begin{document}
\begin{equation}
P_1(t)= \frac{A}{E}
\end{equation}
where
\begin{align*}
A &= \exp \bigl[-\tfrac{1}{4} t (D+3 \ltg+3 \mtg)\bigr]\\
&\quad\times\Bigl\{\ltg^3
  \bigl[\mtg (2 B -4 e^{\frac{1}{2} t D}-4)
  -C\bigr]\\
&\qquad\quad  -\ltg^2 \mtg \bigl[\mtg (10 B+11 e^{\frac{1}{2} t D}+11)+3 C\bigr]\\
&\qquad\quad  +2 \ltg \mtg^2
  \bigl[\mtg (-5 B+e^{\frac{1}{2} t D}+1)+C\bigr]\\
&\qquad\quad  +2 \mtg^4 B\\
&\qquad\quad  +\ltg^4
  (e^{\frac{1}{2} t D}+1) \Bigr\}\,,\\
B&=\exp \bigl[\tfrac{1}{4} t (D+3 \ltg+3 \mtg)\bigr]\,,\\
C&=D \bigl[e^{\frac{1}{2} t D}-1\bigr]\,,\\
D&=\sqrt{-6 \ltg \mtg+\ltg^2+\mtg^2}\,,\\
\shortintertext{and}
E&= 2 \bigl[-3 \ltg^3 \mtg-16 \ltg^2 \mtg^2-3 \ltg \mtg^3+\ltg^4+\mtg^4\bigr],
\end{align*}
\end{document} 

相关内容