Adding a PET Driver¶
Adding a Parameter Study Driver to the PET¶
1. Left-click on the ParameterStudy icon in the Part Browser and drag it onto the PET canvas.
- Double-click on the ParameterStudy model.
A window with a blank canvas will open up.
Note
You can quickly switch between windows via the tabs located above the canvas.
We want this ParameterStudy Driver to provide the paraboloid.py script in the PythonWrapper Component with varying “x” and “y” inputs and then record the resulting “f_xy” output for each set of inputs.
Add Design Variables to the Driver¶
3. Left-click on the Design Variable icon in the Part Browser and drag it onto the ParameterStudy canvas.
- Left-click the newly added DesignVariable to select it.
- Left-click on the “DesignVariable” label and change it to “x”.
Note
The name can also be changed in the Object Inspector window
- Left-click on the Design Variable x to select it.
- Locate the Range field under Attributes in the Object Inspector window.
- Set x’s range by entering “-50,+50” in the Range field.
9. Repeat steps 3-8 to add a second Design Variable y with a range of -50,+50 as well.
Note
Zoom in and out of the canvas by rolling the mousewheel while
holding down control
.
Add an Objective to the Driver¶
Now, we need to add an Objective to record the output of paraboloid.py.
10. Left-click on the Objective icon in the Part Browser and drag it onto the ParameterStudy canvas.
- Change Objective’s name to f_xy.
- Left-click on the ParameterStudy canvas to select it.
- Locate the Code field under Attributes in the Object Inspector window.
- Enter “num_samples=31” in the Code field
- Select Full Factorial for DOE Type: field.
We have set our ParameterStudy Driver to use a Full Factorial method with 31 samples per independent design variable. Given our two design variables x and y, the ParameterStudy will conduct a Full Factorial experiment with 961 total input combinations.
Note
If we had selected the Uniform DOE Type, the ParameterStudy would generate only 31 input combinations (regardless of the number of Design Variables).
Note
The FullFactorial DOE Type becomes cumbersome as the number of Design Variables increases.
For example, if there were 6 Design Variables in this example, then ParameterStudy would attempt to test 887,503,681 input combinations!
As the number of Design Variables increases, it is often more efficient to use one of the other DOE Types and/or reduce the size of the design space.
- Open the parameterstudy_tutorial window.
Notice that Design Variables x and y as well as the Objective f_xy are now exposed as ports on the outside of the ParameterStudy model.
Note
Sometimes, changes inside a block such as a Design Variable name change are not immediately reflected in the main PET canvas. If this happens, left-click the Repaint icon on the Modeling toolbar to manually refresh the canvas.