It is helpful to use physical constants included in mathematica. Unfortunately they all include units. This provides errors when trying to integrate numerically. Is there a way just to get the value of a variable without any dimensions?
Thank you! Martin
If e.g. c
is the speed of light:
c = UnitConvert[Quantity["SpeedOfLight"]]
Then the obvious way would be to write:
c/Quantity["Meters"/"Seconds"]
Because that way, you're certain the unitless quantity you work with actually means something in m/s, not e.g. ft/hour. In other words: If you wrote c/Quantity["Feet"/"Hours"]
, the result would be the speed of light, in ft/hour, without a unit attached.
Alternatively, you could always write:
QuantityMagnitude[c]
Which just returns the magnitude, without the unit
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With