I am trying to calculate precise values for certain expressions, see the image below.
The output testZPF
of the function $\Delta$Fn should be a single output. I am trying to understand why Mathematica does not provide me with a single number in fully simplified units (here the dimension of the result is $[m]$), but instead prints the result in units of $c$ and $\hbar$.
Edit
For the dimensions, I tried to use UnitConvert
, but get an error here. The error is very strange as the result should have indeed dimensions $[m^{-1}]$.
Edit 2
Here is the code:
\[Omega] =
2 Pi*Quantity[1,
"SpeedOfLight"]*(1/Quantity[735, "Nanometers"] -
1/Quantity[900, "Nanometers"])
Subscript[m, red] = Quantity[6, "AtomicMassUnit"]
Subscript[h, bar] = Quantity[1, "ReducedPlanckConstant"]
\[Del]Fn[\[Omega]_, m_] := Sqrt[Subscript[h, bar]/(\[Omega]*m)]
testZPF = \[Del]Fn[\[Omega], Subscript[m, red]]
UnitConvert[testZPF, "Meters"^(-1)]
\[Pi]
) in your equations. Mma uses infinite precision in these cases. You can move to machine precision by following your integers with a decimal; e.g.1.
instead of1
. This makes them machine precision reals and you'll get reals in the output. $\endgroup$UnitSimplify
. $\endgroup$Del[...]
. Secondly, as I have proposed, useUnitSimplify
and you will get the result in picometres. Thirdly, you can useUnitConvert[testZPF, "Meters"]
. $\endgroup$