Mechanical oscillations are a special case of the mechanical motion of a mass point at which the point moves in a limited area around the equilibrium position. The equilibrium position is instead stable equilibrium, which does not point to any tangible resultant force. We choose (if possible) the center of the coordinate system to the equilibrium position. Then the position vector of a particle is the same as a deviation from the equilibrium position.
When repeated oscillations periodically, i.e. repeated if all the physical quantities characterizing the oscillatory motion (position, speed, acceleration), this is a periodic and if the the time course id described by sine (or cosine), also called harmonics oscillations. System that performs mechanical oscillations, called an oscillator.
Force is the cause of every movement. The cause of oscillatory motion is socalled directive (elastic) force. Mechanical oscillations do not exist without this force.
We divided oscillations by the action of forces to this basic cases:
Free oscillations occur where there is active only directive force. (Amplitude of its free oscillation is constant, oscillation is exactly periodic.)
Damped oscillations occur where there is stil active damping force in addition directive forces and already no other. (Damping force can be friction, resistance of the environment, etc.) Damped oscillations are almost periodic – socalled quaziperiodic (Amplitude decreasing with time).
Forced oscillations occur where there is active except directive and damping forces even an external excitation force. (Amplitude of the oscillator depends on the frequency of its free oscillations and excitation frequency.)
Directive force is determined by the "elasticity" of the spring in case of the spring oscillator. This force is directly proportional to the elongation of the spring, thus deflection of the oscillator. However, the force direction opposite to the direction of deflection  spring acts against deflection (it tries to return system to the equilibrium position).
It may be described as:
F = –k·y
(1)
where F – (directive) force, y – deflection of the oscillator and k – socalled stiffness of the spring (constant describing the "elasticity" of the spring).
y(t) = y_{m} · sin(ωt + φ_{0})
where:  y_{m} – maximum deflection (amplitude) 
ω – angular velocity of oscillation  
φ_{0} – the initial phase of oscillation 
the following form:
y(t) = y_{m}· sin( 

· t + φ_{0}) 
(2)
It can thus obtain an expression for the angular frequency ω_{0} of the free oscillation of the relationship (2)  or even better terms for the period T and the frequency of free oscillation f_{0}:
ω_{0} = 

T = 2π 

,  f_{0} = 

· 

