figshare
Browse

Power system small-signal modelling tool in MATLAB

Download (75.17 kB)
Version 2 2025-06-27, 15:03
Version 1 2025-06-11, 10:22
software
posted on 2025-06-27, 15:03 authored by Luke Ian BenedettiLuke Ian Benedetti, Agusti Egea, Panagiotis PapadopoulosPanagiotis Papadopoulos

This repository contains the MATLAB scripts for creating a power system small-signal model.


A modular and automatic compilation approach is adopted requiring only parameter data (in the format observed in the examples folder) and a MATPOWER case file to create an interconnected power system small-signal model.


The scripts enable quick creation of power system small-signal models with synchronous generation (8th order + controls), grid-following and grid-forming converters (with several control implementations and cascaded structures), constant impedance loads, and transmission lines and transformers. The open-source nature of the scripts also permits customisation. The network elements can be implemented either algebraically or dynamically as specified (this includes the stator transients of the synchronous generation and coupling filters of the converters).


Please note that MATPOWER is required to use these scripts. For more information, please refer to MATPOWER documentation: https://matpower.org/

To use, please install MATPOWER and update the st_MATPOWER.m file in the Examples folder with the appropriate file paths.


PLEASE DO NOT ASSUME THAT THESE SCRIPTS WILL CONTAIN NO ERRORS. USE WITH CARE. Furthermore, if any mistakes are found, please report them to the corresponding author: luke.benedetti@manchester.ac.uk

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

This repository/tool was developed during the PhD programme for which the following thesis was written (at the time of writing this thesis is not yet published):


Title - Small-Signal Dynamics in Converter-Permeated Power Systems: Multi-Machine Interactions, Probabilistic Analysis, and Variability Quantification


Author - Mr Luke Ian Benedetti (now affiliated with University of Manchester)


First supervisor - Dr Panagiotis N. Papadopoulos (now affiliated with University of Manchester)


Second supervisor - Dr Agustí Egea-Àlvarez


Institution - University of Strathclyde, Glasgow, Scotland


Details specific to this modelling tool are found in Chapter 2.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


Files:


- initn.m = processes MATPOWER power flow results and calculates initial values of internal states of power system elements (where necessary)


- compile.m = creates small-signal model objects for each module in the system before connecting the modules into a full power system small-signal model


- FDF_imp.m = implements the frequency divider formula [1]. This includes consideration of the synchronous generator internal impedance and the grid-forming converter coupling filter. For the frequency at a bus with grid-following converter, the PLL measurement is used (of course, this is an estimation of the frequency at this bus and this should be considered when analysing results). This function is enacted in the generate_bus_connections.m function which is found in the SSM_library folder


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


Folders:


- SSM_library = repository of functions to create small-signal model objects of different power system elements (see README file in the folder for more information)


- Examples = 4 different examples for creating power system small-signal models. See README file in the folder for more information.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


Note, importing of parameters is hardcoded to the required format (as found in example files of the repository).


The synchronous generator is the linear magnetic model from [2].


The grid-following and grid-forming converter control approaches are further discussed in the thesis mentioned earlier.


Loads are set to be constant impedance


The specific (small-signal) model implementations can be found in the small-signal model library (SSM_library folder).


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


The open-source nature of these scripts enable customisation as desired. If changes/additions are to be incorporated into the automatic and modular approach, the following procedure can be followed:


- Make new small-signal model module creation function


- Ensure naming convention (in particular for inputs and outputs) is consistent with existing modules for smooth incorporation


- Note, if the element is being modelled in its own reference frame, care should be taken with the reference frame conversion at the module connection. In particular, the general system/grid reference frame speed is labelled as "wgrid" as seen in the compile.m function. Furthermore, models are in DQ0 reference frame. Converter controllers and system reference frame is d-axis aligned with a-axis with q-axis lagging by 90 degrees. Synchronous generator is q-axis aligned with a-axis with d-axis lagging by 90 degrees.


- Make new small-signal model initialisation function (if required)


- Add initialisation function to initn.m


- ensure parameters and power flow results are imported appropriately


- Add module creation function to compile.m


- ensure parameters and initial states are imported appropriately


- Update generate_bus_connections.m function (in SSM_library folder)


- this requires the inputs and outputs of the new module type to be in the same format as the rest of the system


- see examples for other component connections in generate_bus_connections.m to understand how to automate the connection as required.


- If required, add or remove final system inputs and outpus in the compile.m function as desired


Note, this list may not be exhaustive.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

[1] F. Milano and Álvaro Ortega, “Frequency divider,” IEEE Transactions on Power Systems, vol. 32, pp. 1493–1501, 2017.

[2] P. W. Pai and M. A. Sauer, Power System Dynamics and Stability. The University of Illinois, 1997. [Online]. Available: https://courses.engr.illinois.edu/ece576/sp2018/SauerandPaibook-Jan2007.pdf


Funding

Impact of Grid Forming Converters on Power System Stability

Engineering and Physical Sciences Research Council

Find out more...

Addressing the complexity of future power system dynamic behaviour

UK Research and Innovation

Find out more...

Addressing the complexity of future power system dynamic behaviour

UK Research and Innovation

Find out more...

History