Gaining a better understanding of how to use Mathematica for physics
Gaining a better understanding of how to use Mathematica for physics
PeterCullenBurbery
I have decided I am going to gain a better understanding of how to use Mathematica for physics and dimensional analysis. I started solving some problems from the American Association of Physics Teacher 2011 F=ma exam and I realized that I'm not taking full advantage of the functionality in Mathematica so I decided to create a new essay where I work on just using Mathematica and working through the documentation.
Plan
Plan
Unit and Quantity Input
Quantity Components
Quantity Display
Unit Conversion
Quantities with Uncertainty
Physical Quantities
QuantityVariable
QuantityVariable
A represents a variable associated with a particular physical quantity:
In[]:=
QuantityVariable["V","ElectricPotential"]
Out[]=
V
———————————————————————————————————————————————————————————————————————————————————
In[]:=
FormulaData["KineticEnergy",{QuantityVariable["K","Energy"]Quantity[10,"Joules"],QuantityVariable["m","Mass"]Quantity[10,"Grams"]}]
Out[]=
v
v
I don't know why this is giving an error because the documentation doesn't have any error.
In[]:=
var=QuantityVariable["I","Current"]
Out[]=
I
In[]:=
QuantityVariableIdentifier[var]
Out[]=
I
The physical quantity can be recovered with :
In[]:=
QuantityVariablePhysicalQuantity[var]
Out[]=
Current
In[]:=
Out[]=
ElectricPotential
———————————————————————————————————————————————————————————————————————————————————
Create a using a combination of physical quantities:
In[]:=
QuantityVariable["x","Mass"*"Distance"]
Out[]=
x
Use a list of unit dimensions to set a physical quantity instead:
In[]:=
QuantityVariable["y",{{"LengthUnit",2},{"MassUnit",-1}}]
Out[]=
y
Properties & Relations (8)
Properties & Relations
(8)
SI Base Units formulas
SI Base Units formulas
Continuing on
Continuing on
Examining Details
Examining Details
In[]:=
QuantityVariable["λ","Length"]
Out[]=
λ
In[]:=
Information[QuantityVariable["λ","Length"],"Identifier"]
Out[]=
λ
In[]:=
Information[QuantityVariable["λ","Length"],"PhysicalQuantity"]
Out[]=
Length
In[]:=
Information[QuantityVariable["λ","Length"],"UnitDimensions"]
Out[]=
{{LengthUnit,1}}
In[]:=
Information[QuantityVariable["λ","Length"],"CanonicalUnit"]
Out[]=
Meters
In[]:=
Information[QuantityVariable["λ","Length"]]
Out[]=
QuantityVariableIdentifier
QuantityVariableIdentifier
QuantityVariablePhysicalQuantity
QuantityVariablePhysicalQuantity
Give the physical quantity of a :
In[]:=
QuantityVariablePhysicalQuantity[QuantityVariable["Φ","RadiantFluxDensity"]]
Out[]=
RadiantFluxDensity
The second argument works the same as the single-argument case:
"CanonicalName"
In[]:=
QuantityVariablePhysicalQuantity[QuantityVariable["x","Length"]]
Out[]=
Length
In[]:=
QuantityVariablePhysicalQuantity[QuantityVariable["x","Length"],"CanonicalName"]
Out[]=
Length
———————————————————————————————————————————————————————————————————————————————————
The second argument returns the corresponding :
"Entity"
In[]:=
QuantityVariablePhysicalQuantity[QuantityVariable["Φ","RadiantFluxDensity"],"Entity"]
Out[]=
In[]:=
EntityTypeName
Out[]=
PhysicalQuantity
Find the most common physical quantities for formulas containing the physical quantity:
"Time"
In[]:=
formulas=FormulaLookup[All,RequiredPhysicalQuantities{"Time"}];variables=Flatten[FormulaData[#,"QuantityVariables"]&/@formulas];quantities=Flatten[QuantityVariablePhysicalQuantity/@variables];SortBy[Tally[quantities],Last]//Reverse
Out[]=
{{Time,150},{Speed,48},{MultiplicativeConstants,41},{Distance,35},{Mass,28},{Length,25},{Angle,23},{Acceleration,15},{AngularVelocity,13},{Volume,10},{Money,10},{Height,8},{GravitationalAcceleration,8},{Slowness,7},{Energy,7},{StepRate,6},{StepCount,6},{Radius,6},{FoodEnergy,6},{ElectricResistance,6},{AngularAcceleration,6},{Age,6},{Heat,5},{Power,4},{MomentOfInertia,4},{FourierNumberHeatTransfer,4},{Pressure,3},{MetabolicRate,3},{InformationRate,3},{Information,3},{HumanCaloricEnergyExpenditure,3},{Frequency,3},{ElectricCurrent,3},{DeborahNumber,3},{IndependentPhysicalQuantity[logarithmic sound pressure],2},{WaveAmplitude,2},{TotalEnergy,2},{ThermalDiffusivity,2},{ThermalConductivity,2},{StrideRate,2},{StandardGravitationalParameter,2},{SpecificHeatCapacity,2},{MassDensity,2},{Impulse,2},{Force,2},{ExponentialDecayConstant,2},{ElectricPotentialDifference,2},{AngularFrequency,2},{Amount,2},{Work,1},{WordRate,1},{WordCount,1},{TemperatureDifference,1},{StellarLuminosity,1},{RainfallIntensity,1},{PageRate,1},{PageCount,1},{MagneticInductance,1},{LogarithmicSoundPressureLevel,1},{Lifetime,1},{HeatTransferCoefficient,1},{HalfLife,1},{GrowthConstant,1},{FourierNumberMassTransfer,1},{ElectricPotential,1},{ElectricCapacitance,1},{DiffusionCoefficient,1},{BeatRate,1},{Area,1}}
Length
Length
Mass
Mass
Electric Current
Electric Current
Electric Resistance
Electric Resistance
I think its interesting that 58 formulas have resistance and only 29 have electric current.
Temperature
Temperature
Amount of Substance
Amount of Substance
Luminous Intensity
Luminous Intensity
There's not a lot of formulas for Luminous Intensity.
Delete empty lists:
Use the operator form:
Radians
Radians
Steradians
Steradians
Hertz
Hertz
Newtons
Newtons
Pascals
Pascals
Joules
Joules
Watts
Watts
Coulombs
Coulombs
Volts
Volts
Farads
Farads
Ohms
Ohms
I notice that ohms have the most electrical variables so far.
Siemens
Siemens
Webers
Webers
Teslas
Teslas
Henries
Henries
degree Celsius
degree Celsius
Lumens
Lumens
Lux
Lux
Becquerel
Becquerel
Grays
Grays
Sieverts
Sieverts
Hmm. I noticed that sieverts are dimensionally equivalent to grays, but they are different and shouldn't always be used together.
Katals
Katals
I'm going to make a feature request to add formulas with katals.
Dimensional Analysis