Getting a little more realistic

Simple harmonic motion implies that no energy is lost as a system oscillates. In reality, energy does get lost - this is known as damping.

The parameter b in the simulation above is known as the damping parameter - the larger that is, the more pronounced the damping is.

The graph shows position as a function of time, but the energy graphs have a similar look in the sense that they also show a loss of energy as time goes by when damping (like air resistance, for instance) is present.