Exercise 10.10 - Changing Simulink Requirements and doing Compare/Sync with SysML.

Exercise 10.10 - Changing Simulink Requirements and doing Compare/Sync with SysML.

Objectives

In this tutorial, we demonstrate

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

1a: Simulink Requirement - SysML Requirement connection

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

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

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

1b: Simulink Requirement - SysML Package set connection

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

  • 1b2: Removing existing requirements from Simulink Requirements, 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 R2019b or later installed correctly on his or her machine with a valid license for use.

  • In this tutorial, we will use the Simulink requirement model generated in Exercise 10.7 - SysML Requirements -> Simulink Requirements.

1a: Simulink Requirement - SysML Requirement connection

The steps for this exercise are as follows

1 Continue using the Simulink Requirements Set as generated in Step 3 of 1d from Exercise 10.7 - SysML Requirements -> Simulink Requirements. where we generated a Simulink Requirement Set by Dropping a SysML Package.

Select the Simulink Requirement Payload Mass which has two nested requirements.

Figure 1: Simulink requirements set Requirement_Sim

2 Drag and drop Payload Mass from Requirment_Sim set from Simulink Requirements local folder for eg S1c here, to SysML Rhapsody ModelGeneration::FromSimulinkReq package S1a2 as shown in Syndeia Dashboard below.

Figure 2: Model transform Simulink requirements to SysML

 

3 In the Syndeia Dashboard you can observe the new SysML requirements Payload Mass generated as shown here.

Figure 3: Syndeia showing new SysML requirements

 

4 In SysML Rhapsody this appears as shown below with Payload Mass and nested requirements generated.

Figure 4: SysML containment tree showing new requirements

 

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

Figure 5: Connection Search showing all requirements

6 Compare Payload Mass Connection in the Connection Search Tab and the Comparison Result gives as below.

Figure 6: Comparison Result

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

The steps for this exercise are as follows

1 Now add Average Mass to Simulink Requirement as a nested requirement to Payload Mass as shown below.

Figure 7: Adding nested requirement in Simulink

2 Now Compare the Payload Connection in the Connection Search tab. The Comparison Result shows the result as below.

Figure 8: Comparison result

3 In the Connection Search tab, Sync Target-->Source for the connection for Payload Mass.

Figure 9: Sync Target to Source (Simulink requirements to SysML)

4 Now in Connections Search again compare the connection for Payload Mass again and see the result as below in Connections Result.

Figure 10: Comparison result

5 In Rhapsody SysML this appears as below with Average_Mass added to the Requirements package in package S1a2.

 

Figure 11: New nested requirement shown in SysML

 

Note: The SysML Rhapsody Text is of HTML format when it is sent from Simulink. Since Rhapsody does not support this as of now, this is a limitation of Rhapsody.


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

The steps for this exercise are as follows.

1 Drag and drop Payload Mass from Requirement_Sim set in Simulink Requirements from the local folder for eg S1d here, to SysML Rhapsody Model Generation::FromSimulinkReq package S1a3 as shown in Syndeia Dashboard below.

Figure 12: Model transform Simulink requirements to SysML

2 In the Syndeia Dashboard you can observe the new SysML requirements Payload Mass generated as shown here

Figure 13: Syndeia showing new SysML requirements

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

Figure 14: Connection Search showing all requirements

4 Compare the Payload Mass connection in the Connections Search tab. In Comparison Result tab shows as below.

Figure 15: Comparison Result

5 Now from Simulink Requirements, Requirement_Sim set remove the Maximum Mass requirement as shown below.

Figure 16: Removing requirement in Simulink

6 In Simulink Requirements, Requirement_Sim set now looks as below.

Figure 17: Simulink requirements set after removing a requirement

7 Now, in the Connection Search tab, compare the Payload Mass connection again as shown below.

Figure 18: Comparing Payload Mass connection from Connection Search tab

8 The Compare result is as follows. It shows Maximum Mass on the SysML Rhapsody side and not on Simulink Side.

9 In the Connection Search tab Sync Target (Simulink)--> to Source (SysML) for the Payload Mass Connection as shown below.

Figure 19: Syncing Payload Mass connection from Target to Source

10 Compare the connection for Payload Mass again and the Comparison Result is seen as below.

Figure 20: Comparison result

11 This shows in SysML Rhapsody package S1a3 as below, with Maximum Mass removed now.

Figure 21: SysML containment tree showing requirement removed

 


1a3: Updating text of requirements on Simulink Requirement side, comparing, and synchronizing with SysML Rhapsody Model

