Skip to content

Instructions to install and execute the roundtrip SysML Modelica transformation

Axel Reichwein edited this page May 8, 2013 · 52 revisions
  1. Install the OpenModelicaCompiler revision- 12060 (1.8.1). Newer versions of OMC exist but have not been tested. OpenModelicaCompiler revision- 12060 for Windows can be found at: https://build.openmodelica.org/omc/builds/windows/nightly-builds/older/OpenModelica-revision-12060.exe. Install it under C:\ since there may be some problems if you install it somewhere else. Make sure that omc.exe has been installed in the bin folder of the OMC installation directory (e.g. under C:\OpenModelica1.8.1\bin). If not, uninstall and reinstall OMC.

  2. Create the OPENMODELICA Environment variable if it has not been created through the installation of the OpenModelicaCompiler. On Windows 7, Start->Control Panel->System and Security-> Advanced System Settings->Environment Variables. Define OPENMODELICAHOME to point to drive:\path\to\your\OpenModelica-X.Y.Z\ (e.g. C:\OpenModelica1.8.1). Restart your computer.

  3. Download edu.gatech.mbse.mdsysml2modelica.zip and edu.gatech.mbse.modelica2mdsysml.zip files from the MBSEC SysML-Modelica Integration [page] (http://www.mbsec.gatech.edu/research/projects/active/sysml-modelica-integration).

  4. Place the unzipped folders in the plugins folder of your MagicDraw installation directory (e.g. in C:/Program Files/MagicDraw UML/plugins).

  5. Download the mdProjects2GetStarted.zip file from the MBSEC SysML-Modelica Integration page. The zip file contains two MagicDraw projects (ModelicaImportTest.mdzip: an empty MagicDraw SysML project containing a reference to the SysML4Modelica profile + sysml4modelicaprofile.mdzip: SysMLModelica profile).

  6. Unzip the file and place the MagicDraw projects at the location of your choice. Make sure that both MagicDraw Projects are within the same directory.

  7. Launch the MagicDraw application with administrator rights. The implementation of the roundtrip transformation has been tested on MagicDraw v16.9, v17.0.1 and v17.0.3.

  8. Disable plugin Caliber Integration if available through Options->Environment->Plugins.

  9. Open a new MagicDraw SysML project with a reference to the SysML4Modelica profile. Option A: Open ModelicaImportTest.mdzip in MagicDraw. Option B: Create a new SysML project in MagicDraw with File->New Project-> Create SysML project. Click on the Options menu. Select Use Module. Choose the SysML4Modelica profile (sysml4modelicaprofile.mdzip). Click Next. In the field Module Packages, the SysML4Modelica package should be displayed. If yes, make sure that it is marked and click Finish.

  10. Import a Modelica model into MagicDraw SysML by right-clicking on Data->Modelica to SysML->Import Modelica and selecting the Modelica .mo file of your choice. Sample Modelica files can be found in the sampleModelicaModels.zip file on the MBSEC SysML-Modelica Integration [page]. Sample SysML models resulting from importing these Modelica models into SysML can be found in the sampleSysMLModelsImportedFromModelica.zip file on the MBSEC SysML-Modelica Integration [page] (http://www.mbsec.gatech.edu/research/projects/active/sysml-modelica-integration). Modelica models which are imported into MagicDraw SysML must be encoded in UTF-8 (requirement by OMC).

  11. Create SysML Internal Block Diagrams after having imported a Modelica model into SysML . Right-click the Modelica class which contains connectors and select New Diagram->SysML Internal Block Diagram and choose your favorite layout. Additional manual refactoring will most likely be necessary.

  12. Export a MagicDraw SysML model into Modelica by right-clicking Data or by right-clicking a Modelica package that should be exported and then selecting SysML to Modelica->Generate Modelica. The generated Modelica model will be located in the MagicDraw installation directory and be named generated_Modelica.mo. Sample generated Modelica models resulting from exporting SysML models to Modelica can be found in the sampleGeneratedModelicaModelsFromSysML.zip file on the MBSEC SysML-Modelica Integration [page] (http://www.mbsec.gatech.edu/research/projects/active/sysml-modelica-integration).