How to summon Acceleration due to Gravity in Mathematica 11?
seems like a simple thing but the documentation is no help.
Are you trying to get the numeric value in MKS units? That can be done as follows.
g = SemanticInterpretation @ "acceleration of qravity" // UnitConvert
To get the numeric value you could do
or make use of how the
Quantity is structured
N @ g[]
The above does require internet access. To get by with only one such access, you can make the quantity persist in a local symbol stored in your local file system. Just evaluate
LocalSymbol["g"] = g
You can retrieve the value at any time in any Mathematica session by evaluating
You can of course use any string you like in place of "g".
Rightly or wrongly, if the unit specification is unknown, then WA is used behind the scenes to decide if it could be interpreted as a standard unit. You can see this with the error message provided:
Quantity::unkunit: Unable to interpret unit specification AccelerationOfGravity.
So, you can make use of this discovery mechanism by trying to use standard English instead of some random camel-cased string. For example:
Quantity["acceleration due to gravity"] //InputForm