Exercise 10.8 - SysML Requirements -> Simulink Requirements Compare and Sync.

Exercise 10.8 - SysML Requirements -> Simulink Requirements Compare and Sync.

In this tutorial, we demonstrate

Changing SysML requirements in Rhapsody and doing compare/sync with Simulink Requirement

1a: SysML requirement from Rhapsody - Simulink requirement connection

  • 1a1: Adding new child requirements on the SysML side, comparing, and synchronizing.

  • 1a2: Removing existing child requirements on the SysML side, comparing, and synchronizing.

  • 1a3: Updating text of requirements on the SysML side, comparing, and synchronizing.

1b: SysML package - Simulink requirement set connection

  • 1b1: Adding new requirements to SysML package comparing, and synchronizing.

  • 1b2: Removing existing requirements from SysML package, comparing, and synchronizing.

Preparation

This exercise assumes the student has

  • Rhapsody supported version installed correctly on his or her machine with a valid license for use.

  • Syndeia installed as a plugin for Rhapsody with a valid license for use.

  • Syndeia Simulink interface, correctly installed with a valid license for use.

  • MATLAB/Simulink R2016b or later installed correctly on his or her machine with a valid license for use.

  • In this tutorial, we will see the Rhapsody model available as Syndeia_Simulink_Examples.rpyx (Get it here - SysML Models, Profiles and Mappings.)

1a: SysML requirement Rhapsody- Simulink Requirement connection

The steps for this exercise are as follows.

1 Launch the Syndeia Dashboard from Model Generation Package in Rhapsody. It will appear as follows.

Figure 1: Launch the Syndeia Dashboard from the Model Generation package

2 Drag and drop the requirement Payload Mass from the Requirment_Sim package in SysML to a folder in your local file system, e.g. folder S1a. This has two nested requirements Select Model Transform. Select Yes.

Figure 2: Model transform Payload Mass requirement from SysML to folder S1a

3 In the Syndeia Dashboard you can observe the new Simulink requirements file Requirement_Sim.

Figure 3: Syndeia Dashboard showing new Simulink requirements generated

4 In the Connections Search tab, Click click the Get All. The connections between SysML requirements and Simulink requirements generated in the previous step can be seen.

Figure 4: Connections shown in Connection Search tab

5 Open the Simulink requirements model in Simulink, as shown below.

Figure 5: Simulink requirements file in Simulink

6 Compare the connection for Payload Mass and the nested requirements from Connection Search Tab and see the result in the Comparison Result tab.

Figure 6: Comparison Result

7 In the Comparison Result tab the result will show everything is matched.

1a1: Adding new child requirements on SYSML side, comparing, and synchronizing

1 Now we add a new nested requirement on Payload Mass on SysML Side such as Average Mass.

Figure 7: New requirement Average Mass nested under Payload Mass requirement in SysML

 

2 Again In Connections Search, click the Get All. The connections are generated and can be seen below. Compare the connection with Payload Mass as shown below.

Figure 8: Comparing connection in Connection Search tab

3 The Comparison Result tab shows the difference between SysML (Source) And Simulink Requirement (Target). The Comparison Result shows Average Mass is not present in Simulink Requirements. The result is shown below.

Figure 9: Comparison Result

 

4 Now Sync Source-->Target in Syndeia. Click Yes when prompted.

Figure 10: Syncing Source to Target

5 After Sync, click Get All in the Connection Search tab. Here Average Mass connection is generated.

Figure 11: Updated connections in the Connection Search tab

6 In Connections Search Tab click Get All. Again Compare the connection with Payload Mass. The result is Average Mass is now shown in Simulink requirements.

Figure 12: Comparison Result

7 If the Set was already opened in the current MATLAB session as in Section 1a step 5, then it may need to be manually closed and reopened in order to display the changes: Right-click the set and select Close… as shown in Figure 13. We have found that simply closing the Requirements Editor or clicking the 'Refresh’ button will not be sufficient.

Figure 13: Closing the already opened Simulink requirements set

8 Re-open the Requirement Set in Simulink Requirements again.

Figure 14: Re-opening Simulink requirements set

9 In Simulink, we can see that Average Mass has been synced and added.

Figure 15: Simulink requirements set showing new Average Mass requirement

 


1a2: Removing existing child requirements on the SysML side, comparing, and synchronizing

The steps for this exercise are as follows.

1 In the Requirment_Sim package in SysML remove Maximum Mass from Payload Mass.

Figure 16: Removing Maximum Mass requirement in SysML

2 In the Connection Search tab, click the Get All button. Compare Source and Target for the Payload connection. The result shows Maximum Mass is not present on the SysML Rhapsody side.

Figure 17: Comparison result

3 Sync Source → Target for the Payload Mass connection in the Connections Search tab as shown below.

