Using Parameter Blocks
Parameter Blocks provide an easy way to:
organize / structure you model so important parameters are quickly discernable
make parameters available to multiple components in your model
make parameters available for a rerun (see tasks,simulating,rerunningSimulation)
To add parameters to a Parameter Block:
When you create a new model, the model will by default, have a Parameter Block attached to it. Note: When you open an existing model, created with an older version of MapleSim, your global parameters are automatically converted to a Parameter Block.
Double-click the Parameter Block ( ) in the Model Workspace.
Enter the names, values, and descriptions for the parameters you want to define in the Parameter Block. Pressing Enter after completing the information for your parameter creates another row below for an additional parameter.
When you have finished entering your parameters click Diagram View ( ) to return to the diagram view of the model,
You can now assign the values defined in the Parameter Block as a variable or function of a variable to components in your model. To view an example, see the Global and Subsystem Parameters section in Chapter 2 of the MapleSim User's Guide.
Upon simulation, these parameters will now be available on the Rerun Simulation Results tab where you can quick modify and resimulate your system (without the need to fully rebuild the simulation model) For more information, see tasks,simulating,rerunningSimulation
To make additional adjustments to these parameters, you can use the Rerun Simulation Results tab. For more information, see tasks,simulating,reRunSimulationResultsWindow
Notes
Parameter Blocks must be placed in the same subsystem (or hierarchically above) as the components in which you want to use them.
Parameter Blocks at the same hierarchical level in a model cannot have the same parameter names. For example, two separate parameter Blocks in the same subsystem cannot each contain a parameter called "mass."
You can add Parameter Blocks to a custom library if you want to reuse the parameter values in another model.
An Example
The example below illustrates the use of a Parameter Block in a model. While the example might stray out of the scope for this help topic on Parameter Blocks, it is helpful to the user to see how Parameter Blocks tie into the bigger picture of rerunning models without the need to recompile and run the entire model.
From the File menu, select New, then select Model. Alternatively, press CTRL+N.
In the newly created Model Workspace, notice the Parameter Block automatically added to the model. By default, the Parameter Block is named sysParams.
From the Library Components panel, add the following components to the Model Workspace:
From 1-D Mechanical, select Common, then add an Inertia component.
From 1-D Mechanical, select Common, then add a Rotational Spring Damper component.
From 1-D Mechanical, select Common, then add a Rotational Fixed Component.
Connect the components as shown below.
Attach a probe to the Inertia component
Double-click sysParams. Notice this brings up the Parameters settings window.
In the Name field, enter Damping, then select Rotational Damping Constant for the Type, enter 1 for the Default Value and select for the Default Units. Press Enter. This creates another row to which you can add another Parameter.
In the newly created row, enter Inertia in the Name field, Inertia [[kg m2]] in the Type field, enter 1 for the Default Value and select kg m2 for the Default Units.
Click Diagram View (Home) ( ) to return to the Model Workspace.
In the Model Workspace, click the Inertia component, then select Simulation Settings ( ).
Under Parameters-> General, change the Moment of Inertia value from the default to Inertia (the same as the Name field in step 8).
Similarly, in the Model Workspace, click the Rotational Spring Damper, then select Simulation Settings ( ).
Under Parameters-> General, change the Damping Constant value from the default to Damping (the same as the Name field in step 7).
Now, you are automatically using the values in the model as defined in the Parameter Block.
Notice that the Make Parameters Available for Rerun option has been selected. This means that, after the model has run one complete simulation, the parameters that are defined in the Parameter Block can be retuned and used in follow up simulation, without having to recompile the entire model.
You can turn off this option by deselecting Make Parameters Available for Rerun.
See Also
Creating Parameter Blocks with the Modelica Custom Component Template
Specifying Parameter Values
Specifying Parameters for Multiple Components
Assigning Global Parameters
Adding Components to a Custom Library
Running a Simulation
Saving and Applying Parameter Sets
Deleting a Parameter Set
Renaming a Parameter Set
Comparing Parameter Sets
Download Help Document