1require_relative "../physics"23question :a_metre_long_pendulum do4 kind :numerical5 describes "A pendulum %{length} long swings on the Earth, where g is %{gravity}. %{period}, in seconds?"6 given length: "1 m"7 given gravity: "9.81 m/s2"8 asks period: "How long does one swing there and back take"9end
1require_relative "../questions/a_metre_long_pendulum"2require_relative "../science/units_and_measurement/dimensional_analysis"34solve :a_metre_long_pendulum, using: DimensionalAnalysis do5 take length: :l, gravity: :g6 assume m: "1 kg"7 assume k: 2 * pi8 take period: :T9 answer find_value(:period, in: "s")1011 conclusion "The period grows as the square root of the length and shrinks as the square root of " \12 "the pull, and the mass never enters."13end
1require_relative "../solutions/a_metre_long_pendulum"23play_with :a_metre_long_pendulum do4 title "A Metre-Long Pendulum"5end