The mass spring damper digital twin (DT) has two mass spring dampers. It shows how to use a co-simulation based DT within the DTaaS.
The study includes two simulators, each representing a mass spring damper
system. The first simulator calculates the displacement and speed of mass
This example uses two models and one tool:
| Asset Type | Names of Assets | Visibility | Reuse in Other Examples |
|---|---|---|---|
| Models | MassSpringDamper1.fmu | Private | Yes |
| MassSpringDamper2.fmu | Private | Yes | |
| Tool | maestro-4.1.0-jar-with-dependencies.jar | Common | Yes |
The DT is executed with two configuration files, cosim.json and
time.json. Edit them to customise the DT.
| Lifecycle Phase | Completed Tasks |
|---|---|
| Create | Installs Java Development Kit for Maestro tool |
| Execute | Produces and stores output in data/mass-spring-damper/output directory |
| Clean | Clears run logs and outputs |
To run the example, change to the example directory.
cd /workspace/examples/digital_twins/mass-spring-damperIf required, make the lifecycle scripts executable, for example:
chmod +x lifecycle/createThen run the following scripts.
Installs Open Java Development Kit 21 in the workspace.
lifecycle/createRuns the digital twin. Because this is a co-simulation based digital twin, the Maestro co-simulation tool runs a co-simulation of the two FMU models.
lifecycle/executeThe results are in the /workspace/examples/data/mass-spring-damper/output directory.
The run logs are in /workspace/examples/digital_twins/mass-spring-damper.
Removes the debug files and co-simulation output files.
lifecycle/terminateMore information about co-simulation techniques and the mass spring damper case study is available in:
Gomes, Cláudio, et al. "Co-simulation: State of the art."
arXiv preprint arXiv:1702.00686 (2017).The source code for the models used in this DT is in the mass spring damper GitHub repository.

