2

I am trying to write a system of the form Ax=By, where A and B are "big matrices". Here my code:

\begin{equation*}
\begin{flushleft}
    \begin{bmatrix}  
        \textbf{I} & -\beta\,\Delta t\,\textbf{I} & \textbf{0}\\[0.35cm]
        \beta\,\Delta t\,\textbf{E} & \textbf{M} & -\beta\,\Delta t\,\textbf{B} \\[0.35cm]
        \textbf{0} & \beta\,\Delta t\,\textbf{B}^\mathrm{T} &\overline{\textbf{C}}+\beta \,\Delta t\,\overline{\textbf{K}}\,
    \end{bmatrix}
    \begin{bmatrix}
        \{u^{(n+1)}\}\\[0.35cm]
        \{v^{(n+1)}\} \\[0.35cm]
        \{\vartheta^{(n+1)}\}
    \end{bmatrix}
    =\\[0.2cm]
\end{flushleft}
\begin{flushright}
    =\begin{bmatrix}
        \textbf{I}& (1-\beta)\,\Delta t\,\textbf{I} & \textbf{0}\\[0.35cm]
        -(1-\beta)\,\Delta t\,\textbf{E} & \textbf{M} & (1-\beta)\,\Delta t\,\textbf{B} \\[0.35cm]
        \textbf{0}& -(1-\beta) \,\Delta t\,\textbf{B}^\mathrm{T} &\overline{\textbf{C}}- (1-\beta)\,\Delta t\,\overline{\textbf{K}}\,
    \end{bmatrix}
    \begin{bmatrix}
        \{u^{(n)}\}\\[0.35cm]
        \{v^{(n)}\} \\[0.35cm]
        \{\vartheta^{(n)}\}
    \end{bmatrix},
\end{flushright}
\end{equation*}

This is the output

I am getting some error (e.g. Bad math environment delimiter. \end{equation*}). How to fix it? Any suggestion for a better formatting? Thanks!

3 Answers 3

3

Some suggestions:

  • Use a multline* environment with a single \\ line-break directive.
  • Get rid of the flushleft and flushright environments, especially as they are meant to be used in text mode, not in math mode.
  • Replace all \textbf instances with \mathbf.
  • Reset \arraystretch to a value of 1.5 -- and get rid of all [0.35cm] spacing directives
  • Optional: Get rid of \, thinspace directives

enter image description here

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

\begin{multline*}
\renewcommand\arraystretch{1.5} % default value: 1.0
\begin{bmatrix}  
   \mathbf{I} & -\beta\Delta t\mathbf{I} & \mathbf{0}\\
   \beta\Delta t\mathbf{E} & \mathbf{M} & -\beta\Delta t\mathbf{B} \\
   \mathbf{0} & \beta\Delta t\mathbf{B}^\mathrm{T} &\overline{\mathbf{C}}+\beta \Delta t\overline{\mathbf{K}}
\end{bmatrix}
\begin{bmatrix}
   \{u^{(n+1)}\}\\
   \{v^{(n+1)}\} \\
   \{\vartheta^{(n+1)}\}
\end{bmatrix}
\\[1ex]
=\begin{bmatrix}
   \mathbf{I}& (1-\beta)\Delta t\mathbf{I} & \mathbf{0}\\
   -(1-\beta)\Delta t\mathbf{E} & \mathbf{M} & (1-\beta)\Delta t\mathbf{B} \\
   \mathbf{0}& -(1-\beta) \Delta t\mathbf{B}^\mathrm{T} &\overline{\mathbf{C}}- (1-\beta)\Delta t\overline{\mathbf{K}}
\end{bmatrix}
\begin{bmatrix}
   \{u^{(n)}\}\\
   \{v^{(n)}\} \\
   \{\vartheta^{(n)}\}
\end{bmatrix},
\end{multline*}

\end{document}
1
  • 1
    Thank you! I also added \renewcommand\arraystretch{1.5} in between \[1ex] and =\begin{bmatrix}.
    – Mik
    Commented Feb 3, 2018 at 8:22
3

The simplest for this one, in my opinion, is to use the multline* environment:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[showframe]{geometry} 
\usepackage{amsmath}

\begin{document}

\begin{multline*}
    \begin{bmatrix}
        \textbf{I} & -\beta\,\Delta t\,\textbf{I} & \textbf{0}\\[0.35cm]
        \beta\,\Delta t\,\textbf{E} & \textbf{M} & -\beta\,\Delta t\,\textbf{B} \\[0.35cm]
        \textbf{0} & \beta\,\Delta t\,\textbf{B}^\mathrm{T} &\overline{\textbf{C}}+\beta \,\Delta t\,\overline{\textbf{K}}\,
    \end{bmatrix}
    \begin{bmatrix}
        \{u^{(n+1)}\}\\[0.35cm]
        \{v^{(n+1)}\} \\[0.35cm]
        \{\vartheta^{(n+1)}\}
    \end{bmatrix}
    =\\[1ex]
    =\begin{bmatrix}
        \textbf{I}& (1-\beta)\,\Delta t\,\textbf{I} & \textbf{0}\\[0.35cm]
        -(1-\beta)\,\Delta t\,\textbf{E} & \textbf{M} & (1-\beta)\,\Delta t\,\textbf{B} \\[0.35cm]
        \textbf{0}& -(1-\beta) \,\Delta t\,\textbf{B}^\mathrm{T} &\overline{\textbf{C}}- (1-\beta)\,\Delta t\,\overline{\textbf{K}}\,
    \end{bmatrix}
    \begin{bmatrix}
        \{u^{(n)}\}\\[0.35cm]
        \{v^{(n)}\} \\[0.35cm]
        \{\vartheta^{(n)}\}
    \end{bmatrix},
\end{multline*}

\end{document} 

enter image description here

1

This is a minimal damage kit to your equation.

\documentclass{article}
\usepackage{amsmath}
\usepackage{mathtools}
\begin{document}
\begin{align*}
\MoveEqLeft
    \begin{bmatrix}  
        \textbf{I} & -\beta\,\Delta t\,\textbf{I} & \textbf{0}\\[0.35cm]
        \beta\,\Delta t\,\textbf{E} & \textbf{M} & -\beta\,\Delta t\,\textbf{B} \\[0.35cm]
        \textbf{0} & \beta\,\Delta t\,\textbf{B}^\mathrm{T} &\overline{\textbf{C}}+\beta \,\Delta t\,\overline{\textbf{K}}\,
    \end{bmatrix}
    \begin{bmatrix}
        \{u^{(n+1)}\}\\[0.35cm]
        \{v^{(n+1)}\} \\[0.35cm]
        \{\vartheta^{(n+1)}\}
    \end{bmatrix}
    =\\[0.2cm]
    =&\begin{bmatrix}
        \textbf{I}& (1-\beta)\,\Delta t\,\textbf{I} & \textbf{0}\\[0.35cm]
        -(1-\beta)\,\Delta t\,\textbf{E} & \textbf{M} & (1-\beta)\,\Delta t\,\textbf{B} \\[0.35cm]
        \textbf{0}& -(1-\beta) \,\Delta t\,\textbf{B}^\mathrm{T} &\overline{\textbf{C}}- (1-\beta)\,\Delta t\,\overline{\textbf{K}}\,
    \end{bmatrix}
    \begin{bmatrix}
        \{u^{(n)}\}\\[0.35cm]
        \{v^{(n)}\} \\[0.35cm]
        \{\vartheta^{(n)}\}
    \end{bmatrix},
\end{align*}
\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 .