7. Review integrator settings and mass-spring-damper
The identification tag for this tutorial is PDS-AAI. Pregenerated input files for this tutorial are found in the folder named PDS-AAI in the provided tutorial input files.
7.1. Tutorial overview
This tutorial covers:
- Setting up a mass-spring-damper DObject
- Changing the integrator properties
- The consequences of under-sampling
- The difference between the non-adaptive and adaptive integrator
7.2. Setting up a Mass-spring-damper
A mass-spring-damper (MSD) is a DObject in ProteusDS that demonstrates a simple oscillating system and has the ability to illustrate the numerical integrator performance.
- Create a new project and add a MSD DObject.
- The MSD DObject only requires two properties that control the natural frequency and damping of the system. Use the following property declarations in the MSD input file.
// Mechanical
$NaturalFrequency 10
$DampingRatio 0.1
This results in a mass-spring-damper with a natural frequency of 10 Hz and a damping ratio of 0.1.
- In the simulation input file, set
$IntervalOutput 0.01
. The interval output determines how often the integrator will write results to the output files.
The output interval is crucial in capturing the oscillations that will occur in the simulation. If the output interval is too large, data will be lost. If the output interval is too small, the simulation may slow due to writing too much data.
- Generate the state for the MSD using the Custom method. A MSD requires two initial values, the initial velocity is listed first and displacement is listed on the next line. Set the initial velocity to 0 m/s and the initial displacement to 5 m as per the listing below.
<state>
0 //m/s - initial velocity
5 //m - initial position
</state>
- The integrator is a feature that can be changed in the library input file but keep the default integrator settings.
- Set the simulation to run for 10 seconds.
- Run the simulation.
- The results.dat file for each DObject contains the evolution of the state of a DObject through the simulation. Load the results.dat file for the MSD DObject in Excel, Matlab/Octave, or a similar tool with plotting capabilities. Plot the position verses time of the MSD (plot the third verses first column in results.dat). Notice that all the oscillations are clearly represented with ample data points present in Fig. 7.1.

Fig. 7.1 Position vs. Time for Mass-Spring-Damper system.
7.3. Consequences of under-sampling
- Change the output interval (
$IntervalOutput
) to 0.4 s in the Simulation input file. - Rerun the simulation and re-plot the results.
Notice that several oscillations are lost and the results are incorrect in Fig. 7.2. Erroneous data is presented due to under sampling. At a minimum, sampling simulation results should be twice the frequency of interest. In this simulation, the sampling rate is not adequate and information is lost. It is very important to ensure that proper output intervals are set to capture peak motions and loads in the dynamic system response.

Fig. 7.2 Position vs. Time for Mass-Spring-Damper system with loss of data.
7.4. The difference between a non-adaptive and adaptive integrator
ProteusDS has the ability to use a non-adaptive (4th Order RungeKutta) and adaptive integrator (4th/5th Order RungeKutta). A non-adaptive integrator runs at a constant time step, whereas the adaptive integrator adjusts the time step dynamically to account for higher frequency oscillations in the simulation. Loss of data can occur if the time step of the non-adaptive integrator is too large just as if the output interval is too large. In addition, too large of a constant time step may cause destabilization and the simulation to fail. If the output interval is smaller than the desired initial/constant time step, ProteusDS will adjust the initial/constant time step to match the output interval.