如何在同一行格式化两个方程式,然后继续使用下面其中一个方程式?

如何在同一行格式化两个方程式,然后继续使用下面其中一个方程式?

这是我的代码:

The Lagrangian \eqref{eq:14} differentiated according to \eqref{eq:15} gives the equation of motion in terms of linear acceleration $\ddot{x}$:
\begin{align} \label{eq:17}
\frac{d}{dt}\left(\frac{\partial L}{\partial \dot{x}}\right) =\frac{\partial L}{\partial x} \Rightarrow \qquad \qquad \frac{d}{dt}(m\dot{x})=m(l+x)^2\dot{\theta}^2-kx+mg\cos\theta \nonumber \\ 
m\ddot{x}=m(l+x)^2\dot{\theta}^2-kx+mg\cos\theta \nonumber \\
\ddot{x} = (l+x)^2\dot{\theta}^2-\frac{k}{m}x+g\cos\theta.
\end{align} 
The same process is done according to \eqref{eq:16} to generate the equation of motion with respect to $\ddot{\theta}$:
\begin{align} \label{eq:18}
\frac{d}{dt}\left(\frac{\partial L}{\partial \dot{\theta}}\right) =\frac{\partial L}{\partial \theta} \Rightarrow \qquad \qquad \frac{d}{dt}[m(l+x)^2\dot{\theta}] = -mg(l+x)\sin\theta \nonumber \\
m(l+x)^2\ddot{\theta}+2m(l+x)\dot{x}\dot{\theta} = -mg(l+x)\sin\theta \nonumber \\
(l+x)\ddot{\theta}+2\dot{x}\dot{\theta} = -g\sin\theta \nonumber \\
\ddot{\theta}=\frac{-g\sin\theta-2\dot{x}\dot{\theta}}{l+x}
\end{align}

输出结果如下:在此处输入图片描述

我希望右侧的方程组对齐(不一定与其他系统对齐,而是在其自身内对齐),并且不与左侧的方程垂直重叠(第二个系统目前就是这样)。有人能告诉我如何做到这一点吗?如果不清楚,请见谅。

答案1

欢迎来到 TeX.SE!您已经为此拨通了正确的环境,align但实际上并没有使用它。要使用它,您需要使用设置对齐点&。因此,对于第一个近似值,我想建议。

\documentclass{article}
\usepackage{amsmath}
\begin{document}
The Lagrangian \eqref{eq:14} differentiated according to \eqref{eq:15} gives the equation of motion in terms of linear acceleration $\ddot{x}$:
\begin{align} \label{eq:17}
\frac{d}{dt}\left(\frac{\partial L}{\partial \dot{x}}\right)& =\frac{\partial
L}{\partial x} &\Rightarrow \qquad \qquad \frac{d}{dt}(m\dot{x})&=m(l+x)^2\dot{\theta}^2-kx+mg\cos\theta \nonumber \\ 
&& m\ddot{x}&=m(l+x)^2\dot{\theta}^2-kx+mg\cos\theta \nonumber \\
&& \ddot{x} &= (l+x)^2\dot{\theta}^2-\frac{k}{m}x+g\cos\theta.
\end{align} 
The same process is done according to \eqref{eq:16} to generate the equation of motion with respect to $\ddot{\theta}$:
\begin{align} \label{eq:18}
\frac{d}{dt}\left(\frac{\partial L}{\partial \dot{\theta}}\right)&
=\frac{\partial L}{\partial \theta} &\Rightarrow \qquad \qquad
\frac{d}{dt}[m(l+x)^2\dot{\theta}] &= -mg(l+x)\sin\theta \nonumber \\
&&m(l+x)^2\ddot{\theta}+2m(l+x)\dot{x}\dot{\theta}& = -mg(l+x)\sin\theta \nonumber \\
&& (l+x)\ddot{\theta}+2\dot{x}\dot{\theta} &= -g\sin\theta \nonumber \\
&& \ddot{\theta}&=\frac{-g\sin\theta-2\dot{x}\dot{\theta}}{l+x}
\end{align}
\end{document}

在此处输入图片描述

另一种可能性也采用了物理学中常见的直立微分d,并且\ell可以更好地与 1 区分开来,即

