Simulation with Parameter Sets

It is possible to run simulation permutations using a combination of multiple iterations and a number of parameter sets.

The two examples covered here are relatively simple and are intended to show the order of simulation achieved by using more than on set of parameters in systems. This option can also save you a lot of time in terms of running a simulation once in order to display a variety of simulation results. The best way to explain this is by way of example.

We need to create a simple system using a Ramp primitive and an XGraph. Proceed as follows:

  1. Click the New Model icon on the toolbar.
  2. Choose System from the Type of Model drop-down menu.
  3. In the Logical Name field enter SimpleParamSet.
  4. Select a Library where you will easily find your new system and click OK.
  5. In the Tree View window go to MLD Libraries→SDF→Sources and add two instances of the Ramp primitive into your blank system window.
  6. Add an instance of the XYGraph, located at MLD Libraries→SDF→Sinks, to your system.
  7. Arrange the instances and connect their ports as shown in the diagram.

You are now ready to create new parameters for your first parameter set.

  1. Click on the background of the Model Editor Window to deselect any model instances in the system. Activate the context menu in the Name column of the System Properties window. Choose New Parameter from the context menu. A new parameter is created with the name Parameter1.
  2. Repeat the procedure to create a second field called Parameter2.

The next step is to give values to the parameters:

  1. Scroll down to the field Parameter1 in the System Properties window.
  2. Set the Scope of Parameter1 to External.
  3. Set the Value of Parameter1 to 1; 2; 3.
  4. Also, set the Scope of Parameter2 to External and set the Value to 4; 5; 6.

You now need to link the parameters step and value of the model instances Ramp#1 and Ramp#2 to Parameter1 and Parameter2 respectively:

  1. Click on the Ramp#1 primitive model instance in the Model Editor window.
  2. Right-click on the step parameter in the Instance Properties window. Choose Link To and select Parameter2 from the submenu.
  3. Right-click on the value parameter, choose Link To and select Parameter1 from the submenu.
  4. Click on the Ramp#2 primitive model instance in the Model Editor window.
  5. Right-click on the step parameter in the Instance Properties window. Choose Link To and select Parameter2 from the submenu.
  6. Right-click on the value parameter, choose Link To and select Parameter1 from the submenu.

To identify the specific graphs later on, enter a title for the model instance XYGraph#1:

  1. Click on the XYGraph#1 model instance in the Model Editor window.
  2. Set the Value of the title parameter to Graph $absIter.

Switch to Simulation Mode and activate the Simulation Properties window. Set the RunLength to 2 to see the results of the simulations clearly. Large simulations often produce many graphs that all appear the same at first glance but are in fact all very different. This is a result of the scale factor of the XYgraph. You will often only see the differences when you use the Zoom function (click and drag the mouse over a section of the graph).

 

Permutation of Simulation with three step parameters and three start values

Graph Number

Start Value

Step Size

1

1

4

2

2

4

3

3

4

4

1

5

5

2

5

6

3

5

7

1

6

8

2

6

9

3

6

The next step is to create a second Parameter Set and see what results or permutations are achieved.

To create or delete Parameter Sets Switch to Edit Mode. If the System Properties plane in the Propery Editor is active you will see a combo box above the Properties Editor with Parameter Set 1 as default item.

Right-click on the combo box and choose New Parameter Set. All default values from Parameter Set 1 are set as default value in Parameter Set 2. For this example proceed as follows:

  1. Choose Parameter Set 1 from the Parameter Set drop-down menu.
  2. Set the Value of Parameter1 to 1; 2; 3 and the Value of Parameter2 to 4.
  3. Set the Value of RunLength to 2.
  4. Choose Parameter Set 2 from the Parameter Set drop-down menu.
  5. Set the Value of Parameter1 to 3 and the Value of Parameter2 to 5; 6.
  6. Set the Value of RunLength to 2.
  7. Save the system, Switch to Simulation Mode and run the simulation again.

If you have to simulate a lot of iterations, writing a sequence of semicolon separated numbers is cumbersome and unnecessary. Instead you can use a loop notation in the form of for n to m step i. So, for example, instead of setting Parameter1 of Parameter Set 1 to 1; 2; 3 you can also set it to for 1 to 3 step 1.

Permutation of Simulation with two Parameter Sets and three start values

Graph Number

Start Value

Step Size

1

1

4

2

2

4

3

3

4

4

3

5

5

3

6