MTB (Model Test Bench)
MTB (Model Test Bench) automates grid compliance simulation studies in both DIgSILENT PowerFactory and PSCAD, with external plotting and comparison of RMS and EMT results.
MTB is intended to help facility owners and model providers evaluate simulation model behaviour in the context of Danish grid-code requirements and Energinet simulation model requirements. It includes predefined case sets for RfG, DCC, unit testing, co-located generation/demand cases, and custom user-defined studies.
MTB Workflow
- Configure the testcase workbook to test various requirements in e.g. EU 2016/631 with specific relevance to the Danish NC RfG
- Set up the MTB in PowerFactory and execute the selected simulation cases
- Set up the MTB in PSCAD and execute the selected simulation cases
- Plot and compare RMS and EMT results making use of among other things, analytically calculated guide curves, cursor metrics, and visual inspection
Using MTB in Danish grid connection processes is entirely voluntary, though recommended. The predefined test cases are designed to catch non-compliant behaviour in broad terms; they are not an exhaustive or fixed list. Existing cases can be edited, and new cases added, whenever relevant to properly assess compliance for a specific plant. Using MTB, including its predefined case sets, is not a guarantee of model compliance. The plant owner remains responsible for ensuring that models comply with the requirements applicable at any time, regardless of which test cases were run.
Regardless of which test cases are run or passed, the connected plant must under no circumstances cause grid instability or reduce the security of the grid. Passing the predefined (or any) MTB test cases does not by itself constitute approval. A model will not be approved unless there is full confidence, established through whatever additional analysis and testing is necessary, that this requirement is met.
Python/Plotly Output Example
The MTB plotter generates interactive, self-contained HTML reports built with Plotly, letting users pan, zoom, and toggle signals directly in the browser without any additional software. One HTML output file is generated per testcase (or Rank), with multiple plots covering line voltages, line currents, active and reactive current components, active power, reactive power, frequency, and more.
The generated HTML reports include:
- Previous Rank - navigates to the previous rank in the study, with wraparound.
- Next Rank - navigates to the next rank in the study, with wraparound.
- More Ranks - drop-down list for faster navigation between ranks.
- Rank Number and Title - shows the rank number and case title from
testcases.xlsx.
- Subsection Hyperlinks - links to Figures, Cursors, and Source Data.
- Figures subsection - contains the result plot figures.
- Plot Figure Hyperlinks - links to each plot figure on the page.
- Plot Figure Title - taken from
figureSetup.csv.
- Plot Figure Units - taken from
figureSetup.csv.
- Plot Figure Legend - lists the plotted signals. Click a legend item to hide or show the corresponding trace.
- Plotly Buttons - standard Plotly controls for downloading, zooming, panning, autoscaling, and resetting axes.
MTB Quickstart Wiki Guides
The above Quickstart Wiki can also be downloaded as a single PDF file: MTB 2.0 Quickstart Guide
Example PowerFactory and PSCAD setups are available in setup_examples. These examples demonstrate the MTB setup workflow only; they are not representative of compliant plant models.
Requirements
Install the main MTB dependencies from the repository root:
python -m pip install -r requirements.txt
The plotter has a separate dependency file:
cd plotter
python -m pip install -r requirements.txt
Tested Environments
- PowerFactory: PowerFactory 2025 SP4 with Python >= 3.11.
- PSCAD: PSCAD 5.0.2.0 with embedded Python 3.7.2 or Python 3.13 as an external client. Compatibility is only guaranteed with Intel Fortran compilers.
Releases
See CHANGELOG.md for release notes.
Contributing
Please use the Issues tab to report bugs, request features, or suggest improvements.
For inquiries, please contact the Energinet simulation model team: [email protected]
评论