Skip to content

Commit

Permalink
Astronomical Unit Magnitude added.
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Jenni committed Mar 11, 2021
1 parent 1c98377 commit 79732c1
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 50 deletions.
Binary file removed lua-physical.pdf
Binary file not shown.
105 changes: 55 additions & 50 deletions lua-physical.tex
Original file line number Diff line number Diff line change
Expand Up @@ -950,6 +950,55 @@ \subsection{Base Units}



% lua function for printing dimension names.
\begin{luacode}
function getdim(q)
local str = q.dimension:__tostring()

str = string.gsub(str,"%[","")
str = string.gsub(str,"%]","")

return str
end

function strtoidx(str)
local s,n = string.gsub(str,"%_","\\_")
return s
end
\end{luacode}

% print unit table
\newcommand{\unittable}[1]{
\begin{table}[H]
\centering
\begin{tabularx}{\linewidth}{%
>{\setlength\hsize{1\hsize}}X%
l%
l%
>{\setlength\hsize{1\hsize}}X%
}
\thead{Quantity} & \thead{Unit} & \thead{Symbol} & \thead{Definition} \\\hline

#1

\hline
\end{tabularx}
\end{table}
}

% print unit table row
\newcommand{\printunit}[3][]{
\ifthenelse{\equal{#1}{}}{
\directlua{tex.print(getdim(#2))}
}{
#1
} &
\directlua{tex.print(#2.unit.name)} &
|#2| &
\mbox{|#3|}\index[unit]{\directlua{tex.print(#2.unit.name)} \texttt{\directlua{tex.print( strtoidx("#2") )}}} \\
}



%------------------------------------------------------------
\newpage
Expand All @@ -962,7 +1011,7 @@ \subsection{Constants}
\newcommand{\printconstant}[2]{
\directlua{tex.print(#1.unit.name)} &
|#1| &
\mbox{|#2|}\index[unit]{\directlua{tex.print(#1.unit.name)} \texttt{\directlua{tex.print( strtoidx("#1") )}}}\\
\mbox{|#2|}\index[unit]{\directlua{tex.print(#1.unit.name)} \texttt{\directlua{tex.print(strtoidx("#1"))}}}\\
}

\begin{table}[H]
Expand Down Expand Up @@ -1034,55 +1083,6 @@ \subsection{Coherent derived units in the SI}
\label{ch:coherent derived units}

All units in this section are coherent derived units from the SI base units with special names, \cite[118]{bipm06}.

% lua function for printing dimension names.
\begin{luacode}
function getdim(q)
local str = q.dimension:__tostring()

str = string.gsub(str,"%[","")
str = string.gsub(str,"%]","")

return str
end

function strtoidx(str)
local s,n = string.gsub(str,"%_","\\_")
return s
end
\end{luacode}

% print unit table
\newcommand{\unittable}[1]{
\begin{table}[H]
\centering
\begin{tabularx}{\linewidth}{%
>{\setlength\hsize{1\hsize}}X%
l%
l%
>{\setlength\hsize{1\hsize}}X%
}
\thead{Quantity} & \thead{Unit} & \thead{Symbol} & \thead{Definition} \\\hline

#1

\hline
\end{tabularx}
\end{table}
}

% print unit table row
\newcommand{\printunit}[3][]{
\ifthenelse{\equal{#1}{}}{
\directlua{tex.print(getdim(#2))}
}{
#1
} &
\directlua{tex.print(#2.unit.name)} &
|#2| &
\mbox{|#3|}\index[unit]{\directlua{tex.print(#2.unit.name)} \texttt{\directlua{tex.print( strtoidx("#2") )}}} \\
}

\unittable{
\printunit[Plane Angle\protect\footnotemark]{_rad}{_1}
\printunit[Solid Angle\protect\footnotemark]{_sr}{_rad^2}
Expand Down Expand Up @@ -1176,6 +1176,11 @@ \subsection{Nominal Astronomical Units}



The mass of the sun is proposed to be used as the astronomical mass unit.
\unittable{
\printunit[Mass]{_M_S}{N(1.98847e30,0.00007e30) * _kg}
}


%------------------------------------------------------------
\newpage
Expand Down
4 changes: 4 additions & 0 deletions src/physical-definition.lua
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,8 @@ Q.define("t", "tonne", 1e3 * _kg)
-- https://arxiv.org/pdf/1605.09788.pdf
-- https://arxiv.org/pdf/1510.07674.pdf

Q.define("mag", "magnitude", _1)

Q.define("R_S_nom", "nomsolradius", 6.957e8 * _m)
Q.define("S_S_nom", "nomsolirradiance", 1361 * _W/_m^2)
Q.define("L_S_nom", "nomsolluminosity", 3.828e26 * _W)
Expand All @@ -290,6 +292,8 @@ Q.define("Re_J_nom", "nomjoveqradius", 7.1492e7 * _m)
Q.define("Rp_J_nom", "nomjovpolradius", 6.6854e7 * _m)
Q.define("GM_J_nom", "nomjovmassparameter", 1.2668653e17 * _m^3*_s^-2)

Q.define("M_S", "solmass", N(1.98847e30,0.00007e30) * _kg)




Expand Down

0 comments on commit 79732c1

Please sign in to comment.