Figure 18: Syncing Source to Target for Payload Mass connection

4 In the Connections Search Tab click the Get All button. Again Compare the connection with Payload Mass again.

Figure 19: Comparison Result

5 The Compare Result shows the Maximum Mass removed.

6 In Simulink Requirements the result is as follows where Maximum Mass is removed. See 1a1 step 7 instructions on closing the set and reopening if the changes are not shown in the Requirements Editor.

Figure 20: Simulink requirements updated

 


1a3: Updating text of requirements on SYSML side, comparing, and synchronizing

The steps for this exercise are as follows.

1 In the Requirement_Sim package in SysML Change Maximum Mass from 100 kg to 50 kg.

Figure 21: Requirement text in SysML before updating

2 This becomes as below in SysML.

Figure 22: Updated requirement text in SysML

3 In Connections Search Tab click Get All button. Again Compare the connection with Payload Mass.

Figure 23: Comparing Payload Mass connection

4 Comparison Result tab shows Maximum Mass is 50 kg on the Rhapsody SysML side and 100 kg on the Simulink Requirements Side.

Figure 24: Comparison result

5 Sync Source (SysML)-->Target(Simulink)on the Payload connection in the Connection Search tab. Again compare the Payload connection. Now Comparison Result will show as below Maximum Mass is 50 kg on both SysML and Simulink sides.

Figure 25: Comparison result

6 Open Simulink Requirement Set, Maximum Mass is updated to 50 kg same as the SysML Model value. See 1a1 step 7 instructions on closing the set and reopening if the changes are not shown in the Requirements Editor.

Figure 26: Simulink Model updated

1b: SysML package - Simulink requirement set connection

1b1: Adding new requirements to SysML package comparing, and synchronizing

The steps for this exercise are as follows.

1 Select the Model Generation:: Requirement_Sim package in SysML Model and drag and drop the package in your local file system, e.g. folder S1b1 as shown below. Select Model Transform. Select Yes.

Figure 27: Model transform Requirements package to folder S1b1

2 In the Connection Search tab, Click the Get ALL button. The connections generated between the SysML requirements and Simulink requirements in the previous step can now be seen, as shown below.

Figure 28: New connections shown in Connection Search tab

3 In Simulink a new Requirement Set is generated.

Figure 29: New requirements set in Simulink

4 Now in SysML Rhapsosdy add a new requirement as Maximum_Altitude as shown below.

Figure 30: New requirement in SysML

5 In the Connection Search tab, Compare Source and Target for the Requirement_Sim package connection as shown below.

Figure 31: Compare from Connection Search tab

6 Compare Result shows Maximum_Altitude is present on SysML Rhapsody side and absent on Simulink Requirement Side.

Figure 32: Comparison Result

7 Sync Source-->Target for the connection for Requirement_Sim Package as shown below.

Figure 33: Sync Source (package) to Target (requirements set) from Connection Search tab

8 Now again in the Connection Search tab, compare the connection for Requirement_Sim package. See the result in Comparison Result. This shows Maximum_Altitude is created on Simulink Side as well now.

Figure 34: Comparison Result

9 In Simulink the Requirement_Sim requirement set is updated with the new requirement Maximum Altitude. This appears as shown below. See 1a1 step 7 instructions on closing the set and reopening if the changes are not shown in the Requirements Editor.

Figure 35: Simulink requirements set updated in Simulink

1b2: Removing existing requirements from SysML package, comparing, and synchronizing

The steps for this exercise are as follows.

1 From the same Model Generation::Requirement_Sim package as from 1b1 above remove the Payload_Data_Rate Requirement from SysML Rhapsody.

Figure 36: Deleting Payload Data Rate requirement in SysML

2 This now appears as shown below in SysML Rhapsody.

Figure 37: Updated SysML Rhapsody

3 In the Connection Search tab, Compare Source and Target for the Requirement_Sim package connection. The result shows Payload_Data_Rate is absent from SysML Rhapsody side and present on Simulink Requirement Side.

Figure 38: Comparison result

4 Sync Source → Target for the connection for Requirement_Sim package as shown below.

Figure 39: Sync Source to Target in the Connection tab

5 Now again, compare the connection for Requirement_Sim Package and see the result in Comparison Result. This will appear as below.

Figure 40: Comparison result

6 In Simulink Requirements this appears shown below with no Payload_Data_Rate requirement in the Requirement_Sim set. See 1a1 step 7 instructions on closing the set and reopening if the changes are not shown in the Requirements Editor.

Figure 41: Requirements set updated in Simulink

 


Note to user: Simulink does not allow us to change the name of the requirement set without changing the parent file name. Changing the Simulink requirement file name will change the path to the file, and orphan the Syndeia connection. This use case is not supported.