Function Repository Resource:

PhysicalQuantityLookup

Source Notebook

Look up PhysicalQuantity entities using units or unit dimensions

Contributed by: Jason Martinez

ResourceFunction["PhysicalQuantityLookup"][arg]

returns the list of physical quantities which share the unit dimensionality of arg.

ResourceFunction["PhysicalQuantityLookup"][arg,type]

returns physical quantities in the format specified by type.

Details

arg can be a Quantity, a "PhysicalConstant" Entity, unit dimension list or a QuantityVariable defined by a unit dimension list.
By default ResourceFunction["PhysicalQuantityLookup"] returns a list of a "PhysicalConstant" entities.
type defines the format of the output and can be one of the following:
“Entity""PhysicalQuantity" entities
“QuantityVariable"QuantityVariable object
“QuantityVariableName"string names

Examples

Basic Examples (3) 

Find all physical quantities with the same dimensions as ohms:

In[1]:=
ResourceFunction["PhysicalQuantityLookup"]["Ohms"]
Out[1]=

Look for physical quantities that cover a quantity:

In[2]:=
ResourceFunction["PhysicalQuantityLookup"][Quantity[12, "Feet"^3]]
Out[2]=

Search by specifying unit dimensions:

In[3]:=
ResourceFunction[
 "PhysicalQuantityLookup"][{{"LengthUnit", -2}, {"LuminousIntensityUnit", 1}}]
Out[3]=

Scope (2) 

Find the physical quantity corresponding to the gravitational constant:

In[4]:=
ResourceFunction["PhysicalQuantityLookup"][
 Entity["PhysicalConstant", "GravitationalConstant"]]
Out[4]=

Obtain the quantity variables for the physical quantities where available:

In[5]:=
ResourceFunction[
 "PhysicalQuantityLookup"]["Amperes", "QuantityVariable"]
Out[5]=

Get the names for a given quantity unit:

In[6]:=
pq = ResourceFunction["PhysicalQuantityLookup"]["Amperes", "QuantityVariableName"]
Out[6]=

Construct custom variables for these names:

In[7]:=
QuantityVariable[Unique["Amp"], #] & /@ pq
Out[7]=

Applications (3) 

Obtain the dimensions of energy:

In[8]:=
ud = QuantityVariableDimensions["Energy"]
Out[8]=

Examine all physical quantities with these dimensions:

In[9]:=
pqs = ResourceFunction["PhysicalQuantityLookup"][ud, "Entity"]
Out[9]=

Graph and group the physical quantities according to their base physical quantity:

In[10]:=
Graph[Rule @@@ DeleteCases[
   Transpose[{pqs, EntityValue[pqs, EntityProperty["PhysicalQuantity", "BasePhysicalQuantity"]]}], {_, _Missing}], VertexLabels -> Placed["Name", Tooltip]]
Out[10]=

Properties and Relations (2) 

Canonical units for physical quantities may differ from the unit used to find them:

In[11]:=
pqs = ResourceFunction["PhysicalQuantityLookup"][
  Quantity[1, "Millijoules"/"KelvinsDifference"], "QuantityVariableName"]
Out[11]=
In[12]:=
QuantityVariableCanonicalUnit /@ pqs
Out[12]=

Unit dimensions can be determined with UnitDimensions or QuantityVariableDimensions:

In[13]:=
ud = UnitDimensions["Galileos"]
Out[13]=
In[14]:=
pqs = ResourceFunction["PhysicalQuantityLookup"][ud, "QuantityVariableName"]
Out[14]=
In[15]:=
QuantityVariableDimensions /@ pqs
Out[15]=

Possible Issues (2) 

Combinations of units can be queried by specifying them in a Quantity:

In[16]:=
ResourceFunction["PhysicalQuantityLookup"][
 Quantity[1, "Meters"/"Second"]]
Out[16]=

Some combinations of units or unit dimensions do not have an associated physical quantity:

In[17]:=
ResourceFunction["PhysicalQuantityLookup"][
 Quantity[1, "Volts"*"Meters"^3]]
Out[17]=

Use the unit dimensions within a QuantityVariable to work with these sort of situations:

In[18]:=
UnitDimensions[Quantity[1, "Volts"*"Meters"^3]]
Out[18]=
In[19]:=
myVar = QuantityVariable[
  "X", {{"ElectricCurrentUnit", -1}, {"LengthUnit", 5}, {"MassUnit", 1}, {"TimeUnit", -3}}]
Out[19]=
In[20]:=
Through[{QuantityVariableIdentifier, QuantityVariablePhysicalQuantity,
    QuantityVariableDimensions, QuantityVariableCanonicalUnit}[myVar]]
Out[20]=
In[21]:=
DimensionalCombinations[{"Speed", "Length", "Mass", "ElectricCurrent",
   "Time"}, myVar]
Out[21]=

Version History

  • 1.0.0 – 28 March 2022

Author Notes

PhysicalQuantityLookup uses entity class lookups and so relies on an internet connection.

License Information