Log in
Log in Simulate Now
Log in Simulate Now

A simple example for energy conservation

By Chloe Allison 17 July 2020

Having covered a theoretical overview and a hands-on tutorial for energy calculation and investigation of energy conservation in electro-mechanical systems, it is time to look at a very simple example.

The aim of this post is threefold:

  • Show a simple example for energy conservation for a body oscillating on a spring
  • Show how conservative and non-conservative forces contribute to the energies
  • Show how any force balance equation can easily be turned into an energy balance

Oscillating mass on a spring

The textbook example for vibrating systems is a lumped mass suspended on a spring. Note that this example requires an understanding of general physics, such as period of oscillation, position, and velocity equations etc.

Also, it is assumed that the (almost constant) gravitational force can be neglected.

Starting with the simplest case, without friction or damping, there is the spring force acting on the body (again, removing the contribution due to gravity).

where y is the position of the mass with respect to the equilibrium position and k the spring constant (in N/m).

Recall, that work (energy) is the line integral of the force along a path. Focusing on an infinitesimal time interval, where dy = vy(t) ?dt, the contribution to energy becomes F?dy = F?vy(t) ?dt. This can be turned into time integral to obtain the total energy along the path:

Note that seemingly we go from a spatial integral along a path to a time integral without much information about the path in time. However, the system is Lagrangian: time directly gives position of the moving body.

Now, as the velocity of the oscillation is finite at every moment, we can do this operation in a generalized fashion: multiply the force balance equation by velocity and integrate in time. This will result in an energy balance:

and can be turned into well-known equations, noting that acceleration is the derivative of velocity, velocity in turn is the derivative of position, and assuming the mass and the spring constant be time invariant:

where the primitive functions in the square brackets are the kinetic energy and potential (spring) energy, respectively. This form also shows well how the system can store energy initially (at tA) either by having a non-zero velocity and/or being displaced from its equilibrium y = 0 position (we are vertical).

An application is illustrated in Figure 1 and Figure 2. In this case, the body starts at a non-zero position with zero velocity. The initial potential energy is converted to kinetic energy, and back, but their sum is always constant.

Figure 1 Energy conservation in an oscillating system

Figure 2 Video of energy conservation in an oscillating system

The above method can be applied in general to go from force balance to energy balance and will be used shortly to obtain loss energies. Even in seemingly distant cases, such as electrical forces, the method is valid. (Starting from F = q?E, the infinitesimal energy contribution F?dx = q?v(t)?dt?E = q?dx/dt?dt?E = I(t) ?dx?E?dt = I(t) ?V(t) ?dt, utilizing the definition of current, I = dq/dt, and voltage, E = dV/dx.)

Oscillating mass with losses

As a slightly more realistic case, add air friction to the system. In this case, the force balance has an additional term, that is usually proportional to the velocity to account for the losses:

where r is the resistance (loss) factor, and the negative sign indicates that the additional resistance force opposes the movement.

To obtain energy (work) for the loss term, use the method discussed before:

Now there is a problem. This equation, although looks simple, does not have a primitive function. Therefore, loss energies need to be numerically integrated. The total energy change for the lossy system is the following:

Note that this is NOT the total energy, but the change of energy of the system between tA and tB. For the simple case, where the mass is displaced at tA = 0, we have zero kinetic energy initially (so the first term becomes the upper limit only):

And according to energy conservation, the total energy change of the closed system should be zero, and therefore Eq. 8 is also zero (in fact, Eq. 7 is zero too). Here the terms are: kinetic energy, friction (loss) energy, and the last two terms are potential (spring) energies, at a later time instant and at zero.

Finally, if we leave this system on its own for a long time, the mass is going to come to rest, with zero kinetic energy, and zero potential energy, and the energy balance will take the following form:

And as discussed before, this must be zero to conserve energy. The second term here is all the dissipated losses during the oscillation, and the third term is the initial potential (spring) energy. These two are equal.

To aid the understanding of these energies and their conservation, please refer to Fig. 3 and 4, where the kinetic, potential and loss energies, and their sum is plotted during oscillation. Note that the kinetic and potential energies still convert from one to the other in general, but during every oscillation cycle, a fraction of the energy is dissipated.

Figure 3 Energy conservation in a lossy oscillator system


This post explains a simple example for energy conservation within lumped, lossy oscillating systems. Energy conservation and frequency-dependent behavior is of utmost importance for electro-mechanical systems – see the links in the introduction for further information. Download OnScale today to start to investigate your device and its performance for various resonant modes are their energy content.

Chloe Allison
Chloe Allison

Chloe Allison is an Application Engineer at OnScale. She received her MA in Electrical and Electronics Engineering from the University of Strathclyde. As part of our engineering team Chloe assists with developing applications, improving our existing software and providing technical support to our customers.

Discover how customers like you found success by
leaving traditional engineering simulation behind

Try OnScale following
our simulation guides

Simulate Now

Discuss your engineering
applications with us

Request a Demo