0

While compiling, an error message "Undefined control sequence" for the fourth line below (starting with 1958*e.....). Any idea about the cause?

\begin{equation}
S = \left\{ \begin{array}{rcl}
1280*Q^{0.46}*(1.43-0.26*\log{A}) & \mbox{if} & Q<2 in \\ 
1958*e^{-0.055}*Q*(1.43-0.26*\logA) & \mbox{if} & Q\geq2 in 
\end{array}\right.
\end{equation}
3
  • 2
    Welcome to TeX.SE! The culprit is \logA. Replace it by \log A, i.e. add a space. But you really may want to have a look at some intro, and use e.g. \begin{cases} ... \end{cases} and \text instead of \mbox and so on.
    – user121799
    Apr 22, 2018 at 1:55
  • the error message which you do not show highlights exactly which command is undefined Apr 22, 2018 at 5:28
  • You have \log{A} and \logA: both should be \log A (no braces and a space).
    – egreg
    Apr 22, 2018 at 8:48

1 Answer 1

1

There is a big difference between

\log{A}

(line 3 of your code) and

\logA

(line 4 of your code), but they're both wrong and it should be \log A in both cases.

Actually, \log{A} and \log A produce the same output, but it wouldn't be the same for \log{(A+B) and \log (A+B) (check it).

You should use amsmath and input your equation as

\begin{equation}
S =
\begin{cases}
  1280Q^{0.46}(1.43-0.26\log A) & \text{if $Q<2\,\mathrm{in}$} \\ 
  1958e^{-0.055}Q(1.43-0.26\log A) & \text{if $Q\geq 2\,\mathrm{in}$}
\end{cases}
\end{equation}

(in mathematics, multiplication is very rarely denoted by an asterisk).

Full code:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{equation}
S =
\begin{cases}
  1280Q^{0.46}(1.43-0.26\log A) & \text{if $Q<2\,\mathrm{in}$} \\
  1958e^{-0.055}Q(1.43-0.26\log A) & \text{if $Q\geq 2\,\mathrm{in}$}
\end{cases}
\end{equation}

\end{document}

enter image description here

1
  • It is corrected as you proposed Mr egreg, and now it's good. Thank's for help.
    – Momkin
    Apr 22, 2018 at 12:35

You must log in to answer this question.

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