如何格式化长方程组

如何格式化长方程组

我想知道如何格式化需要分解方程的长方程组。我想复制这个 在此处输入图片描述

以下是输入的 3 个方程式:

    \begin{equation}
    \frac{\partial u_r}{\partial t}+u_r\frac{\partial u_r}{\partial r}+\frac{u_{\theta }}{r}\frac{\partial u_r}{\partial \theta }-\frac{u_{\theta }^2}{r}+u_z\frac{\partial u_r}{\partial z}=\frac{\mu }{\rho \:}\left[\frac{\partial }{\partial r}\left(\frac{1}{r}\frac{\partial }{\partial r}\left(ru_r\right)\right)+\frac{1}{r^2}\frac{\partial ^2u_r}{\partial \theta ^2}+\frac{\partial ^2u_r}{\partial z^2}-\frac{2}{r^2}\frac{\partial u_{\theta }}{\partial \theta }\right]-\frac{1}{\rho }\frac{\partial P}{\partial r}
\end{equation}

\begin{equation}
    \frac{\partial u_{\theta }}{\partial t}+u_r\frac{\partial u_{\theta }}{\partial r}+\frac{u_{\theta }}{r}\frac{\partial u_{\theta }}{\partial \theta }-\frac{u_ru_{\theta }}{r}+u_z\frac{\partial u_{\theta }}{\partial z}=\frac{\mu }{\rho \:}\left[\frac{\partial }{\partial r}\left(\frac{1}{r}\frac{\partial }{\partial r}\left(ru_{\theta }\right)\right)+\frac{1}{r^2}\frac{\partial ^2u_{\theta }}{\partial \theta ^2}+\frac{\partial ^2u_{\theta }}{\partial z^2}+\frac{2}{r^2}\frac{\partial u_{\theta }}{\partial \theta }\right]-\frac{1}{r\rho }\frac{\partial P}{\partial \theta }
\end{equation}

\begin{equation}
    \frac{\partial u_z}{\partial t}+u_r\frac{\partial u_z}{\partial r}+\frac{u_{\theta }}{r}\frac{\partial u_z}{\partial \theta }+u_z\frac{\partial u_z}{\partial z}=\frac{\mu }{\rho \:}\left[\frac{1}{r}\frac{\partial }{\partial r}\left(r\frac{\partial u_z}{\partial \:r}\right)+\frac{1}{r^2}\frac{\partial ^2u_z}{\partial \theta ^2}+\frac{\partial ^2u_z}{\partial z^2}\right]-\frac{1}{\rho }\frac{\partial P}{\partial \theta }+g_z
\end{equation}

我可以单独分解方程式,但我不知道如何按照上面显示的格式列出它们。任何帮助都可以。谢谢。

答案1

像这样:

在此处输入图片描述

我使用过align*来自数学在第一个 + 号后使用对齐和一些\notag命令来抑制中间方程编号的软件包。与 OP 不同,我强烈建议等号应位于方程的第二行开头,而不是第一行末尾。

以下是代码:

