Linking PSIM with HyperStudy
This article will act as a practical guide to integrating PSIM and HyperStudy: A dynamic duo for engineers who want to embrace data-driven design!
HyperStudy is a multi-disciplinary study and optimization software for engineers and designers. It can directly link with the PSIM solver in order to conduct trade-off studies, leverage predictive modeling and fine-tune parameters in an automated way.
PSIM:
- Design your schematic
- Determine the circuit parameters to investigate and their potential effects
- Identify the signals to investigate for their effects
HyperStudy:
- Access inputs and outputs of the PSIM simulation in an automated way
- Batch run simulations with different circuit parameters
- Analyze patterns in the outcome data
- Optimize system performance and cost-effectiveness in a user friendly manner
HyperStudy follows a specific structure and it's important to follow the exact order of the steps in order to avoid potential issues. The version of HyperStudy used is 2022.3. Let's dive right into the steps:
Step 1
Use PSIM v2022.2 or v2023.0 onwards to connect with HyperStudy. Select a circuit topology to simulate or create your own schematic from scratch. In this case, the simple buck converter will be investigated. Let’s analyze how the inductance, capacitance, load and switching frequency will impact the inductor current overshoot.

Instead of assigning specific values to the respective blocks, let’s use variable names that can be later utilized to parameterize the circuit (e.g. L, C, R, Fsw). These variables will be stored in a parameter file, in this case paramters-1.txt. The name of the parameter file is important.
Insert voltage and current probes (or flags) to save the outputs signals of your interest. Here a current flag is enabled inside the inductor and a voltage probe is used for the output voltage. Save the schematic in a project folder but don’t close the PSIM window just yet.
Step 2
Let’s move on to the HyperStudy side of things.
- Open HyperStudy, then select “New” and save your new study in the same folder as your PSIM schematic

- Then navigate to “Add Model” and after naming it, select “Parameterized File”

Inside the folder where the study is saved, you should find a "parameters-1.txt" file generated by PSIM. We'll need to modify the values within this file for each run of our study. To facilitate this process, we'll create a HyperStudy template (.tpl file) during the "Define Models" stage:
- Open the parameters.txt with Notepad++ and save it using the UTF-8 encoding

- Go to “Tools,” choose “Editor,” and load the “parameters-1.txt” file. Once loaded, right-click on the values you want to modify and select “Create Parameter”

- From here the parameter window will appear which then will allow you to specify the bounds per parameter/design variable
- Then click “Save”, name the file as “parameters-1”[.tpl] and save it in the same project folder
- If prompted with the message “This template contains reserve Templex characters..”, click “Yes” and “OK”
- Now the project folder should contain three files: “buck.psimsch”, “parameters-1.txt” & “parameters-1.tpl”
Step 3
- Navigate to the “Resource” tab and click on the three dots located in the right corner. Then load the “.tpl” file and click “OK”

- Then go to the “Solver Input File” tab and change the file name form “parameters-1.tpl” to “parameters-1.txt”

- Next select “Model Resources” and you will be presented with a window that shows the relation of the input resources and the Run Directory files created by HyperStudy for each simulation

- The window indicates that based on the “parameter-1.tpl,” the “parameter-1.txt” will vary in each run
- All the PSIM simulation files (including .ssf files and sub-circuit files) except parameters-1.txt, must be imported and copied to the Run Directory
- Το do this, navigate to “Add Resource”, select “Add input file” and load the file. Then select the “Copy” operation mode


- The import order matters as we will see later. For this tutorial make sure to import .psimsch file first, in order to appear just below the .tpl file
- Tip: If the “Add Resource” option is grayed out, click on “{ }buck_setup(m_1)” to reactivate it
- Then close this window and navigate to the “Solver Execution Script” tab

- Here the PSIM solver will be registered. PSIM v2022.2 is used for this guide but you can also work with v2023 onwards. Please avoid using version 2022.3

- From the drop down menu, click on “Register New Solver”, then “Add solver script” and select “Other Application”
- Name the solver “PSIM” and add the path of your “PsimCmd.exe” for the version of PSIM you are using
- This enables HyperStudy to call PSIM simulations from cmd
Step 4
- Navigate to the “Solver Input Arguments” tab. Input argument “1” specifies the input simulation file thus the .psimsch file. Input Argument “2” specifies the output path

- If the Resources are added in correct order (the .tpl first and the .psimsch second) then you can use the following commands to specify the input and output for each simulation:
In the Input Argument 1 box, type: -i ${m_1.file_2}
In the Input Argument 2 box, type: -o ${dirname m_1.file_1}/${root m_1.file_2}.txt
- There is also a description of the commands in this window
- Verify that the paths are correct and click “OK”
- Then select “Import Variables” and click “Next”

