-
Notifications
You must be signed in to change notification settings - Fork 3
Getting Started: Running a co simulation through maestro CLI
Make sure to have java installed (at least version 1.7)
Download the latest coe-jar from the releases: https://github.com/INTO-CPS-Association/maestro/releases/
We will be running a co-simulation of the MassSpringDamper case study, described in https://github.com/INTO-CPS-Association/example-mass_spring_damper.
Download the two Mass Spring Damper FMUs exported from Open modelica: https://github.com/INTO-CPS-Association/example-mass_spring_damper/tree/master/FMUs/OpenModelica
Place both jar and FMUs in the same folder.
Create the following scenario.json
file in the same folder as the jar file:
{
"fmus":{
"{msd1}":"file:/H:/Data/Notes/maestro_cli_tutorial/MassSpringDamper1.fmu",
"{msd2}":"file:/H:/Data/Notes/maestro_cli_tutorial/MassSpringDamper2.fmu"
},
"connections": {
"{msd1}.msd1i.x1": [
"{msd2}.msd2i.x1"
],
"{msd1}.msd1i.v1": [
"{msd2}.msd2i.v1"
],
"{msd2}.msd2i.fk": [
"{msd1}.msd1i.fk"
]
},
"logVariables":{
"{msd2}.msd2i":["x2", "v2"]
},
"parameters": {
"{msd2}.msd2i.c2": 1.0,
"{msd2}.msd2i.cc": 1.0,
"{msd2}.msd2i.d2": 1.0,
"{msd2}.msd2i.dc": 1.0,
"{msd2}.msd2i.m2": 1.0
},
"algorithm":{
"type":"fixed-step",
"size":0.001
},
"loggingOn": false,
"overrideLogLevel": "INFO"
}
With a terminal open on the same folder, run:
java -jar .\coe-1.0.10-jar-with-dependencies.jar --configuration .\scenario.json --oneshot --starttime 0.0 --endtime 10.0
More information about the command line interface can be found in: https://into-cps-maestro.readthedocs.io/en/docs/user/index.html