Generating Simulink model from SysML activity
Follow the instructions below to generate Simulink model structure from a SysML activity structure.
- Open the model Syndeia Simulink Examples.
- The Model Generation package is the main package and it contains the following three sub-packages, each of which have a SysML block model (Blocks package) and SysML activity model (Activity package).
- Basic Models – SysML block and activity models with primitive / atomic flows
- Bus Models – SysML block and activity models with complex / non-atomic flows
- LibBlock Models – SysML block and activity models using Simulink library blocks
Figure 147: SysML block and activity model examples for Simulink model generation
- The instructions presented below are for generating Simulink models from SysML block model in Model Generation::Basic Models::Activity package.
- Double click on the Overall Mission activity model to open the activity diagram, as shown in Figure 148 below. It is a multi-level activity structure where Mission A, Mission B, and Mission C activities are further decomposed.
Figure 148: Overall Mission activity model in SysML - Launch the Syndeia Dashboard for the Activity package. Select a Local File System Repository on the RHS, as shown in Figure 149 below.
- Select Model Transform connection type (middle panel), and drag-n-drop the Overall Mission activity to a folder in the local file system repository (RHS), as shown in Figure 149 below.
Figure 149: Drag-n-drop a SysML activity to a folder to generate a Simulink model - Click Yes to continue.
Figure 150: Click Yes to continue - Wait for Simulink model to be generated. The log window in the Syndeia dashboard will show several messages as shown below.
Figure 151: Messages in the Syndeia Dashboard indicating the generation of Simulink models - Syndeia will finish generating Simulink model structure based on the activity structure of SysML activity, as shown in Figure 152 below. Expand top-level model file (Overall_Mission.slx) to view the structure of the Simulink model that is generated. Then expand the Simulink model Overall_Mission to see the internal details.
Figure 152: Simulink model structure generated from SysML activity structure - Syndeia uses the following mapping to generate Simulink model structure from the SysML activity structure.
- SysML activity -> Simulink model
- SysML activity call behavior actions -> Simulink model references
- SysML activity parameter nodes -> Simulink ports
- SysML activity object flows -> Simulink lines with signal/bus flows
As see in Figure 152 above, Simulink models were generated for each SysML activities in the context of the Overall Mission activity. Call behavior actions ma, mb, and mc of the Overall Mission activity were generated as model references with the same name in the Simulink model. Activity parameter nodes were generated as Simulink ports, and object flows were generated as lines with signal flows.
- Right click on the Overall_MIssion.slx file or the Overall_Mission Simulink model in the Syndeia Dashboard and select Open. This will open the newly generated Simulink model in Simulink, as shown in Figure 153 below—after re-arranging the layout to match SysML activity diagram in Figure 148.
Figure 153: Simulink model opened in Simulink - Click on the Connection Browser tab in the Syndeia Dashboard, right click on the Activity package and select Refresh. Then, right click on the Activity package again and select Expand All. You should see a model transform connection created between each activity in the structure and the corresponding Simulink model that has been generated. These connections can be used for downstream compare and (potentially) synchronization of SysML and Simulink models.
Figure 154: Syndeia generates model transform connections between SysML activities and Simulink models
Copyright 2018 Intercax.