Modal analysis¶
Numerical linearisation and eigenvalue analysis.
Numerical linearisation and eigenvalue (modal) analysis of a PowerSystemModel.
PowerSystemModelLinearization
¶
Linearised model around an operating point, with eigenvalues and eigenvectors.
The state-space model is
.. math:: \dot{\Delta x} = A \Delta x + B \Delta u, \quad \Delta y = C \Delta x + D \Delta u
where the inputs u and outputs y are inputs and outputs of the dynamic models (see :meth:linearize).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ps
|
Initialised PowerSystemModel ( |
required | |
eps
|
Relative step of the central differences. The step for a variable with value z is
|
1e-06
|
Source code in src/tops/modal_analysis.py
linearize
¶
Linearise the model around the operating point x0.
Inputs and outputs are given as functions, either alone (all units) or as (function, units), where units
are given by name or by integer index, as a single value or a list. For example::
lin.linearize(
inputs=[(ps.avr.SEXS.v_setp, 'AVR1'), ps.gov.TGOV1.bias],
outputs=[(ps.gen.GEN.speed, ['G1', 'G3']), lambda x, v: abs(v[3])],
)
- An input is an input of a model (in its
input_list()), also of a block, e.g.ps.avr.SEXS.tg_red.input. Take it afterps.init_dyn_sim(), which replaces connected inputs. - An output is any function
f(x, v), e.g.ps.gen.GEN.speedor a lambda. Units can be selected by name only for functions of a model; otherwise, use the indices of the elements that the function returns.
Each selected unit gives one input (column of B and D) or one output (row of C and D). An input is perturbed
by adding a small value to the value it would otherwise have, so connected inputs (e.g. P_m of a
generator with a governor) can be used, and the input of a unit can be thought of as an added signal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inputs
|
List of inputs. |
()
|
|
outputs
|
List of outputs. |
()
|
|
x0
|
Operating point (default: |
None
|
|
t0
|
Time at which the model is evaluated. |
0
|
|
get_eigs
|
Also compute the eigenvalues (see :meth: |
False
|
Returns:
| Type | Description |
|---|---|
|
The matrices |
Source code in src/tops/modal_analysis.py
eigenvalue_decomposition
¶
Compute eigenvalues, right and left eigenvectors, frequencies and damping ratios of A.
The model is linearised first (without inputs and outputs) if :meth:linearize has not been called.
Returns:
| Type | Description |
|---|---|
|
The eigenvalues. |
Source code in src/tops/modal_analysis.py
residues
¶
Residues of the transfer functions from the inputs to the outputs, for one mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode_idx
|
Index of the mode. |
required |
Returns:
| Type | Description |
|---|---|
|
Array with one row per output and one column per input. |
Source code in src/tops/modal_analysis.py
participation_factors
¶
Participation factors, p[k, i] being the participation of state k in mode i.
Returns:
| Type | Description |
|---|---|
|
Complex array with one row per state and one column per mode. Use |
Source code in src/tops/modal_analysis.py
get_mode_idx
¶
Indices of the modes that meet the given criteria.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode_type
|
One or more of |
('em', 'non_conj')
|
|
damp_threshold
|
Only modes with damping ratio below this value are kept. |
1
|
|
freq_range
|
Frequency range [Hz] of the |
(0.1, 3)
|
|
sorted
|
Sort from least to most damped. |
True
|
Returns:
| Type | Description |
|---|---|
|
Array of mode indices. |
Source code in src/tops/modal_analysis.py
get_dominant_mode
¶
Index of the least damped electromechanical mode, or None if there is none.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
freq_range
|
Frequency range [Hz] of electromechanical modes. |
(0.1, 3)
|