Computational Essay
Sample Content
▼
Open Guidelines
Tools
Check
Publish to Cloud
Submit to Notebook Archive
Insert Code Group
Insert Headings▼
Insert Text▼
Open/Close Groups▼

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


Unit and Quantity Input

Quantity Components

Quantity Display

Unit Conversion

Quantities with Uncertainty

Physical Quantities

QuantityVariable

A
QuantityVariable
represents a variable associated with a particular physical quantity:
In[]:=
QuantityVariable["V","ElectricPotential"]
Out[]=
V
———————————————————————————————————————————————————————————————————————————————————
QuantityVariable
can be used to specify values in
FormulaData
:
In[]:=
FormulaData["KineticEnergy",{QuantityVariable["K","Energy"]Quantity[10,"Joules"],QuantityVariable["m","Mass"]Quantity[10,"Grams"]}]
Out[]=
v

-20
5
m/s
||
v

20
5
m/s
QuantityVariableIdentifier
can be used to extract the symbol from a
QuantityVariable
:
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
QuantityVariablePhysicalQuantity
:
In[]:=
QuantityVariablePhysicalQuantity[var]
Out[]=
Current
In[]:=
Out[]=
ElectricPotential
———————————————————————————————————————————————————————————————————————————————————
Create a
QuantityVariable
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)


SI Base Units formulas


Continuing on


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[]=
Quantity Variable
Identifier
λ
Physical Quantity
Length
Unit Dimensions
{{LengthUnit,1}}
Canonical Unit
Meters

QuantityVariableIdentifier


QuantityVariablePhysicalQuantity

Give the physical quantity of a
QuantityVariable
:
In[]:=
QuantityVariablePhysicalQuantity[QuantityVariable["Φ","RadiantFluxDensity"]]
Out[]=
RadiantFluxDensity
The
"CanonicalName"
second argument works the same as the single-argument case:
In[]:=
QuantityVariablePhysicalQuantity[QuantityVariable["x","Length"]]
Out[]=
Length
In[]:=
QuantityVariablePhysicalQuantity[QuantityVariable["x","Length"],"CanonicalName"]
Out[]=
Length
———————————————————————————————————————————————————————————————————————————————————
The
"Entity"
second argument returns the corresponding
"PhysicalQuantity"
Entity
:
In[]:=
QuantityVariablePhysicalQuantity[QuantityVariable["Φ","RadiantFluxDensity"],"Entity"]
Out[]=
radiant flux density
In[]:=
EntityTypeName
radiant flux density
PHYSICAL QUANTITY

Out[]=
PhysicalQuantity
Find the most common physical quantities for formulas containing the
"Time"
physical quantity:
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

Mass

Electric Current

Electric Resistance

I think its interesting that 58 formulas have resistance and only 29 have electric current.

Temperature

Amount of Substance

Luminous Intensity

There's not a lot of formulas for Luminous Intensity.
Delete empty lists:
Use the operator form:

Radians

Steradians

Hertz

Newtons

Pascals

Joules

Watts

Coulombs

Volts

Farads

Ohms

I notice that ohms have the most electrical variables so far.

Siemens

Webers

Teslas

Henries

degree Celsius

Lumens

Lux

Becquerel

Grays

Sieverts

Hmm. I noticed that sieverts are dimensionally equivalent to grays, but they are different and shouldn't always be used together.

Katals

I'm going to make a feature request to add formulas with katals.
Dimensional Analysis