Google Classroom
GeoGebraGeoGebra Classroom

SHM of a vertical spring

This activity belongs to the GeoGebra book The Domain of the Time. This animation simulates a simple harmonic motion (SHM) in real time, neglecting friction, for a vertical spring. The animation uses minimal formulas (no trigonometry or differential calculus), only making the necessary changes to the vectors guiding the motion. This motion is nearly identical to that of the previously seen horizontal spring SHM, except for the change in orientation. The only difference between them is that now, in vertical oscillation, gravity is involved, shifting the center of the oscillation from the spring's rest position to the equilibrium position between the restoring force of the spring and gravity. At the start, the construction shows the blue point M in equilibrium: the spring exerts the same force on it, but in the opposite direction of gravity. Drag M down to stretch the spring. The distance you drag it will determine the amplitude. This displacement from the equilibrium position causes the spring to resist, creating an acceleration a (in green), which always points toward the equilibrium point. Press the button to activate the animation. To adapt the slider script, we simply replace: SetValue(v, v + dt a) with: SetValue(v, v + dt (a + g))
SCRIPT FOR SLIDER anima # Calculate the elapsed seconds dt; add one second if t1(1) < tt SetValue(tt, t1(1)) SetValue(t1, First(GetTime(), 3)) SetValue(dt, (t1(1) < tt) + (t1(1) − tt)/1000) # Move M SetValue(aux, v) SetValue(v, v + dt (a + g)) SetValue(M, M + dt v) # Record the period time and the number of complete oscillations SetValue(reg, If(y(aux) < 0 ∧ y(v) > 0, Append(t, reg), reg)) SetValue(osci, If(y(aux) < 0 ∧ y(v) > 0, osci + 1, osci)) Author of the activity and GeoGebra construction: Rafael Losada.