DGS Studio

Physics / Oscillations

SHM — Custom Amplitude and Frequency

Change the amplitude and angular frequency of an ideal oscillator.

shm is called with amplitude A = 2, angular frequency ω = 1.5, and phase φ = 0. Position is A·cos(ωt + φ) in the ideal model.

Changing ω changes how many oscillations fit into the same time. Changing φ only shifts when the mass passes the equilibrium. The default shm() uses the built-in amplitude and frequency.

Equation

shm(A=2, omega=1.5, phi=0)

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

Try a change

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.

Edit and generate

Generate Graph opens the studio homepage and runs this field. Open in DGS Studio loads the same text and waits for you to generate it. The equation is sent once, as a query parameter.

Related examples