- During the “Define Input Variables” stage, the user can toggle the upper/lower bounds of the input variables according to their preferences
- Additionally, they have the flexibility to set the distribution of these values around an average value
- Once the input variable definition is finished, select “Next”

- During the “Test Models” stage, the simulation setup will be executed for the first time

- While having the “buck.psimsc” file open in PSIM, click on “Run Definition”
- Wait for the .psimsch simulation to complete. The “Write”, “Execute” and “Extract” commands should run successfully and you can move on
Step 5
- During the “Define Output Responses” stage, the user can choose the specific output values they wish to investigate
- These values are known as “Output Responses” and are single-value
- Being single value means that built-in or custom functions should be applied to the simulation results (“Data Sources”) to get single outputs out of those results (e.g. min, max or rms value of inductor current)
- The Data Sources correspond to the output datasets obtained from the PSIM probes and flags (e.g., inductor current, output voltage)

- There are tons of built in functions in HyperStudy but the users can use their fully customized ones from Compose. Adding a Compose function is just a matter of two clicks
- For example, we can define a custom function for calculating the overshoot of the inductor current in Compose and use it here
- To do so, select the “Data Sources” tab and click on “Add Data Source”. Then name the Label and Varname correspondingly and select the three dots of the “File” tab

- A window emerges and you can select the “Read Simulation” option from the “tool” drop down menu
- Then select the File icon, to browse for the simulation results. The path matches the output file path set in Step4
- Loading the buck.txt is not enough. The IL needs to be set as Data Source

- Remove the “Time” option and press on “Click to Select”. Select “IL1” and the inductor current waveform will appear
- Click “OK”. The IL dataset in now imported ad a Data Source
- Then Navigate to the “Define Output Responses” tab and click on “Add Output Response”

- Rename the “Label” and “Varname” boxes accordingly
- Navigate to “Expression” and select the “Functions” tab. Then double click on a built-in or custom function and it should appear above

- Here the custom Compose “getOvershootRatio” function is used (results in percent)

- The function needs the steady state current value as first input and the current waveform as second input. For this example we know the first value but this can be a variable too in another case
- To add the waveform as the second input, navigate to the “Data Sources” tab and follow the instructions below

- Now that one output response has been set, click on “Evaluate” and make sure that real values appear
- Then click “Next” and select “Add”

Step 6
Now that the setup is defined, the DOE (design of experiments) can begin. DOE acts as a systematic and efficient approach for exploring the relationship between input variables and output responses. In this step, the initialized setup will batch run with different input configurations. The generated data points can be used for analysis and optimization of complex systems.
- Associate the DOE with the setup steps by selecting “Definition from:” Setup

- The DOE is initialized and you can click “Next”

- Repeat the steps of the setup by clicking “Next” and doing the necessary actions like “Import Variables” and “Run Definition”
- Everything should be predefined at this “Definition” stage


During the “Specifications” stage, you can apply numerous techniques to generate sets of input configurations for the simulation. These methods are crucial for efficiently exploring the design space and identifying the impact of various input parameters. Among the most popular options are the MELS and Sobol methods.
- Let’s choose the MELS method and set the number of runs to 20
- PSIM can run simulation in parallel so a bigger number could also work

During the “Evaluation” stage the user can deactivate any of the 20 simulations that are about to run, by navigating to the “Evaluation Tasks” tab. The input variables for each simulation are shown in the “Evaluation Data” tab while the “Evaluation Plot” tab displays the final input data form.
The user can also activate extra tasks for each simulation such as “Create Reports”.

- Navigate to the “Multi-Execution” drop down and select the number of parallel simulations you wish to run with PSIM. This will speed up the DOE process by a lot
- Then select “Evaluate Tasks” and click “Next”
- The solving process for all the experiments will begin and can last several minutes based on your circuit’s complexity
Once the solving process is complete, you can navigate to the “Post-Processing” window to explore various options:
- Visualize data to gain deeper insights into simulation results
- Perform sensitivity analysis to identify crucial input variables and enhance system performance
- Explore linear relations such as L and C values versus Overshoot Ratio

HyperStudy is a powerful tool offering extensive pre and post-processing options. It connects with various Altair solvers and once you grasp the essentials of defining your studies, it can significantly streamline your engineering tasks, regardless of your field or experience level.
You can find the zipped files of this example attached. Be sure to adjust the HyperStudy part to match your specific file paths. 