The steps for this exercise are as follows.

1 Continuing from the above exercise 1a2 from Simulink Requirements, Requirement_Sim set. Change the value of Minimum Mass from 0 kg to 10 kg as shown below.

Figure 22: Update Simulink requirement

2 Minimum Mass now becomes as below in Requirement_Sim set.

Figure 23: Simulink requirements set after updating a requirement

3 In the Connection Search tab do a compare on Payload Mass Connection. The Comparison Result shows as below.

Figure 24: Comparison result

Note: HTML format on Simulink Requirement Side.

4 In the Connection Search tab, Sync Target (Simulink)-->Source(SysML) for the Payload Mass connection as shown below.

Figure 25: Sync Payload Mass Connection Target to Source

5 Compare once again the Payload Mass connection after Sync. The result is as follows as shown below in the Comparison Result tab.

Figure 26: Comparison Result

6 In SysML Rhapsody S1a3 package, the Minimum_Mass is now updated to 10kg and this appears as below.

Figure 27: SysML requirement updated

 

Note: HTML format coming from Simulink Requirement is not supported by Rhapsody as yet.


1b: Simulink Requirement - SysML Package set connection

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

The steps for this exercise are as follows.

1 Drag and drop the Requirement_Sim set from Simulink Requirements from local folder S1e to the package Sb1 in Model Generation::FromSimulinkReq in SysML Rhapsody as shown below.

 

Figure 28: Model transform Simulink requirements to SysML

 

2 In the Syndeia Dashboard you can observe the new SysML requirement package Requirement_Sim with all requirements generated in package Sb1.

Figure 29: Syndeia showing new SysML requirements

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

Figure 30: Connection Search showing all requirements

4 In SysML Rhapsody the requirement package Requirement_Sim with all requirements generated in package Sb1 appears as below.

Figure 31: SysML containment tree showing new requirements

 

5 In the Connection Search tab, click Get All and do compare on the connections generated. The Comparison Result shows the below result.

Figure 32: The Comparison Result

6 Now we add a new requirement Maximum_Altitude in Requirement_Sim set in Simulink Requirements as shown below.

Figure 33: In Simulink add a new requirement
Figure 34: New requirement added in Simulink

7 In the Connection Search tab do Compare on the connection for package Requirement_Sim as shown below.

Figure 35: Comparing requirement set connection from Connection Search tab

8 The Comparison Result shows Maximum Altitude is not present on the SysML Rhapsody side and is present in the Simulink Requirement side.

Figure 36: Comparison result

9 Now in the Connections Search tab, Sync Target (Simulink)--> Source(SysML) for the connection for package Requirement_Sim as shown below.

Figure 37: Sync requirement set connection from Target to Source

10 Compare once again the connection for package Requirement_Sim after Sync. The result shows Maximum Altitude is now present on the SysML Rhapsody side and also present in the Simulink Requirement side.

Figure 38: Comparison result

11 In SysML Rhapsody, Maximum_Altitude is now generated in the Requirement_Sim package and this now appears as below.

Figure 39: New requirement shown in SysML package

Note: HTML format coming from Simulink Requirement is not supported by Rhapsody as yet.


1b2: Removing existing requirements from Simulink Requirements, comparing, and synchronizing

The steps for this exercise are as follows.

1 Continuing from above exercise 1b1 From Requirement_Sim set in the Simulink Requirements folder delete the below requirement for Payload_Data_Rate.

Figure 40: Removing requirement from Simulink requirement set

 

2 Requirement_Set now appears as below with Payload_Data_Rate removed.

Figure 41: Updated Simulink requirement set

3 In the Connection Search tab, compare the connection for package Requirement_Sim as shown below.

Figure 42: Compare requirement set connection

4 The Comparison Result shows Payload_Data_Rate is now present on the SysML Rhapsody side and not on Simulink Requirement Side.

Figure 43: Comparison result

5 In the Connection Search tab, Sync Target (Simulink)--> Source (SysML) for the connection for package Requirement_Sim as shown below.

Figure 44: Sync Target to Source for the requirement set connection

6 Once Sync is complete, compare the Connection for Requirement_Sim. The Comparison Result tab will show that Payload_Data_Rate is now not present on the SysML Rhapsody side and also not on Simulink Requirement Side.

Figure 45: Comparison Result

7 In SysML Rhapsody, Payload_Data_Rate is now not present in the Requirement_Sim package in Sb1, and this now appears as below.

Figure 46: SysML containment tree showing requirement removed

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 path, and orphan the Syndeia connection. This use case is not supported.