(3)
The "Reset" button brings the body of pendulum to its initial position. You can start or stop and continue the simulation with the other button. If you choose the option "Slow motion", the movement will be ten times slower. The spring constant, the mass, the gravitational acceleration and the amplitude of the oscillation can be changed within certain limits. In order to select another physical size you have to click on the appropriate one of the five radio buttons.
The total energy of the oscillator decreases in real oscillators thanks to a general losses (for example resistance movement against environmental elements). The amplitude of the oscillations gradually decreases in consequence of it. We are talking about damped oscillations in this case.
We can – in addition to the previously described parameters (y_{m}, k a m) – system performing damped oscillation characterized by parameter δ – ie. Damping coefficient (unit s^{–1}). This parameter describes just how much the system is damped.
We can distinguish three types of motion (just by the size of damping):
When the system damping is relatively small (that condition δ < ω_{0} is satisfied), the damping is such that it causes quasiperiodic oscillations described by the expression:
y(t) = y_{m} · e^{–δt} · sin(ω_{T} t + φ_{0})
(4)
Note that not only the amplitude is changed (see below), but also the angular frequency of vibration, against undamped oscillator. We get the angular frequency of the subcritically damped oscillation ω_{T} of the formula:
ω_{T} = (ω_{0}^{2} – δ^{2})
We can see a gradual reduction of the amplitude of the damped oscillations in the right figure. The amplitude has exponentially decreasing waveform in case the subcritically damped oscillation. It also shows expression: y_{m}·e^{–δt} in the expression for y(t).
If the damping of the system is such that condition δ = ω is satisfied, damping of the oscillator is critical. Then it also applies that ω_{0}^{2} – δ^{2} = 0 and also ω_{T} = 0. That is, the periodic or quasiperiodic oscillations don't occur.
We can see the waveforms of the damped oscillations for different damping in Figure on the right. The two graphs above show the quaziperiodic oscillations with subcritical damping. (Note the different "speeds of the damping" for different damping!) We see a critical case (left) and supercritical (right) damping at the bottom. It can no longer talk about oscillations in both cases (i.e. critical and supercritical damping)
Periodic or quaziperiodic oscillations don't occur for large damping (similar to the previous case). The condition is satisfied δ > ω_{0}. We then say that the damping of the oscillator is supercritical. The expression ω_{0}^{2} – δ^{2} < 0 that the angular frequency ω_{T} don't exists for real numbers.
The total energy of the oscillator is also reduced thanks to reduction of amplitude at subcritically damped oscillations. So, oscillations disappear completely after some time. If we want to keep the oscillations, it is necessary to regularly update the lost energy by some works of external force. This is the case of the excited harmonic oscillator. Resulting oscillations is called excited or forced. Now it must act on the oscillator, except directive and damping forces, in addition also periodic excitation force. The frequency of the oscillator will adapt the frequency the exciting force ω_{B} after a short time. The amplitude of the oscillator but (as we shall see below) will depend on the frequency of its free oscillations and excitation frequency.
We can generally describe the final excited oscillations by the expression (after stabilization on the excitation frequency ω_{B}):
y(t) = y_{B} · sin(ω_{B} t + φ_{0})
where the amplitude of the resulting oscillations y_{B} depends on the angular frequency of the free oscillation and the excited oscillation (and the damping coefficient) according to the following quite difficult expression:
y_{B} =  F_{Bm} 
m · (ω_{0}^{2} – ω_{B}^{2})^{2} + (2_{ }δ_{ }ω_{B})^{2} 
(5)
where F_{Bm} is the amplitude of the the exciting force, m is the mass of the weight hanging on a spring.
Thanks to the relatively high complexity of the expression (5) we plotted it on a graph, we see clearly what is an amplitude y_{B} versus excitation angular frequency ω_{B}. Different values of damping coefficient δ will be for us the parameter and it will show the damping effect on the shape of the curve.
As it can be observed from the picture, the amplitude y_{B} reaches a significant peak at a certain excitation frequency ω_{B}. Effekt called resonance occurs at this frequency.
We'll proceed so that we can find the maximum of the function y(ω_{B}) for finding the conditions of the maximum for expression (5)  the socalled resonance conditions.
We find the final condition by using derivation
ω_{B0} = ω_{0}^{2} – 2_{ }δ^{2}
(6)
It can be seen directly from the obtained equation (6), that the resonant frequency decreases with increasing damping coefficient δ (shown in figure too). We show by using the putting condition of resonance (6) to the expression (5) that the amplitude of the excited oscillations decreases with increasing damping coefficient δ.
y_{B0} =  F_{Bm}  ·  1 
2_{ }m ω_{B0}  δ 
(7)
The top of a spring pendulum (red circle) is moved to and fro  for example by hand; this motion is assumed as harmonic, which means that it is possible to describe the motion by a cosine function. The oscillations of the spring pendulum caused in this way are called forced oscillations.
On the whole you can see three different types of behaviour:
If the exciter's frequency is very small (this means that the top of the spring pendulum is moved very slowly), the pendulum will oscillate nearly synchronously with the exciter and nearly with the same amplitude.
If the exciter's frequency agrees with the characteristic frequency of the spring pendulum, the oscillations of the pendulum will build up more and more (resonance); in this case the oscillations are delayed about one fourth of the oscillation period compared with the exciter.
If the exciter's frequency is very high, the resonator will oscillate only with a very small amplitude and nearly the opposite phase.
If the constant of attenuation (the friction) is very small, the transient states will be important too; therefore you have to wait some time in this case to notice the mentioned types of behaviour.
The "Reset" button brings the spring pendulum to its initial position. You can start or stop and continue the simulation with the other button. If you choose the option "Slow motion", the movement will be ten times slower. The spring constant, the mass, the constant of attenuation and the angular frequency of the exciting oscillation can be changed within certain limits. In addition, you can select one of three diagrams by using the appropriate radio buttons: The elongations of exciter and resonator as functions of time, The amplitude of the resonator's oscillation dependent on the exciter's angular frequency and The phase difference between the oscillations of exciter and resonator dependent on the exciter's angular frequency.