Math & Sciencesiunitx | "invalid-token-in-number" Error

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
ghostanime2001
Posts: 402
Joined: Fri May 20, 2011 9:41 am

siunitx | "invalid-token-in-number" Error

Post by ghostanime2001 »

I am getting 178 errors, 1 warning and 7 bad boxes all due to siunitx package. I need major help. Here is my code ... ... ...

Code: Select all

\documentclass[fleqn]{article}
\usepackage{fullpage}
\usepackage[margin=1in]{geometry}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{multicol}
\usepackage{floatflt}
\usepackage[makeroom]{cancel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{xfrac}
\usepackage{siunitx}
\sisetup{%
      output-decimal-marker={.},
      load-configurations=abbreviations,
      group-separator={,},
      per-mode=fraction,
      quotient-mode = fraction
    }\pagestyle{empty}
\begin{document}
\begin{enumerate}
\item
\raisebox{1.85ex}{\parbox[t]{2in}{\null\includegraphics[width=\linewidth]{Diagram1}}}
\hspace{0.5cm}
\begin{minipage}[t]{2in}
$\begin{aligned}[t]
r&=\text{3840 \cancel{mi}}\left(\dfrac{\text{1.609 \cancel{km}}}{\text{1 \cancel{mi}}}\right)\left(\dfrac{\text{1000 m}}{\text{1 \cancel{km}}}\right)=\SI{6.18e6}{\m} \\
s&=\text{5150 \cancel{mi}}\left(\dfrac{\text{1.609 \cancel{km}}}{\text{1 \cancel{mi}}}\right)\left(\dfrac{\text{1000 m}}{\text{1 \cancel{km}}}\right)=\SI{8.29e6}{\m} \\
\theta&=\text{?}
\end{aligned}$
$\begin{aligned}[t]
s&=r \theta \\
\cfrac{s}{r}&=\theta \\
\cfrac{8.29}{6.18}&=\theta \\
\text{1.34 rad}&=\theta 
\end{aligned}$
\end{minipage}
\item
\begin{minipage}[t]{2in}
$\begin{aligned}[t]
\Delta t&=\text{9.09 \cancel{hr}}\left(\dfrac{\text{60 \cancel{min}}}{\text{1 \cancel{hr}}}\right)\left(\dfrac{\text{60 s}}{\text{1 \cancel{min}}}\right)=\text{32,724 s} \\
\omega &=\text{?} \\
\omega &=\dfrac{\theta}{\Delta t}=\dfrac{\text{1.34 rad}}{\text{32,724 s}}=\text{\num{4.09e-5} rad/s}
\end{aligned}$
\end{minipage}
\item
\raisebox{1.85ex}{\parbox[t]{2in}{\null\includegraphics[width=\linewidth]{Diagram2}}}
\begin{minipage}[t]{4cm}
$\begin{aligned}[t]
d&=\text{328 m} \\
r&=6.18 \\
T&=\text{24 \cancel{h}}\left(\dfrac{\text{60 \cancel{min}}}{\text{1 \cancel{h}}}\right)
\end{aligned}$
\end{minipage}
$\begin{aligned}[t]
v_{1}&=\dfrac{2\pi r}{T} & v_{2}&=\dfrac{2\pi(r+d)}{T} \\
Tv_{1}&=2\pi r & Tv_{2}&=2\pi(r+d) \\
\dfrac{Tv_{1}}{2\pi}&=r & \dfrac{Tv_{2}}{2\pi}-d&=r \\
\end{aligned}$ 
\vspace{-4.5cm}
\begin{align*}
\hspace{5cm}
\dfrac{Tv_{1}}{2\pi}&=\dfrac{Tv_{2}}{2\pi}-d \\
d&=\dfrac{Tv_{2}}{2\pi}-\dfrac{Tv_{1}}{2\pi} \\
d&=\dfrac{T}{2\pi}\left(v_{2}-v_{1}\right) \\
\dfrac{2\pi d}{T}&=\Delta v \\
\dfrac{2\pi(328)}{86,400}&=\Delta v \\
0.02385&=\Delta v \\
\text{\num{2.39e-2 m/s}}&=\Delta v 
\end{align*}
\item
\raisebox{1.85ex}{\parbox[t]{2in}{\null\includegraphics[width=\linewidth]{Diagram3}}}
\begin{minipage}[t]{2in}
$\begin{aligned}[t]
\theta&=\SI{40.1}{\degree} \\
T&=\text{24 \cancel{h}}\left(\dfrac{\text{60 \cancel{min}}}{\text{1 \cancel{h}}}\right)\left(\dfrac{\text{60 s}}{\text{1 \cancel{min}}}\right)=\text{86,400 s} \\
r&=\SI{6.37e6}{\m} \\
\cos\theta&=\dfrac{d}{r} \\
r\cos\theta&=d
\end{aligned}$
\end{minipage}
\begin{align*}
v&=\dfrac{2\pi d}{T} \\
v&=\dfrac{2\pi r\cos\theta}{T} \\
v&=\dfrac{2\pi(\SI{6.37e6}{\m})\cos(\SI{40.1}{\degree})}{\text{86,400 s}} \\
v&=\SI{354.34}{\m\per\s} 
\end{align*}
\item
\begin{minipage}[t]{2in}
$\begin{aligned}[t]
m&=\SI{9.11e-31}{\kg} & f&=\text{?} \\
r&=\SI{5.33e-11}{\m} \\
F&=\SI{9.15e-8}{\N}
\end{aligned}$
\end{minipage}
\begin{align*}
f&=\dfrac{\sqrt{\dfrac{Fr}{m}}}{2\pi r} \\
f&=\dfrac{\sqrt{\dfrac{(\num{9.15e-8})(\num{5.33e-11})}{\num{9.11e-31}}}}{2\pi(\num{5.33e-11})} \\
f&=\num{6.91e15}
\end{align*}
\item
\begin{minipage}[t]{2in}
$\begin{aligned}[t]
m&=\text{1420 kg} \\
r&=\text{125 m} \\
v&=\text{25.4 m/s} \\
F&=\text{?} \\
\end{aligned}$
\end{minipage}
$\begin{aligned}[t]
F&=ma_{r} \\
F&=\dfrac{mv^{2}}{r} \\
F&=\dfrac{\text{(1420 kg)(25.4 m/s)}^{2}}{\text{125 m}} \\
F&=\text{7329 N} \\
F&=\SI{7.33e3}{N}
\end{aligned}$
\item
\begin{minipage}[t]{2in}
$\begin{aligned}[t]
m&=\text{0.0255 kg} \\
r&=\text{0.2 m} \\
\omega&=\text{56.2}
\end{aligned}$
\end{minipage}
\item
\raisebox{1.85ex}{\parbox[t]{1.6in}{\null\includegraphics[width=\linewidth]{Diagram4}}}
\begin{minipage}[t]{2in}
$\begin{aligned}[t]
r&=\text{3.44 m} \\
T&=\text{6.92 s} \\
t&=\text{18.1 s} \\
v&=\text{?}
\end{aligned}$
\end{minipage}
\hspace{-1in}
$\begin{aligned}[t]
T&=\dfrac{2\pi r}{v} \\
Tv&=2\pi r \\
v&=\dfrac{2\pi r}{T} \\
v&=\dfrac{2\pi(3.44)}{6.92} \\
v&=\text{3.12 m/s} \\
\end{aligned}$ 
\item
\begin{minipage}[t]{2in}
$\begin{aligned}[t]
\theta_{f}&=\theta_{i}+\omega_{i}t+\dfrac{1}{2}\alpha t^{2} \\
\theta_{f}-\theta_{i}&=\dfrac{vt}{r}+\dfrac{1}{2}\left(\dfrac{\omega_{f}-\omega_{i}}{\cancel{t}}\right)t^{\cancel{2}} \\
\Delta\theta&=\dfrac{vt}{r}+\dfrac{1}{2}\left(\omega_{f}-\omega_{i}\right)t \\
\Delta\theta&=\dfrac{vt}{r}-\dfrac{\omega_{i}t}{2} \\
\Delta\theta&=\dfrac{vt}{r}-\dfrac{vt}{2r}
\end{aligned}$
\end{minipage}
\hspace{1cm}
$\begin{aligned}[t]
\Delta\theta&=\dfrac{vt}{r}\left(1-\dfrac{1}{2}\right) \\
\Delta\theta&=\dfrac{vt}{2r} \\
\Delta\theta&=\dfrac{(3.12)(18.1)}{2(3.44)}\left(\dfrac{\text{1 rev}}{2\pi \text{ rad}}\right) \\
\Delta\theta&=\text{1.31 rev} \\
\end{aligned}$
\item
\begin{minipage}[t]{2in}
$\begin{aligned}[t]
\omega&=3640\dfrac{\text{\cancel{rev}}}{\text{\cancel{min}}}\left(\dfrac{2\pi \text{ rad}}{\text{1 \cancel{rev}}}\right)\left(\dfrac{\text{1 \cancel{min}}}{\text{60 s}}\right)=\text{381.2 rad/s} \\
a_{r}&=\text{?} \\
r&=\text{0.103 m}
\end{aligned}$
\end{minipage}
\begin{align*}
a_{r}&=r\omega^{2} \\
&=\text{(0.103 m)(381.2 rad/s)}^{2} \\
&=\text{\num{1.50e4} m/s}^{2} 
\end{align*}
\item
\begin{minipage}[t]{2in}
$\begin{aligned}[t]
m&=\text{1350 kg} \\
r&=\text{51 m} \\
v&=\text{14 m/s} \\
f_{s}&=\text{?}
\end{aligned}$
\end{minipage}
\hspace{-1in}
$\begin{aligned}[t]
F&=ma_{r} \\
F&=\dfrac{mv^{2}}{r} \\
f_{s}&=\dfrac{mv^{2}}{r} \\
f_{s}&=\dfrac{(1350)(14)^{2}}{51} \\
f_{s}&=\SI{5.2e3}{N}
\end{aligned}$
\item
\begin{minipage}[t]{1in}
$\begin{aligned}[t]
m&=\text{0.591 kg} \\
L&=\text{1.46 m} \\
T&=\text{11 N} \\
v&=\text{?}
\end{aligned}$
\end{minipage}
\raisebox{1.85ex}{\parbox[t]{1.6in}{\null\includegraphics[width=\linewidth]{Diagram5}}}
\raisebox{1.85ex}{\parbox[t]{0.7cm}{\null\includegraphics[width=\linewidth]{Diagram6}}}
\hspace{0.3cm}
$\begin{aligned}[t]
F&=ma_{r} \\
T-mg&=\dfrac{mv^{2}}{L} \\
\left(T-mg\right)L&=mv^{2} \\
\sqrt{\dfrac{\left(T-mg\right)L}{m}}&=v \\
\sqrt{\dfrac{\left(11-(0.591)(9.81)\right)(1.46)}{0.591}}&=v \\
\text{3.58 m/s}&=v
\end{aligned}$
\item
\begin{minipage}[t]{2in}
$\begin{aligned}[t]
r&=\text{2.615 m} \\
L&=\text{7.67 m} \\
t&=\text{10.2 s} \\
\theta&=\ang{16.7} \\
v&=\text{?}
\end{aligned}$
\end{minipage}
\hspace{-5cm}
\raisebox{1.85ex}{\parbox[t]{8.5cm}{\null\includegraphics[width=\linewidth]{Diagram7}}}
\vspace{-2.9cm}
\begin{align*}
\hspace{5cm}
\sin\theta&=\dfrac{x}{L} \\
L\sin\theta&=x \\
\text{2.204 m}&=x
\end{align*}
\raisebox{1.85ex}{\parbox[t]{4cm}{\null\includegraphics[width=\linewidth]{Diagram8}}}
\vspace{-5cm}
\begin{align}
\hspace{4cm}
T\cos\ang{73.3}&=\dfrac{mv^{2}}{r} \\
T\sin\ang{73.3}-mg&=0 \\
T\sin\ang{73.3}&=mg \nonumber \\
T&=\dfrac{mg}{\sin\ang{73.3}} \nonumber
\end{align}
\vspace{0.5cm}
\begin{align*}
\hspace{-0.5cm}
\left(\dfrac{mg}{\sin\ang{73.3}}\right)\cos\ang{73.3}&=\dfrac{mv^{2}}{r+L\sin\theta} \\
\left(\dfrac{\cos\ang{73.3}}{\sin\ang{73.3}}\right)mg&=\dfrac{mv^{2}}{r+L\sin\theta} \\
\sqrt{\left(r+L\sin\theta\right)\left(\dfrac{\cos\ang{73.3}}{\sin\ang{73.3}}\right)g}&=v \\
\sqrt{(2.615+7.67\sin\ang{16.7})\left(\dfrac{\cos\ang{73.3}}{\sin\ang{73.3}}\right)(9.81)}&=v \\
\text{3.77 m/s}&=v
\end{align*}
\item
\raisebox{1.85ex}{\parbox[t]{2in}{\null\includegraphics[width=\linewidth]{Diagram9}}}
\begin{minipage}[t]{1in}
$\begin{aligned}[t]
r&=\text{47.7 m} \\
v&=\text{?} \\[0.5cm]
\end{aligned}$
$\begin{aligned}[t]
\Sigma{F_{y}}&=0 \\
N-mg&=0 \\
N&=mg
\end{aligned}$
\end{minipage}
\hspace{1cm}
$\begin{aligned}[t]
mg&=\dfrac{mv^{2}}{r} \\
mgr&=mv^{2} \\
\dfrac{\cancel{m}gr}{\cancel{m}}&=v^{2} \\
\sqrt{gr}&=v \\
\text{\num{2.16e1} m/s}&=v
\end{aligned}$
\item
\begin{minipage}[t]{1in}
$\begin{aligned}[t]
r&=\text{19.8 m} \\
T&=\text{29.2 s} \\
v&=\text{?} \\
a_{r}&=\text{?} \\[0.5cm]
\end{aligned}$
$\begin{aligned}[t]
a_{r}&=\dfrac{v^{2}}{r} \\
a_{r}&=\dfrac{(4.26)^{2}}{\text{19.8 m}} \\
a_{r}&=\text{0.917 m/s}^{2} \\
a_{r}&=\text{\num{9.17e-1} m/s}^{2}
\end{aligned}$
\end{minipage}
$\begin{aligned}[t]
T&=\dfrac{2\pi r}{v} \\
Tv&=2\pi r \\
v&=\dfrac{2\pi r}{T} \\
v&=\dfrac{2\pi(19.8)}{29.2} \\
v&=\text{4.26 m/s}
\end{aligned}$
\item
$\begin{aligned}[t]
\dfrac{W_{app}}{W}=\dfrac{-ma+mg}{mg}=\dfrac{\cancel{m}(-a+g)}{\cancel{m}g}=\dfrac{-a+g}{g}=\dfrac{-(0.917)+(9.81)}{9.81}=0.907
\end{aligned}$
\item
$\begin{aligned}[t]
\dfrac{W_{app}}{W}=\dfrac{ma+mg}{mg}=\dfrac{\cancel{m}(a+g)}{\cancel{m}g}=\dfrac{a+g}{g}=1.093
\end{aligned}$
\item
$\begin{aligned}[t]
m&=\text{0.136 kg} \\
L&=\text{0.637 m} \\
x_{1}&=\text{2.07 m} \\
x_{2}&=\text{5.11 m} \\
T&=\text{?} \\
\end{aligned}$
\raisebox{1.85ex}{\parbox[t]{2.5in}{\null\includegraphics[width=\linewidth]{Diagram10}}}
\begin{align*}
$\begin{aligned}[t]
v_{f}^{2}&=v_{i}^{2}+2a\Delta d \\
0&=v_{i}^{2}+2a\Delta d \\
-2a\Delta d&=v_{i}^{2} \\
-2a(x_{2}-x_{1})&=v_{i}^{2}
\end{aligned}$
$\begin{aligned}[t]
\hspace{1cm}
-T&=\dfrac{mv_{i}^{2}}{L} \\
T&=\dfrac{-mv_{i}^{2}}{L} \\
T&=\dfrac{-m(-2a(x_{2}-x_{1}))}{L} \\
T&=\dfrac{2ma(x_{2}-x_{1})}{L} \\
T&=\dfrac{2(0.136)(9.81)(5.11-2.07)}{0.637} \\
T&=\SI{12.73}{N} \\
T&\approx\SI{12.7}{N}
\end{aligned}$
\end{align*}
\end{enumerate}
\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

siunitx | "invalid-token-in-number" Error

Post by localghost »

You can't do things like \num{2.39e-2 m/s}. Write \SI{2.39e-2}{\m\per\s} instead. This is only one of probably several causes for the errors. Study the siunitx manual to learn how to use the package in the right way.

And by the way, next time please reduce the problem to a minimal example. By doing so, you probably would have been able to find the errors by yourself. The compiler is very exact in its error messages by giving the line number where the error was found. The erroneous code from above is located in line 69 of your example.


Thorsten
ghostanime2001
Posts: 402
Joined: Fri May 20, 2011 9:41 am

Re: siunitx | "invalid-token-in-number" Error

Post by ghostanime2001 »

I am using Texnicenter and what to do u mean the compiler is very exact by giving the line number? I clicked that exclamation mark above in the tools window of texnicenter and it just says something like:

"invalid-token-in-number"

Invalid token 'm' in numerical input.

I did not have this error before but it is suddenly showing up. How do you explain that. I am not going to erase my coding all over again and test every block of command.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

siunitx | "invalid-token-in-number" Error

Post by localghost »

ghostanime2001 wrote:I am using Texnicenter and what to do u mean the compiler is very exact by giving the line number? […]
If TeXnicCenter (TXC) doesn't show you the error, take a direct look into the log file. There you will find the complete information. TXC parses the log file and filters those messages, but can't always lead you to the concerned place in the source.
ghostanime2001 wrote:[…] I did not have this error before but it is suddenly showing up. How do you explain that.
Errors don't occur suddenly without your assistance. Note that TXC runs the compiler in "nonstopmode", thus compiles the whole document. If you want to stop that, uncheck the according box in the build profile (Alt+F7).
ghostanime2001 wrote:[…] I am not going to erase my coding all over again and test every block of command.
If you would have followed the link for the minimal example, you would know how to cut down a problem. A minimal example is always generated from a copy of your original document. If you are not willing to do that, don't expect any specific help.
ghostanime2001
Posts: 402
Joined: Fri May 20, 2011 9:41 am

Re: siunitx | "invalid-token-in-number" Error

Post by ghostanime2001 »

I dont even understand where or what this stupid minimal example is!
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

siunitx | "invalid-token-in-number" Error

Post by frabjous »

ghostanime2001 wrote:I dont even understand where or what this stupid minimal example is!
Then follow the link and read it.
Post Reply