Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The features presented in this section require the Simulink license feature for Syndeia.

Generating Simulink model from SysML block

Follow the instructions below to generate Simulink model structure from a SysML block structure.

  1. Open the model Syndeia Simulink Examples in MagicDraw.
  2. 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).
    1. Basic Models – SysML block and activity models with primitive / atomic flows
    2. Bus Models – SysML block and activity models with complex / non-atomic flows
    3. LibBlock Models – SysML block and activity models using Simulink library blocks
  3. The instructions presented below are for generating Simulink models from SysML block model in Model Generation::Basic Models::Blocks package.

    Image Added
    Figure 138: SysML block and activity model examples for Simulink model generation 

    Open the Internal Block Diagram (IBD) in the System block, as shown in Figure 139 below. It is a multi-level block structure where blocks PartA, PartB, and PartC are further decomposed and have their own internal structures.

    Image Added
    Figure 139: SysML IBD for the System block

  4. Launch the Syndeia Dashboard for the Blocks package. Select a Local File System Repository on the RHS, as shown in Figure 140 below.
  5. Select Model Transform connection type (middle panel), and drag-n-drop the System block to a folder in the local file system repository (RHS), as shown in Figure 140 below.

    Image Added
    Figure 140: Drag-n-drop a SysML block to a folder to generate a Simulink model

  6. Select Generate Simulink model option in the dialog box and click Yes to continue.

    Image Added
     Figure 141: Selection option to generate a Simulink model

    Image Added
    Figure 142: Selection option to generate a Simulink model

  7. Wait for Simulink model to be generated. The log window in the Syndeia dashboard will show several messages as shown below.

    Image Added
    Figure 143: Selection option to generate a Simulink model

  8. Syndeia will finish generating Simulink model structure based on the internal structure of SysML block, as shown in Figure 144 below. Expand top-level model file (System.slx) to view the structure of the Simulink model that is generated. This will load the model using Simulink. Then expand the Simulink model System to see the internal details and compare with the SysML block structure (LHS).

    Image Added
    Figure 144: Simulink model structure generated from SysML block structure

  9. Syndeia uses the following mapping to generate Simulink model structure from the SysML block structure.

    SysML block -> Simulink model
    SysML block part properties -> Simulink model references
    SysML block ports (full, proxy, flow) -> Simulink ports
    SysML block connectors between ports -> Simulink lines with signal/bus flows

    As see in Figure 144 above, a Simulink model were generated for each SysML block in the context of the System block structure. Part properties pA, pB, and pC of the System block were generated as model references with the same name in the Simulink model. Full, proxy, and flow ports of the System block were generated as Simulink ports, and connectors were generated as lines with signal flows.  
     
  10. Right click on the System.slx file or the System Simulink model in the Syndeia Dashboard and select Open. This will open the newly generated Simulink model in Simulink, as shown in Figure 145 below—after re-arranging the layout to match SysML IBD in Figure 139.

    Image Added
    Figure 145: Simulink model opened in Simulink 
     
  11. Click on the Connection Browser tab in the Syndeia Dashboard, right click on the Blocks package and select Refresh. Then, right click on the Blocks package again and select Expand All. You should see a model transform connection created between each block 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.

Image Added

Figure 146: Syndeia generates model transform connections between SysML blocks and Simulink models

Generating Simulink model from SysML activity 

Follow the instructions below to generate Simulink model structure from a SysML activity structure.

  1. Open the model Syndeia Simulink Examples.
  2. 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).
    1. Basic Models – SysML block and activity models with primitive / atomic flows
    2. Bus Models – SysML block and activity models with complex / non-atomic flows
    3. LibBlock Models – SysML block and activity models using Simulink library blocks

      Image Added
      Figure 147: SysML block and activity model examples for Simulink model generation

  3. The instructions presented below are for generating Simulink models from SysML block model in Model Generation::Basic Models::Activity package.
  4. 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.

    Image Added
    Figure 148: Overall Mission activity model in SysML

  5. Launch the Syndeia Dashboard for the Activity package. Select a Local File System Repository on the RHS, as shown in Figure 140 below.
  6. 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.

    Image Added
    Figure 149: Drag-n-drop a SysML activity to a folder to generate a Simulink model

  7. Click Yes to continue.

    Image Added
     Figure 150: Click Yes to continue

  8. Wait for Simulink model to be generated. The log window in the Syndeia dashboard will show several messages as shown below.

    Image Added
    Figure 151: Messages in the Syndeia Dashboard indicating the generation of Simulink models

  9. 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.

    Image Added 
    Figure 152: Simulink model structure generated from SysML activity structure

  10. Syndeia uses the following mapping to generate Simulink model structure from the SysML activity structure.
    1. SysML activity -> Simulink model
    2. SysML activity call behavior actions -> Simulink model references
    3. SysML activity parameter nodes -> Simulink ports
    4. 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.
       
  11.  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 145 below—after re-arranging the layout to match SysML activity diagram in Figure 148.

    Image Added
     Figure 153: Simulink model opened in Simulink

  12. 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.

Image Added

Figure 154: Syndeia generates model transform connections between SysML activities and Simulink models