Sweep One Parameter
You can sweep one parameter, and display the result as
trajectories or last points.
In this scenario, you work with the model example Coupled Clutches and
sweep the parameter J1.J and plot the trajectories and last
points of the parameters J1.w and
J2.w.
Before you begin:
Open the model example
Coupled Clutches and simulate it.
-
From the Simulation section of the action bar, click Sweep Parameters
.
The Sweep Parameters immersive panel appears.
The panel is divided into two sections:
- Parameters to sweep
- Variables to plot
-
To select the parameter
J1.J to sweep, drag it, from the
Variable Browser, into the
Parameters to sweep section of the
Sweep Parameters immersive panel.
-
To generate an equidistant grid for the sweep of
J1.J, click the corresponding
and, in the
dialog box that appears:
-
In the Minimum value field, enter
0.5
-
In the Maximum value field, enter
1.5
-
In the Number of points field, enter
5
Note:
To generate a grid with logarithmic scale (not used in this scenario) you can activate
Logarithmic scale.
-
To select to plot
J1.w and
J2.w, drag them from the
Variable Browser, into the
Variables to plot section of the
Sweep Parameters immersive panel.
-
In the panel, select
Trajectory and then click
Run Sweep.
- The trajectories of J1.w and J2.w are
plotted according to the equidistant grid specified.
- A
Modelica Scripting window appears,
displaying the underlying function call of the sweep.
-
To instead plot the last points, in the panel, select
Last Point and then click
Run Sweep.
- The last points of J1.w and J2.w are
plotted.
- In the
Modelica Scripting window, the underlying
function call of the new sweep is displayed.
Sweep Two Parameters
You can sweep two parameters, and display the result as trajectories or last points.
Note:
In this scenario, you extend the previous scenario and sweep the parameters
J1.J and J2.J and plot the last
points of the parameter J2.w.
Before you begin:
You have performed the previous scenario above.
-
From the
Variable Browser, drag the missing parameter
J2.J into the
Parameters to sweep section of the
Sweep Parameters panel.
-
In the panel, for J2.J perform Step 3 from the
previous task on it, to generate an equidistant grid like for
J1.J.
-
In the panel, for J1.w clear the corresponding check
box to deactivate the plotting of it.
Note:
You can also click to remove the parameter from the panel.
-
In the panel, select
Last Point and then click
Run Sweep.
The last points of
J2.w given the combinations
J1.J and
J2.J are calculated. The
Modelica Scripting window displays:
Sweep More Than Two Parameters
You can sweep more than two parameters, and display the result as last
points.
Note:
In this scenario, you extend the previous scenario and sweep the parameters
J1.J, J2.J, and
J3.J and plot the last points of the parameter
J3.w.
Before you begin:
You have performed the previous scenario above.
-
From the Variable Browser, drag the missing parameter
J3.J into the Parameters to
sweep section of the Sweep Parameters
panel.
-
In the panel, for J3.J perform Step 3 from the first
task above on it, to generate an equidistant grid like for
J1.J.
-
In the panel, for J2.w clear the corresponding check
box to deactivate the plotting of it.
Note:
You can also click to remove the parameter from the panel.
-
In the panel, select Last Point and then click
Run Sweep.
The last points of J3.w given the
combinations J1.J, J2.J, and
J3.J are calculated. The Modelica
Scripting window displays:
|