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
- 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 below. It is a multi-level activity structure where Mission A, Mission B, and Mission C activities are further decomposed.
- Launch the Syndeia Dashboard for the Activity package. Select a Local File System Repository on the RHS, as shown in Figure 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 below.
- 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.
- Syndeia will finish generating Simulink model structure based on the activity structure of SysML activity, as shown in Figure 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.
- 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 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 below—after re-arranging the layout to match SysML activity diagram.
- 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.