Physics / Oscillations
Spring-Mass SHM
The angular frequency is calculated from ω = √(k/m).
The spring-mass input is shm(A=2, m=1, k=2.25). The angular frequency is ω = √(k/m), not a number you type separately. With m = 1 and k = 2.25, ω = √(2.25/1).
A is the amplitude of the ideal oscillation. The picture shows the mass on the spring together with position, velocity, and acceleration. Energy stays constant in this undamped model.
Equation
shm(A=2, m=1, k=2.25)
What the simulation is integrating
Physics examples are simulations with a fixed mathematical model. Generate Graph starts the scene and its controls. It does not fit a curve through measured data. Sliders and presets change initial conditions or parameters that the integrator already understands.
Read the conserved quantities and the trails, not only the moving shape. A chaotic system can look smooth for a short time and then diverge. A small change in the input, such as a count or a separation, is part of the example rather than a different kind of physics.
Reading the input
shm(A=2, m=1, k=2.25)— This is a command. The name selects the routine, and the items inside the parentheses are its arguments.
Try a change
- Edit one number in the field, then use Generate Graph. The studio opens on the homepage with the edited text and runs it.
- Use Open in DGS Studio when you want the expression loaded but not run yet.
Generate Graph starts the simulation that this command names. Playback controls belong to that scene. The expression does not become a static y = f(x) plot.