# How to summon Acceleration due to Gravity in Mathematica 11? seems like a simple thing but the documentation is no help.

• It's Quantity["StandardAccelerationOfGravity"], plain "AccelerationOfGravity" isn't universal. – b3m2a1 Nov 10 '17 at 21:56
• Or to see the numeric value: Quantity["StandardAccelerationOfGravity"] // UnitConvert – Bob Hanlon Nov 10 '17 at 22:07
• You can also use GeogravityModelData[GeoPosition[{40, -90}], "Magnitude"] to get the value at a given location. Or even at a given elevation in meters with GeogravityModelData[GeoPosition[{40, -90, 100000}], "Magnitude"]. – jose Nov 11 '17 at 1:30

Are you trying to get the numeric value in MKS units? That can be done as follows.

g = SemanticInterpretation @ "acceleration of qravity" // UnitConvert


Quantity[196133/20000, ("Meters")/("Seconds")^2]

To get the numeric value you could do

QuantityMagnitude[1. g]


or make use of how the Quantity is structured

N @ g[]


Both give

9.80665

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

LocalSymbol["g"]


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["AccelerationOfGravity"]


Quantity::unkunit: Unable to interpret unit specification AccelerationOfGravity.

Quantity["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


Quantity[1, "StandardAccelerationOfGravity"]

• I like the use of W|A here, but it also means that when W|A is down (like it seems to have been periodically recently) anything with a slightly funky Quantity causes the system to hang until a ::timeout message can be emitted. Would be nice to have a quicker timeout on things like this. – b3m2a1 Nov 10 '17 at 23:01