Tag Info

Hot answers tagged

11

As J.M. comments, but opts not to post as an answer, you can use Convert in the Units package to convert between types. Be sure to read the documentation on that package. Needs["Units`"] Convert[(32.5 Newton)/(7 Meter/Second^2), Kilogram] 4.64286 Kilogram You will also find use in the Automatic Units package described on the Wolfram Blog.


9

In physics Planck constant may be used as a natural unit. If you want to switch to another unit system, use UnitConvert[]. For example, you can switch to standard SI units this way: UnitConvert[Quantity[1, "PlanckConstant"], "SIBase"] Which will give you: Quantity[6.626070*10^-34, ("Kilograms" ("Meters")^2)/("Seconds")] This can be done at the end ...


8

What you're seeing here is just the impreciseness of floating point arithmetic. It is important to remember that floating point operations are not associative or distributive even if the underlying mathematical operations are. A very simple example demonstrating the lack of associativity: 1. + (1.*^20 - 1.*^20) (* 1. *) (1. + 1.*^20) - 1.*^20 (* 0. *) ...


8

The units associated with physical constants do not play nicely with expressions that expect a numerical value. If you want only the numerical value of a constant, use Part. A motivating example: Needs["PhysicalConstants`"]; Plot[1/Sqrt[1 - v^2/SpeedOfLight^2], {v, 0, 0.9 SpeedOfLight}] (* Plot::plln: Limiting value (2.69813*10^8 Meter)/Second in ...


7

In v. 9, speed of light is a quantity. Try Quantity["SpeedOfLight"] The output will look like the following: 1 c However, its FullForm is actually Quantity[1, "SpeedOfLight"] You will find addition information about how to use physical constants as quantities in the Compatibility Tutorial and in the Units Overview.


2

You should use the Physical Constants Package by using << PhysicalConstants` When you enter now PlanckConstant you directly get the Planck Constant. With PlanckConstant/(Joule Second) you get the Planck Constant without units.


2

With version 9, this is now possible using this method: Plot[1/Sqrt[1 - v^2/QuantityMagnitude[UnitConvert[Quantity["SpeedOfLight"]]]^2], {v, 0,0.9*QuantityMagnitude[UnitConvert[Quantity["SpeedOfLight"]]] }]


2

You can use SetPrecision to set the interpreted precision of a numeric value, or Rationalize to convert it into an exact value. Be cautious about manufacturing false precision.



Only top voted, non community-wiki answers of a minimum length are eligible