Function Repository Resource:

CoupledPendulumFormula

Source Notebook

Compute the final angles and spring length of a coupled pendulum based on initial conditions

Contributed by: Jason Martinez

ResourceFunction["CoupledPendulumFormula"][parameters,initalcond]

computes the angles and spring length based on system parameters and initial conditions initialcond.

ResourceFunction["CoupledPendulumFormula"][property]

returns the specified property of the coupled pendulum formula.

Details

To solve for the final angles and spring length of a coupled pendulum, the following system parameters must be defined in parameters:
dpivot distance
kspring constant
l0spring equalibrium length
l1pendulum 1 length
l2pendulum 2 length
m1pendulum 1 mass
m2pendulum 2 mass
Gravitational acceleration "g" can also be specified. If unspecified it is assumed to be equal to the "StandardAccelerationOfGravity".
Additionally the following initial conditions must be defined in initialcond:
liinitial spring length
ttime
θ1,ipendulum 1 initial angle from vertical
θ2,ipendulum 2 initial angle from vertical
In addition to the final spring length and pendulum angles, the solutions for the angle and length evolutions ("Angle1Solution", "Angle2Solution", and "LengthSolution") from the initial time to the final time t are provided.
Properties include:
"Formula"equations for spring pendulum
"QuantityVariableDimensions"list of base dimensions for all variables
"QuantityVariableNames"English names for all variables
"QuantityVariablePhysicalQuantities"physical quantities for all variables
"QuantityVariables"list of all variables
"QuantityVariableTable"details on all variables

Examples

Basic Examples (2) 

Solve for the final spring length and final angles from the vertical for a coupled pendulum:

In[1]:=
ResourceFunction["CoupledPendulumFormula"][
 Association["d" -> Quantity[2, "Meters"], "k" -> Quantity[150, "Newtons"/"Meters"], "l1" -> Quantity[2, "Meters"], "l2" -> Quantity[2, "Meters"], "l0" -> Quantity[2, "Meters"], "m1" -> Quantity[5, "Kilograms"], "m2" -> Quantity[5, "Kilograms"]], Association["theta1i" -> Quantity[20, "AngularDegrees"], "theta2i" -> Quantity[30, "AngularDegrees"], "t" -> Quantity[12, "Seconds"]]]
Out[1]=

Specify gravitational acceleration:

In[2]:=
ResourceFunction["CoupledPendulumFormula"][
 Association["d" -> Quantity[2, "Meters"], "k" -> Quantity[150, "Newtons"/"Meters"], "l1" -> Quantity[2, "Meters"], "l2" -> Quantity[2, "Meters"], "l0" -> Quantity[2, "Meters"], "m1" -> Quantity[5, "Kilograms"], "m2" -> Quantity[5, "Kilograms"], "g" -> Entity["Planet", "Mars"][
    EntityProperty["Planet", "Gravity"]]], Association["theta1i" -> Quantity[20, "AngularDegrees"], "theta2i" -> Quantity[30, "AngularDegrees"], "t" -> Quantity[12, "Seconds"]]]
Out[2]=

Scope (3) 

Examine the equations of motion for a coupled pendulum:

In[3]:=
ResourceFunction["CoupledPendulumFormula"]["Formula"]
Out[3]=

Find the quantity variables used by the CoupledPendulumFormula:

In[4]:=
ResourceFunction["CoupledPendulumFormula"]["QuantityVariables"]
Out[4]=

Obtain their formal names:

In[5]:=
ResourceFunction["CoupledPendulumFormula"]["QuantityVariableNames"]
Out[5]=

Derive the physical quantities and unit dimensions of the variables:

In[6]:=
ResourceFunction[
 "CoupledPendulumFormula"]["QuantityVariablePhysicalQuantities"]
Out[6]=
In[7]:=
ResourceFunction[
 "CoupledPendulumFormula"]["QuantityVariableDimensions"]
Out[7]=

Examine a table combining all the information about the quantity variables used or derived by CoupledPendulumFormula:

In[8]:=
ResourceFunction["CoupledPendulumFormula"]["QuantityVariableTable"]
Out[8]=

Applications (1) 

See how the pendulum angles and spring length evolve over time:

In[9]:=
Plot[{result["Angle1Solution"][t], result["Angle2Solution"][t]}, {t, 0, 12}]
Out[9]=
In[10]:=
Plot[result["SpringLengthSolution"][t], {t, 0, 12}]
Out[10]=

Version History

  • 1.1.0 – 25 May 2021
  • 1.0.0 – 06 November 2019

Related Resources

License Information