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.
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.
3 In the Syndeia Dashboard you can observe the new SysML requirements Payload Mass generated as shown here.
4 In SysML Rhapsody this appears as shown below with Payload Mass and nested requirements generated.
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.
6 Compare Payload Mass Connection in the Connection Search Tab and the Comparison Result gives as below.
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.
2 Now Compare the Payload Connection in the Connection Search tab. The Comparison Result shows the result as below.
3 In the Connection Search tab, Sync Target-->Source for the connection for Payload Mass.
4 Now in Connections Search again compare the connection for Payload Mass again and see the result as below in Connections Result.
5 In Rhapsody SysML this appears as below with Average_Mass added to the Requirements package in package S1a2.
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.
2 In the Syndeia Dashboard you can observe the new SysML requirements Payload Mass generated as shown here
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
4 Compare the Payload Mass connection in the Connections Search tab. In Comparison Result tab shows as below.
5 Now from Simulink Requirements, Requirement_Sim set remove the Maximum Mass requirement as shown below.
6 In Simulink Requirements, Requirement_Sim set now looks as below.
7 Now, in the Connection Search tab, compare the Payload Mass connection again as shown below.
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.
10 Compare the connection for Payload Mass again and the Comparison Result is seen as below.
11 This shows in SysML Rhapsody package S1a3 as below, with Maximum Mass removed now.
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.
2 Minimum Mass now becomes as below in Requirement_Sim set.
3 In the Connection Search tab do a compare on Payload Mass Connection. The Comparison Result shows as below.
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.
5 Compare once again the Payload Mass connection after Sync. The result is as follows as shown below in the Comparison Result tab.
6 In SysML Rhapsody S1a3 package, the Minimum_Mass is now updated to 10kg and this appears as below.
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.
2 In the Syndeia Dashboard you can observe the new SysML requirement package Requirement_Sim with all requirements generated in package Sb1.
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
4 In SysML Rhapsody the requirement package Requirement_Sim with all requirements generated in package Sb1 appears as below.
5 In the Connection Search tab, click Get All and do compare on the connections generated. The Comparison Result shows the below result.
6 Now we add a new requirement Maximum_Altitude in Requirement_Sim set in Simulink Requirements as shown below.
7 In the Connection Search tab do Compare on the connection for package Requirement_Sim as shown below.
8 The Comparison Result shows Maximum Altitude is not present on the SysML Rhapsody side and is present in the Simulink Requirement side.
9 Now in the Connections Search tab, Sync Target (Simulink)--> Source(SysML) for the connection for package Requirement_Sim as shown below.
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.
11 In SysML Rhapsody, Maximum_Altitude is now generated in the Requirement_Sim package and this now appears as below.
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.
2 Requirement_Set now appears as below with Payload_Data_Rate removed.
3 In the Connection Search tab, compare the connection for package Requirement_Sim as shown below.
4 The Comparison Result shows Payload_Data_Rate is now present on the SysML Rhapsody side and not on Simulink Requirement Side.
5 In the Connection Search tab, Sync Target (Simulink)--> Source (SysML) for the connection for package Requirement_Sim as shown below.
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.
7 In SysML Rhapsody, Payload_Data_Rate is now not present in the Requirement_Sim package in Sb1, and this now appears as below.
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.