Prepare the Excel file with the network information
- A template Excel network file is available in the ePHASORSIM Blockset page in the MATLAB help.
- Alternately, the link below Complete network field in the Network data tab of the ePHASORSIM Solver also opens this template.
To customize an Excel file, refer to Pins in this user guide.
Prepare the Simulink model
- Change the MATLAB working directory to an empty folder in an intuitive location, like C:\OPAL-RT\ePHASORSIM or in your active default project folder.
- You will use this folder and path throughout this procedure; this is why we recommend an intuitive and/or default location.
- Open the Simulink Library.
- Select RT-LAB/ePHASORSIM.
- Drag the Solver block into a new model window.
- Save this model in the aforementioned folder.
- Open the mask and do the following:
Network data tab
- Provide a unique Name to the Solver if there are more than one,
- Select 'Excel' as the Input file format.
- Uncheck Use UDB since this feature is not yet available for Excel data input.
- Insert the name of your Excel file in the Complete network field or use Select to pick the file.
Note: The Excel file must also be in the working directory.
- Check Refresh netlist only when the simulation starts
- To use FMUs, enter the corresponding folder name in the FMU component field or use Path button to select the folder that contains the required FMUs.
- The default is the empty string '', or two single quotes.
Simulation settings tab
- Specify a Time-step (The default value is 10 ms).
- For Power-flow:
- select the Initialization method from the drop-down menu,
- enter the Power mismatch (max p.u.) tolerance for the power-flow calculation (The default value is 1e-8).
- enter the Max number of NR iterations (The default value is 100).
- clicking Execute or Execute and export report runs the power-flow. Only the latter writes the power-flow results in CSV format.
- For Dynamic simulations:
- check Start from Power-flow to run power flow before dynamic simulation.
- enter the Number of partitions to be used for the network solution (The default value is 1).
- clicking Export admittance matrix writes the admittance matrix in CSV format.
- check Optimize number of threads (Windows only).
- Press OK. The ePHASORSIM Solver block is redrawn using the pins from the given Excel file.
- The network data may also be converted to OPAL format, depending on the configuration of the Refresh netlist option in the Network data tab.
- Connect Simulink sources and sinks (scopes, displays) to the input/output pins on the ePHASORSIM Solver block.
- Ensure the simulation is set to use a fixed time-step (under Simulation/Model Configuration parameters/Solver), and that the time-step is consistent with that specified in the Simulation settings tab.
- Once the Solver mask and Simulink model are configured, run the model to verify a reasonable value appears on the scopes.
- An example of the output to the MATLAB Command Window during dynamic simulation, and dynamic simulation with power-flow, are shown below.
- Save your model.