4

I am working with the first of 3 very long equations and am trying to get it where it will be relatively easy to read. However I get the following error

! Missing } inserted.
<inserted text> 
                }
l.95 \end{multline}

If I use equation instead of multline the code works, but then it is not readable since it is such a long expression. Can anyone help me figure this out?

\documentclass[12]{article}
\usepackage{amsmath}
 \begin{document}
\begin{multline}
\dot{u}= \frac{R^2\, X_a + R^2\, X_t \\
+R_{earth}^2\, T_{13}\, g_0\, m \\
-R^2\, m\, q\, \omega \\
+R^2\, m\, r\, v \\
-R^3\, T_{13}\, T_{21}^2\, m\, \omega_{earth}^2\, \cos^2\lambda \\
-R^3\, T_{13}\, T_{31}^2\, m\, \omega_{earth}^2\, \cos^2\lambda \\
+R^2\, T_{31}\, m\, v\, \omega_{earth}\, \cos\lambda \\
-R^2\, T_{21}\, m\, \omega\, \omega_{earth}\, \cos\lambda \\
-\frac{R^3\, T_{11}\, T_{23}^2\, m\, \omega_{earth}^2\, \sin(2\lambda)}{2} \\
-\frac{R^3\, T_{11}\, T_{33}^2\, m\, \omega_{earth}^2\,\sin(2\lambda)}{2} \\
-R^2\, T_{33}\, m\, v\, \omega_{earth}\, \sin\lambda  \\
+R^2\, T_{23}\, m\, \omega\, \omega_{earth}\, \sin\lambda  \\
+R^3\, T_{11}\, T_{21}\, T_{23}\, m\, \omega_{earth}^2\, \cos^2\lambda \\
+R^3\, T_{11}\, T_{31}\, T_{33}\, m\, \omega_{earth}^2\, \cos^2\lambda \\
+\frac{R^3\, T_{13}\, T_{21}\, T_{23}\, m\, \omega_{earth}^2\, \sin(2\lambda)}{2} \\
+\frac{R^3\, T_{13}\, T_{31}\, T_{33}\, m\, \omega_{earth}^2\, \sin(2\lambda)}{2}}{R^2 \, m}
\end{multline}
\end{document}

Edit: Thanks for all the help. Can you explain why the usage of \, is incorrect? I was under the impression that it would provide a narrow space between two adjacent symbols.

2
  • Unrelated to the problem but never use math italic for multi-letter identifiers \omega_{earth} should be \omega_{\mathrm{earth}} or \omega_{\mathit{earth}} Jun 27, 2014 at 16:05
  • why all the \, ? Jun 27, 2014 at 16:14

3 Answers 3

4

You can't split lines in the middle of the numerator. I suggest you to use a different approach, since the denominator is quite short:

\documentclass[12pt]{article}
\usepackage{amsmath}

\begin{document}
\begin{multline}
\dot{u}=\frac{1}{R^2m}\Bigl(
  R^2 X_a + R^2 X_t 
  +R_{\mathrm{earth}}^2 T_{13} g_0 m 
  -R^2 m q \omega 
  +R^2 m r v
\\
  -R^3 T_{13} T_{21}^2 m \omega_{\mathrm{earth}}^2 \cos^2\lambda
  -R^3 T_{13} T_{31}^2 m \omega_{\mathrm{earth}}^2 \cos^2\lambda
\\
  +R^2 T_{31} m v \omega_{\mathrm{earth}} \cos\lambda
  -R^2 T_{21} m \omega \omega_{\mathrm{earth}} \cos\lambda
\\
  -\tfrac{1}{2}R^3 T_{11} T_{23}^2 m \omega_{\mathrm{earth}}^2 \sin(2\lambda)
  -\tfrac{1}{2}R^3 T_{11} T_{33}^2 m \omega_{\mathrm{earth}}^2\sin(2\lambda)
\\
  -R^2 T_{33} m v \omega_{\mathrm{earth}} \sin\lambda
  +R^2 T_{23} m \omega \omega_{\mathrm{earth}} \sin\lambda
\\
  +R^3 T_{11} T_{21} T_{23} m \omega_{\mathrm{earth}}^2 \cos^2\lambda
  +R^3 T_{11} T_{31} T_{33} m \omega_{\mathrm{earth}}^2 \cos^2\lambda
\\
  +\tfrac{1}{2}R^3 T_{13} T_{21} T_{23} m \omega_{\mathrm{earth}}^2 \sin(2\lambda)
  +\tfrac{1}{2}R^3 T_{13} T_{31} T_{33} m \omega_{\mathrm{earth}}^2 \sin(2\lambda)
\Bigr)
\end{multline}
\end{document}

