如何列出Mathematica 11.3中所有内置的物理常数?

时间:2019-01-18 14:19:24

标签: wolfram-mathematica

有一个过时的Mathematica软件包的旧说明,其中列出了所有内置物理常数:  https://reference.wolfram.com/language/PhysicalConstants/tutorial/PhysicalConstants.html

它已被Quantity软件包取代。新的提供了诸如“地球引力”之类的常数。但是,使用以下方式列出所有单位:

Quantity; Keys[QuantityUnits`Private`$UnitReplacementRules]

不提供此功能。所以我一直想知道从哪里获取索引或列表。

是否可以列出Quantity包的所有物理常量?

1 个答案:

答案 0 :(得分:0)

您可以使用Knowledge Representation & AccessEntity之类的EntityValue函数。所有结果均与版本11.3相同。

首先查询名称中具有"phys"的所有实体,例如“物理”或“物理”。

Select[StringContainsQ["phys", IgnoreCase -> True]]@EntityValue[]
{"FamousPhysicsProblem", "PhysicalConstant", "PhysicalSystem"}

这将返回三种实体类型,其中"PhysicalConstant"是最佳选择。这些实体可用的属性是:

所有都可以通过

返回
EntityValue["PhysicalConstant", "Name"]

针对地球引力的特定实体。

EntityProperties["PhysicalConstant"]
{"AbbreviationCode", "AlternateNames", "ASCIIDescription", "Classes", 
 "ConjecturedValues", "Description", "EqualMagnitudeConstants", 
 "EquivalentForms", "ExternalLink", "LevyLeblondClass", "Name", 
 "PrimarySource", "Quantity", "SeriesExpansionValues", 
 "StandardUncertainty", "StandardYear", "Value", "Values", "Variants", 
 "VariantTable"}

"Classes"属性看起来很有用。

DeleteDuplicates@Flatten@Join@EntityValue["PhysicalConstant", "Classes"]
{"Acceleration", "Cosmological", "Atomic", "CODATA", "Mass", 
"Particle", "Spectral", "Astronomical", "Distance", "IAU", "Radius", 
"Chemical", "Thermal", "Electric", "Dimensionless", "Exact", "Force", 
"Frequency", "Magnetic", "Momentum", "Pressure", "Temperature", 
"Time", "Speed", "WolframLegacyPackage", "Thermodynamic", 
"AstronomicalAlmanac", "MassRatio", "CGPM", "Quantum", 
"Gravitational", "Natural", "ForceRatio", "Coupling", "Radiation", 
"Energy", "SolidState", "Length", "Area", "Volume", 
"ParticleDataGroup", "Angle"}

"Acceleration"似乎是最好的选择。

a = EntityClass["PhysicalConstant", {"Classes" -> "Acceleration"}]
EntityValue[a, "EntityCount"]
3
EntityList[a]
{"AccelerationAssociatedWithCosmologicalExpansionRate", "MONDConstant", "StandardAccelerationOfGravity"}

现在可以通过以下方式选择实体

grav = Entity["PhysicalConstant", "StandardAccelerationOfGravity"]

然后

grav["Value"]
Quantity[196133/20000, "Meters"/"Seconds"^2]
grav["ExternalLink"]
  

http://physics.nist.gov/cgi-bin/cuu/Value?gn

希望这会有所帮助。