如何对齐这些方程式

如何对齐这些方程式

如何排列方程使得结果像图像那样?

在此处输入图片描述

\newcommand{\barU}{\bar{U}}
\newcommand{\barV}{\bar{V}}
\usepackage{amsmath}

\begin{align}
    \label{eq:mx2}
    \frac{\partial \barU}{\partial t} + \frac{\partial u}{\partial t} &= - \left[\barU\left(\frac{\partial \barU}{\partial x} 
    + \frac{\partial u}{\partial x}\right)
    + u\left(\frac{\partial \barU}{\partial x} + \frac{\partial u}{\partial x}\right) + \barV\left(\frac{\partial \barU}{\partial y} 
    + \frac{\partial u}{\partial y}
    \right) + v\left(\frac{\partial \barU}{\partial y} + \frac{\partial u}{\partial y}\right)\right] - \frac{\partial \barP}{\partial x} 
    - \frac{\partial p}{\partial x}
    + \\
    &\frac{1}{Re}\left(\frac{\partial^2\barU}{\partial x^2} + \frac{\partial^2u}{\partial x^2} + \frac{\partial^2 \barU}{\partial y^2} + 
    \frac{\partial^2u}{\partial y^2}\right) \nonumber
    \hspace{8ex}
    \mbox{direção x} \\
    %------------------------
    \label{eq:my2}
    \frac{\partial \barV}{\partial t} + \frac{\partial v}{\partial t} &= - \left[\barU\left(\frac{\partial \barV}{\partial x} + 
    \frac{\partial v}{\partial x}\right)
    + u\left(\frac{\partial \barV}{\partial x} + \frac{\partial v}{\partial x}\right) + \barV\left(\frac{\partial \barV}{\partial y} 
    + \frac{\partial v}{\partial y}
    \right) + v\left(\frac{\partial \barV}{\partial y} + \frac{\partial v}{\partial y}\right)\right] - \frac{\partial \barP}{\partial y} 
    - \frac{\partial p}{\partial y} + \\
    &\frac{1}{Re}\left(\frac{\partial^2\barV}{\partial x^2} + \frac{\partial^2v}{\partial x^2} + \frac{\partial^2\barV}{\partial y^2} 
    + \frac{\partial^2v}{\partial y^2}\right) \nonumber
    \hspace{8ex}
    \mbox{direção y} \\
    %-------------------------
    \frac{\partial \barU}{\partial x} + \frac{\partial u}{\partial x} + \frac{\partial \barV}{\partial y} + \frac{\partial v}{\partial y} = 0
    \hspace{18.8ex}
    &\hspace{8ex}
    \mbox{continuidade}
  \end{align}

答案1

我可以提出这种对齐方式。我添加了必要的代码以使用(可扩展)\widebar命令,而mathabx无需加载包,因为我认为它看起来比\bar大写字母更好。最后,我加载了它esdiff,它简化了使用其命令输入偏导数的过程\diffp

\documentclass[a4paper]{article}
\usepackage[showframe]{geometry}
\usepackage{mathtools, esdiff}
\usepackage{booktabs} 

\DeclareFontFamily{U}{mathx}{\hyphenchar\font45}
\DeclareFontShape{U}{mathx}{m}{n}{
<5><6><7><8><9><10>
<10.95><12><14.4><17.28><20.74><24.88>
mathx10
}{}
\DeclareSymbolFont{mathx}{U}{mathx}{m}{n}
\DeclareFontSubstitution{U}{mathx}{m}{n}
\DeclareMathAccent{\widebar}{0}{mathx}{"73}

\newcommand{\barU}{\widebar{U}}
\newcommand{\barV}{\widebar{V}}
\newcommand{\barP}{\widebar{P}}

\begin{document}

\begin{align}
    \label{eq:mx2}
    \diffp{\barU}{t} + \diffp{u}{t} &=\begin{aligned}[t] & - \left[\barU\left(\diffp{\barU}{x} + \diffp{u}{x}\right) + u\left(\diffp{\barU}{x} + \diffp{u}{x}\right) + \barV\left(\diffp{\barU}{y} + \diffp{u}{y} \right) + v\left(\diffp{\barU}{y} + \diffp{u}{y}\right)\right] \\
   & - \diffp{\bar P}{x} - \diffp{p}{x} +\frac{1}{Re}\left(\frac{\partial^2\barU}{\partial x^2} + \frac{\partial^2u}{\partial x^2} + \frac{\partial^2 \barU}{\partial y^2} + \frac{\partial^2u}{\partial y^2}\right) \hspace{8ex}
    \mbox{direção x} \end{aligned}\\[1.5ex]
 %------------------------
 \label{eq:my2}
 \diffp{\barV}{t} + \diffp{v}{t} &=\begin{aligned}[t] & - \left[\barU\left(\diffp{\barV}{x} + \diffp{v}{x}\right) + u\left(\diffp{\barV}{x} + \diffp{v}{x}\right) + \barV\left(\diffp{\barV}{y} + \diffp{v}{y} \right) + v\left(\diffp{\barV}{y} + \diffp{v}{y}\right)\right]\\
  & - \diffp{\bar P}{y} - \diffp{p}{y} + \frac{1}{Re}\left(\diffp[2]{\barV}{x} + \diffp[2]{v}{x} + \diffp[2]{\barV}{y} + \diffp[2]{v}{y}\right)
 \hspace{8ex}
 \mbox{direção y} \end{aligned} \\[1.5ex]
% %-------------------------
  \diffp{\barU}{x} + \diffp{u}{x} &+ \diffp{\barV}{y} + \diffp{v}{y} = 0
 \hspace{18.9em}
 \mbox{continuidade}
  \end{align}

\end{document} 

在此处输入图片描述

相关内容