Note that I removed all \, which are not required and are actually wrong. Also the “earth” subscripts have been rendered in upright type.

Also the inner fractions with denominator 2 have been rendered with 1/2 as coefficient.

enter image description here

4

An alternate presentation may be more readable:

\documentclass[12]{article}
\usepackage{amsmath}
\def\oea{\omega_\mathrm{earth}}
\begin{document}
\begin{equation}
\dot{u}= \frac{A+B+C+D+E+F}{R^2 \, m}
\end{equation}
where
\[
\begin{aligned}
A =& +R^2\, X_a + R^2\, X_t \\
&+R_{earth}^2\, T_{13}\, g_0\, m \\
&-R^2\, m\, q\, \omega \\
&+R^2\, m\, r\, v \\
&-R^3\, T_{13}\, T_{21}^2\, m\, \oea^2\, \cos^2\lambda \\
&-R^3\, T_{13}\, T_{31}^2\, m\, \oea^2\, \cos^2\lambda \\
&+R^2\, T_{31}\, m\, v\, \oea\, \cos\lambda \\
&-R^2\, T_{21}\, m\, \omega\, \oea\, \cos\lambda \\\\
B =& -\frac{R^3\, T_{11}\, T_{23}^2\, m\, \oea^2\, \sin(2\lambda)}{2} \\\\
C =& -\frac{R^3\, T_{11}\, T_{33}^2\, m\, \oea^2\,\sin(2\lambda)}{2} \\\\
D =&-R^2\, T_{33}\, m\, v\, \oea\, \sin\lambda  \\
&+R^2\, T_{23}\, m\, \omega\, \oea\, \sin\lambda  \\
&+R^3\, T_{11}\, T_{21}\, T_{23}\, m\, \oea^2\, \cos^2\lambda \\
&+R^3\, T_{11}\, T_{31}\, T_{33}\, m\, \oea^2\, \cos^2\lambda \\\\
E =& +\frac{R^3\, T_{13}\, T_{21}\, T_{23}\, m\, \oea^2\, \sin(2\lambda)}{2} \\\\
F =& +\frac{R^3\, T_{13}\, T_{31}\, T_{33}\, m\, \oea^2\, \sin(2\lambda)}{2}
\end{aligned}
\]
\end{document}

enter image description here

2

This produces a multiline expression in the numerator but the result isn't really readable, it would be better to restructure the formula and perhaps name some subterms

\documentclass[12pt]{article}
\usepackage{amsmath}
 \begin{document}
\newcommand\omea{\omega_{\mathrm{earth}}}
\begin{equation}
\dot{u}= \frac{
\begin{aligned}R^2\, X_a + R^2\, X_t \\
+R_{earth}^2\, T_{13}\, g_0\, m \\
-R^2\, m\, q\, \omega \\
+R^2\, m\, r\, v \\
-R^3\, T_{13}\, T_{21}^2\, m\, \omea^2\, \cos^2\lambda \\
-R^3\, T_{13}\, T_{31}^2\, m\, \omea^2\, \cos^2\lambda \\
+R^2\, T_{31}\, m\, v\, \omea\, \cos\lambda \\
-R^2\, T_{21}\, m\, \omega\, \omea\, \cos\lambda \\
-\frac{R^3\, T_{11}\, T_{23}^2\, m\, \omea^2\, \sin(2\lambda)}{2} \\
-\frac{R^3\, T_{11}\, T_{33}^2\, m\, \omea^2\,\sin(2\lambda)}{2} \\
-R^2\, T_{33}\, m\, v\, \omea\, \sin\lambda  \\
+R^2\, T_{23}\, m\, \omega\, \omea\, \sin\lambda  \\
+R^3\, T_{11}\, T_{21}\, T_{23}\, m\, \omea^2\, \cos^2\lambda \\
+R^3\, T_{11}\, T_{31}\, T_{33}\, m\, \omea^2\, \cos^2\lambda \\
+\frac{R^3\, T_{13}\, T_{21}\, T_{23}\, m\, \omea^2\, \sin(2\lambda)}{2} \\
+\frac{R^3\, T_{13}\, T_{31}\, T_{33}\, m\, \omea^2\, \sin(2\lambda)}{2}
\end{aligned}}{R^2 \, m}
\end{equation}
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .