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

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

NoteObjectives

In this tutorial, we demonstrate

Changing SysML requirements and doing compare/sync with Simulink Requirement

1a: SysML requirement - 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 the SysML package comparing, and synchronizing.

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

Preparation

This exercise assumes the student has

  • Cameo System Modeler 18.0 - 19.0 (or MagicDraw with SysML plug-in) installed correctly on his or her machine with a valid license for use.

  • Syndeia 3.3 installed as a plugin for Cameo/MagicDraw 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.

  • For this tutorial, we are using the MagicDraw model Syndeia_Simulink_Examples.mdzip (get it here - SysML Models, Profiles and Mappings).

1a: SysML requirement - Simulink requirement connection

The steps for this exercise are as follows.

1 Launch the Syndeia Dashboard from the Model Generation package in SysML Magicdraw/Cameo. 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 Requirements 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 Model_Generation_Requirements.

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.

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

Figure 4: Simulink requirements file in Simulink

6 Compare the connection for Payload Mass and the nested requirements in the Connection Search tab.

7 In Comparison Result, it will show everything is matched as shown below.

Figure 5: Comparison result

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 6: 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 7: Comparing connection in Connection Search tab

3 The Comparison Result tab shows the difference between SysML (Source) And Simulink Requirement (Target). The result is shown below.

Figure 8: Comparison Result

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

Figure 9: Syncing Source to Target

5 After Sync click the Get All in the Connection Search tab. Here Average Mass connection is generated and can be seen as below.

Figure 10: Updated connections in the Connection Search tab

6 Once Sync is over do compare again for Payload Mass in the Connection Search tab.

7 Click Yes.

Figure 11: Comparison result

8 Here the Sync is complete.

9 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 12. We have found that simply closing the Requirements Editor or clicking the 'Refresh’ button will not be sufficient.

Figure 12: Closing the already opened Simulink requirements set

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

Figure 13: Re-opening Simulink requirements set

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

Figure 14: Simulink requirements set showing new Average Mass requirement

 


1a2: Removing existing child requirements on SYSML side, comparing, and synchronizingFr

The steps for this exercise are as follows.

1 In Requirements package in SysML remove 4.1 Maximum Mass from Payload Mass.

Figure 15: Removing Maximum Mass requirement in SysML

2 Click Delete.

3 In the Connection Search tab, click the Get All button. Compare Source and Target for the Payload Connection as shown below.

Figure 16: Comparing Payload Connection from the Connection Search tab

4 This Comparison Result does not show Maximum Mass on the SysML side as can been seen in the result for Comparison Result.

5 Sync Source--> Target for the Connection for Payload Mass in the Connection Search tab as shown below.

Figure 17: Syncing Source to Target for Payload Mass connection

6 In the Connection Search tab, click the Get All button. Compare the Connection for Payload Mass again.

Figure 18: Comparing Payload Mass connection

7 The Compare Result shows Maximum Mass is removed

Figure 19: Comparison Result

8 In Simulink, the result is as follows where Maximum Mass requirement is removed. See 1a1 step 9 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 Requirements package in SysML, change the Maximum Mass from 50 kg to 100 kg as shown below.

Figure 21: Updating requirement text in SysML

2 In the Connection Search tab, Click the Get All button. Compare Source and Target for Payload Mass Connection.

Figure 22: Comparing Payload Mass connection

3 Comparison Result shows the difference between 100 Kg and 50 kg in the Comparison Result tab.

Figure 23: Comparison result

4 Sync the Payload Mass Connection as shown below in the Connection Search tab.

Figure 24: Sync the Payload Mass Connection

5 Now Compare Source and Target again for the Payload Mass connection in the Connection Search tab as shown below.

Figure 25: Compare Source and Target again for the Payload Mass connection in the Connection Search tab

6 In the Comparison Result tab the result is shown below.

Figure 26: Comparison result

 

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

Figure 27: Simulink Model updated

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.

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

The steps for this exercise are as follows

1 Launch Syndeia Dashboard from Model Generation.

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

2 Select the Model Generation:: Requirements Package in SysML Model and drag and drop the package in your local file system, e.g. folder S1c as shown below. Select Model Transform. Select Yes.

Figure 29: Model transform Requirements package to folder S1c

3 Observe the newly created Simulink requirements file Model_Generation_Requirements in the Syndeia Dashboard.

Figure 30: New Simulink requirements file shown in Syndeia Dashboard

 

4 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 31: New connections shown in Connection Search tab

 

5 In Simulink, the new Simulink Requirement Set is generated as seen below.

Figure 32: New requirements set in Simulink

6 Now update the SysML Requirement by adding a new Requirement ' Altitude as shown' under the Requirements package.

Figure 33: New requirement in SysML

7 In Connection Search tab for Package “Requirements- Model Generation_Requirements “ package do Compare Source and Target as shown below.

Figure 34: Compare from Connection Search tab

8 In Comparison Result tab result shows that Altitude Connection is not there in Simulink Requirements.

Figure 35: Comparison Result

9 Sync the connection for Package “Requirements- Model Generation_Requirements “ in the Connection Search tab as shown below.

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

10 Compare Source and Target once again on the connection for Package “Requirements- Model Generation_Requirements “.

Figure 37: Compare Source and Target once again from the Connection Search tab

11 In Comparison Result the result shows the requirement Altitude is updated.

Figure 38: Comparison Result

12 In Simulink Requirements the set Simulink_Requirements_for_MagicDraw.slreqx (get it here - SysML Models, Profiles and Mappings) is updated with Altitude. See 1a1 step 9 instructions on closing the set and reopening if the changes are not shown in the Requirements Editor.

Figure 39: Simulink requirements set updated in Simulink

 


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

The steps for this exercise are as follows

We use the steps continuing from above exercise 1b1 Step 12 onwards.

1 Delete the Payload Data Rate requirement from the Requirements package in SysML.

Figure 40: Deleting Payload Data Rate requirement in SysML

2 In the Syndeia Dashboard Connections Search tab, Click the Get All button. For connection for package ”Requirements- Model Generation_Requirements “ select Compare Source and Target.

Figure 41: Compare from Connection Search tab

3 The Comparison Result tab shows the result as below where Payload Data Rate is present only in Simulink Requirements.

Figure 42: Comparison result

4 Sync the connection for Package ”Requirements- Model Generation_Requirements “ as Sync Source to Target as shown below.

Figure 43: Sync Source to Target in the Connection tab

5 Compare again the connection for package ”Requirements- Model Generation_Requirements as shown below.

Figure 44: Compare from Connection Search tab

6 In the Comparison Result tab the result is shown below where Payload Data Rate is not there now.

Figure 45: Comparison result

7 The Simulink Requirement shows no Payload Data Rate requirement. See 1a1 step 9 instructions on closing the set and reopening if the changes are not shown in the Requirements Editor.

Figure 46: Requirements set updated in Simulink

 


Note to user: Simulink does not allow changing 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.

 

Related content