\documentclass{article}
\usepackage{amsmath}
\begin{document}

   \begin{align}
      \frac{\partial u_r}{\partial t}+&u_r\frac{\partial u_r}{\partial r}
        +\frac{u_{\theta }}{r}\frac{\partial u_r}{\partial \theta }
        -\frac{u_{\theta }^2}{r}+u_z\frac{\partial u_r}{\partial z}
      \\ &=\frac{\mu }{\rho \:}\left[\frac{\partial }{\partial r}
          \left(\frac{1}{r}\frac{\partial }{\partial r}\left(ru_r\right)\right)
            +\frac{1}{r^2}\frac{\partial ^2u_r}{\partial \theta ^2}
            +\frac{\partial ^2u_r}{\partial z^2}
            -\frac{2}{r^2}\frac{\partial u_{\theta }}{\partial \theta }\right]
            -\frac{1}{\rho }\frac{\partial P}{\partial r}\notag\\
      \frac{\partial u_{\theta }}{\partial t}+&u_r\frac{\partial u_{\theta }}{\partial r}
           +\frac{u_{\theta }}{r}\frac{\partial u_{\theta }}{\partial \theta }
                -\frac{u_ru_{\theta }}{r}+u_z\frac{\partial u_{\theta }}{\partial z}\\
        &=\frac{\mu }{\rho \:}\left[\frac{\partial }{\partial r}
              \left(\frac{1}{r}\frac{\partial }{\partial r}\left(ru_{\theta }\right)\right)
              +\frac{1}{r^2}\frac{\partial ^2u_{\theta }}{\partial \theta ^2}
              +\frac{\partial ^2u_{\theta }}{\partial z^2}
              +\frac{2}{r^2}\frac{\partial u_{\theta }}{\partial \theta }\right]
              -\frac{1}{r\rho }\frac{\partial P}{\partial \theta }
      \notag\\
      \frac{\partial u_z}{\partial t}+&u_r\frac{\partial u_z}{\partial r}
          +\frac{u_{\theta }}{r}\frac{\partial u_z}{\partial \theta }
              +u_z\frac{\partial u_z}{\partial z}\\
          &=\frac{\mu }{\rho \:}\left[\frac{1}{r}\frac{\partial }{\partial r}
              \left(r\frac{\partial u_z}{\partial \:r}\right)
                  +\frac{1}{r^2}\frac{\partial ^2u_z}{\partial \theta ^2}
                      +\frac{\partial ^2u_z}{\partial z^2}\right]
                          -\frac{1}{\rho }\frac{\partial P}{\partial \theta }+g_z\notag
  \end{align}

\end{document}

答案2

另一个带有对齐的代码,但包括左侧的描述,以及带有diffcoeff包的更简单的语法:

\documentclass{article}
\usepackage{geometry} 
\usepackage{amsmath}
\usepackage{diffcoeff} 

\begin{document}

\begin{align}
r\text{-momentum:} & & & \diffp{u_r}{t} + u_r\diffp{u_r}{r} + \frac{u_{\theta }}{r}\diffp{u_r}{\theta }-\frac{u_{\theta }^2}{r} + u_z\diffp{u_r}{z} = \\
\notag & & & \frac{\mu }{\rho \:}\left[\diffp{}{r}\left(\frac{1}{r}\diffp{}{r}\left(ru_r\right)\right) + \frac{1}{r^2}\diffp[2]{u_r}{\theta} + \diffp[2]{u_r}{z}-\frac{2}{r^2}\diffp{u_{\theta }}{\theta }\right]-\frac{1}{\rho }\diffp{P}{r}\\[2ex]
%
\theta\text{-momentum:} & & & \diffp{u_{\theta }}{t} + u_r\diffp{u_{\theta }}{r} + \frac{u_{\theta }}{r}\diffp{u_{\theta }}{\theta }-\frac{u_ru_{\theta }}{r} + u_z\diffp{u_{\theta }}{z} = \\
\notag & & & \frac{\mu }{\rho \:}\left[\diffp{}{r}\left(\frac{1}{r}\diffp{}{r}\left(ru_{\theta }\right)\right) + \frac{1}{r^2}\diffp[2]{u_{\theta }}{\theta} + \diffp[2]{u_{\theta }}{z} + \frac{2}{r^2}\diffp{u_{\theta }}{\theta }\right]-\frac{1}{r\rho }\diffp{P}{\theta } \\[2ex]
%
z\text{-momentum:} & & & \diffp{u_z}{t} + u_r\diffp{u_z}{r} + \frac{u_{\theta }}{r}\diffp{u_z}{\theta } + u_z\diffp{u_z}{z} = \\
 \notag & & & \frac{\mu }{\rho \:}\left[\frac{1}{r}\diffp{}{r}\left(r\diffp{u_z}{\:r}\right) + \frac{1}{r^2}\diffp[2]{u_z}{\theta} + \diffp[2]{u_z}{z}\right]-\frac{1}{\rho }\diffp{P}{\theta } + g_z
\end{align}

\end{document}

在此处输入图片描述

相关内容