I'm using LaTeX to write my paper and every equation needs to be numbered, so I use the equation environment. However, it fails to compile.
\documentclass[UTF8]{ctexart}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{epstopdf}
\begin{document}
\begin{equation}
\[
\begin{bmatrix}
L_{a1} & 0 \\
0 & L_{a2}
\end{bmatrix}
\begin{bmatrix}
I_{a1} \\
I_{a2}
\end{bmatrix}
+
\begin{bmatrix}
R_{a1} & 0 \\
0 & R_{a2}
\end{bmatrix}
\begin{bmatrix}
I_{a1} \\
I_{a2}
\end{bmatrix}
+
\begin{bmatrix}
K_{e1} & 0 \\
0 & K_{e2}
\end{bmatrix}
\begin{bmatrix}
$theta_1$ \\
$theta_2$
\end{bmatrix}
=
\begin{bmatrix}
V_{a1} \\
V_{a2}
\end{bmatrix}
\]
\end{equation}
\end{document}
So my question is: how to revise it? In addtion, I would like to know why the math expression that follows is wrong:
$$ B = \frac{J_2}{N_1 N_2}+\frac{m_2 r_2^2}{4 N_1 N_2}+\frac{m_2 r_1 r_2}{2 N_1 N_2} cos(\frac{\theat_{m2}}{N_2}) $$
$$ C = \frac{-m_2 r_1 r_2}{N_1 N_2}(\frac{\theat_{m1} \theat_{m2}}{N_1}+\frac{\theat_{m2}^2}{2 N_2}) sin\frac{\theat_{m2}}{N_2} $$
$$ D = J_{m1} +\frac{J_2}{N_2^2}+\frac{m_2 r_2^2}{4 N_2^2} $$
$$ E = \frac{J_2}{N_1 N_2}+\frac{m_2 r_2^2}{4 N_1 N_2}+\frac{m_2 r_1 r_2}{2 N_1 N_2} cos(\frac{\theat_{m2}}{N_2}) $$
LaTeX gives the information:
Undefined control sequence. [..._2}{2 N_1 N_2} cos(\frac{\theat_{m2}}{N_2}]
\thetanot\theat. Also you don't need\[ \]insideequationenvironment. – Sigur Jan 07 '14 at 15:44$$ ... $$. See e.g. Why is\[ … \]preferable to$$? – Torbjørn T. Jan 07 '14 at 15:47$from insidebmatrix(you are already in math mode). Also you probably want\thetaand nottheta– karlkoeller Jan 07 '14 at 15:48