\documentclass{article}
\usepackage{amsmath}
\newcommand\dd{\mathrm{d}}
\begin{document}
The Lagrangian \eqref{eq:14} differentiated according to \eqref{eq:15} gives the equation of motion in terms of linear acceleration $\ddot{x}$:
\begin{align} \label{eq:17}
\frac{\mathrm{d}}{\mathrm{d}t}\left(\frac{\partial L}{\partial \dot{x}}\right)& =\frac{\partial
L}{\partial x} \quad\Rightarrow &
\frac{\mathrm{d}}{\mathrm{d}t}(m\dot{x})&=m(\ell+x)^2\dot{\theta}^2-kx+mg\cos\theta \nonumber \\ 
&& m\ddot{x}&=m(\ell+x)^2\dot{\theta}^2-kx+mg\cos\theta \nonumber \\
&& \ddot{x} &= (\ell+x)^2\dot{\theta}^2-\frac{k}{m}x+g\cos\theta.
\end{align} 
The same process is done according to \eqref{eq:16} to generate the equation of motion with respect to $\ddot{\theta}$:
\begin{align} \label{eq:18}
\frac{\mathrm{d}}{\mathrm{d}t}\left(\frac{\partial L}{\partial \dot{\theta}}\right)&
=\frac{\partial L}{\partial \theta} \quad\Rightarrow & 
\frac{\mathrm{d}}{\mathrm{d}t}[m(\ell+x)^2\dot{\theta}] &= -mg(\ell+x)\sin\theta \nonumber \\
&&m(\ell+x)^2\ddot{\theta}+2m(\ell+x)\dot{x}\dot{\theta}& = -mg(\ell+x)\sin\theta \nonumber \\
&& (\ell+x)\ddot{\theta}+2\dot{x}\dot{\theta} &= -g\sin\theta \nonumber \\
&& \ddot{\theta}&=\frac{-g\sin\theta-2\dot{x}\dot{\theta}}{\ell+x}
\end{align}
\end{document}

在此处输入图片描述

答案2

这里有两个选项:自行对齐系统,或跨文本分隔符对齐系统(使用\intertext):

在此处输入图片描述

\documentclass{article}

\usepackage{amsmath}

\begin{document}

The Lagrangian~(14) differentiated according to~(15) gives the equation of motion in terms of linear acceleration~$\ddot{x}$:
\begin{align}
  \frac{\mathrm{d}}{\mathrm{d}t} \biggl( \frac{\partial L}{\partial \dot{x}} \biggr) 
    &= \frac{\partial L}{\partial x} \Rightarrow 
    & \frac{\mathrm{d}}{\mathrm{d}t} (m \dot{x}) &= m(l + x)^2 \dot{\theta}^2 - kx + mg \cos\theta \nonumber \\
    & &                                m\ddot{x} &= m(l + x)^2 \dot{\theta}^2 - kx + mg \cos\theta \nonumber \\
    & &                                 \ddot{x} &= (l + x)^2 \dot{\theta}^2 - \frac{k}{m} x + g \cos\theta.
\end{align}
The same process is done according to~(16) to generate the equation of motion with respect to~$\ddot{\theta}$:%
\begin{align}
  \frac{\mathrm{d}}{\mathrm{d}t} \biggl( \frac{\partial L}{\partial \dot{\theta}} \biggr) 
    &= \frac{\partial L}{\partial \theta} \Rightarrow 
    &    \frac{\mathrm{d}}{\mathrm{d}t} [m (l + x)^2 \dot{\theta}] &= -mg (l + x) \sin\theta \nonumber \\
    & & m(l + x)^2 \ddot{\theta} + 2m (l + x) \dot{x} \dot{\theta} &= -mg (l + x) \sin\theta \nonumber \\
    & &             (l + x) \ddot{\theta} + 2 \dot{x} \dot{\theta} &= -g \sin\theta \nonumber \\
    & &                                              \ddot{\theta} &= \frac{-g \sin\theta - 2\dot{x} \dot{\theta}}{l + x}
\end{align}

\noindent\hrulefill

The Lagrangian~(14) differentiated according to~(15) gives the equation of motion in terms of linear acceleration~$\ddot{x}$:
\begin{align}
  \frac{\mathrm{d}}{\mathrm{d}t} \biggl( \frac{\partial L}{\partial \dot{x}} \biggr) 
    &= \frac{\partial L}{\partial x} \Rightarrow 
    & \frac{\mathrm{d}}{\mathrm{d}t} (m \dot{x}) &= m(l + x)^2 \dot{\theta}^2 - kx + mg \cos\theta \nonumber \\
    & &                                m\ddot{x} &= m(l + x)^2 \dot{\theta}^2 - kx + mg \cos\theta \nonumber \\
    & &                                 \ddot{x} &= (l + x)^2 \dot{\theta}^2 - \frac{k}{m} x + g \cos\theta. \\
\intertext{%
The same process is done according to~(16) to generate the equation of motion with respect to~$\ddot{\theta}$:%
}
  \frac{\mathrm{d}}{\mathrm{d}t} \biggl( \frac{\partial L}{\partial \dot{\theta}} \biggr) 
    &= \frac{\partial L}{\partial \theta} \Rightarrow 
    &    \frac{\mathrm{d}}{\mathrm{d}t} [m (l + x)^2 \dot{\theta}] &= -mg (l + x) \sin\theta \nonumber \\
    & & m(l + x)^2 \ddot{\theta} + 2m (l + x) \dot{x} \dot{\theta} &= -mg (l + x) \sin\theta \nonumber \\
    & &             (l + x) \ddot{\theta} + 2 \dot{x} \dot{\theta} &= -g \sin\theta \nonumber \\
    & &                                              \ddot{\theta} &= \frac{-g \sin\theta - 2\dot{x} \dot{\theta}}{l + x}
\end{align}

\end{document}

由于您的文档设置似乎提供了更宽的文本块,因此方程式编号对齐应该更好。

建议:在代码中引入一些空格,使其更具可读性。这将有助于调试内容。

相关内容