Harmonic Oscillator

Introduction
Harmonic oscillatory movement describes movement in which an object that has been displaced from its point of equilibrium is acted upon by a restoring force directly proportional to the amount of displacement. The classic model of such a movement is a weight attached to a spring, oscillating between the two extremes of maximum compression and maximum extension. In a simple (ideal) system as described, no energy is lost and the weight will oscillate for an infinite amount of time between the two extremes . Based on these principles, the position, velocity, and acceleration of such a weight can be modeled by sinusoidal equations, as demonstrated below.

Equations
Equations used to model simple harmonic oscillation in the case of a spring include: K is the spring constant; x is the displacement from position of equilibrium; F is the restoring force Y is position relative to the point of origin; A is maximum elongation; ω is angular frequency (given by ω=2·π·ƒ=(2·π)/T); T is the time to make one full oscillation; φ is the phase difference which gives the position of the body at T=0 and its direction
 * Restoring force: F = -k·x
 * Position of the body: y = A·sin(ω·t + φ)
 * Maximum velocity: Vmax = A·ω
 * Instantaneous velocity: V = Vmax·cos(ω·T)