play phryzby with physics

A Pendulum by Dimensions

solved DimensionalAnalysis

Q. A pendulum of length l and bob of mass m swings where gravity is g. How does its period depend on what it is made of?

length1 m[L]gravity9.81 m/s²[L T⁻²]mass1 kg[M]power of length?power of gravity?power of mass?period?[T]Dimensional Analysis
Inputs
l
1.00 m
g
9.81earth
m
1
Outputs
power of lengthx0.5
power of gravityy-0.5
power of massz0
periodT2.01 s

How it's solved

Solved with DimensionalAnalysis

Given

  • k=2⋅π from “assumed”
  • l, g, m yours to vary

Find x, y, z, T.

Working
  1. matching time-2⋅y=1
  2. y=−0.5
  3. matching lengthx+y=0
  4. x+(−0.5)=0
  5. x=0.5
  6. matching massz=0
  7. z=0
  8. assumedconstant=2⋅π
  9. constant=2⋅3.14159265
  10. k=6.28318531
  11. period as powersT=k⋅lx⋅gy⋅mz
  12. T=6.28318531⋅10.5⋅9.81(−0.5)⋅10
  13. T=2.01 s
Conclusion

Only powers that make the dimensions match are allowed: x + y = 0 for length, −2y = 1 for time and z = 0 for mass. So T = k√(l ⁄ g). The mass drops out, and dimensions alone could never have told you that k is 2π.

The web of concepts

given read from the words equation asked

The Ruby that solves it

The question and its solution are small Ruby files. The engine runs them.

question.rb
1require_relative "../physics"23question :pendulum_by_dimensions do4  describes "A pendulum of length %{length} and bob of mass %{mass} swings where gravity is %{gravity}. %{period}?"5  given :length6  given :gravity7  given :mass8  asks period: "How does its period depend on what it is made of"9end
solution.rb
1require_relative "../questions/pendulum_by_dimensions"2require_relative "../science/units_and_measurement/dimensional_analysis"34solve :pendulum_by_dimensions, using: DimensionalAnalysis do5  take length: :l, gravity: :g, mass: :m6  assume k: 2 * pi7  find_value :x8  find_value :y9  find_value :z10  take period: :T11  find_value :period1213  conclusion "Only powers that make the dimensions match are allowed: x + y = 0 for length, " \14             "−2y = 1 for time and z = 0 for mass. So T = k√(l ⁄ g). The mass drops out, and " \15             "dimensions alone could never have told you that k is 2π."16end
playground.rb
1require_relative "../solutions/pendulum_by_dimensions"2require_relative "../science/motion_in_a_plane/gravity"34play_with :pendulum_by_dimensions do5  title "A Pendulum by Dimensions"67  input :l, 0.1..3.0,  in: "m", step: 0.05, default: 1.0, as: "length"8  input :g, 1.0..25.0, step: 0.01, default: 9.81, marks: GRAVITY, as: "gravity"9  input :m, 0.1..10.0, step: 0.1, default: 1.0, as: "mass in kilograms"1011  output :x, as: "power of length"12  output :y, as: "power of gravity"13  output :z, as: "power of mass"14  output :T, in: "s"15end
The laws it drew on
quantitywrittenunitswithinfrom
piπ—0 … ∞DimensionalAnalysis
speed of lightcm/s—DimensionalAnalysis
lengthlm—DimensionalAnalysis
gravitygm/s²—DimensionalAnalysis
massmkg—DimensionalAnalysis
periodTs—DimensionalAnalysis
constantk——DimensionalAnalysis
power of lengthx——DimensionalAnalysis
power of gravityy——DimensionalAnalysis
power of massz——DimensionalAnalysis
speedvm/s0 … ∞DimensionalAnalysis
heighthm—DimensionalAnalysis
timets0 … ∞DimensionalAnalysis
accelerationam/s²—DimensionalAnalysis
starts0m—DimensionalAnalysis
starting speedv0m/s—DimensionalAnalysis
distancesm—DimensionalAnalysis
rest massm0kg—DimensionalAnalysis
kinetic energyKJ—DimensionalAnalysis
T=k⋅lx⋅gy⋅mz
period as powers
x+y=0
matching length
-2⋅y=1
matching time
z=0
matching mass
m⋅v22=m⋅g⋅h
energy conserved
s=s0+v0⋅t+a⋅t22
distance under constant acceleration
constant=2⋅π
assumed