PowerSystemModel¶
The central class: holds the model, solves the power flow, initialises the dynamic models and provides the equations to the solvers.
PowerSystemModel
¶
Source code in src/tops/dynamic.py
sys_data
instance-attribute
¶
sys_data = {
"s_n": self.s_n,
"f_n": self.f_n,
"n_bus": self.n_bus,
"bus_v_n": self.buses["V_n"],
"bus_names": self.buses["name"],
"red_to_full": None,
}
add_model_data
¶
Source code in src/tops/dynamic.py
setup
¶
Source code in src/tops/dynamic.py
build_y_bus_lf
¶
Source code in src/tops/dynamic.py
build_y_bus_dyn
¶
Source code in src/tops/dynamic.py
power_flow
¶
Source code in src/tops/dynamic.py
kron_reduction
¶
Source code in src/tops/dynamic.py
define_state_vector
¶
Source code in src/tops/dynamic.py
init_dyn_sim
¶
Source code in src/tops/dynamic.py
get_events
¶
Return the events object (see tops.events) of a model, or of the buses if category is 'buses'.
Source code in src/tops/dynamic.py
resolve_event
¶
Return the events object, unit and action of an event.
The event is given either as (event function, unit), e.g. (ps.lines.Line.events.disconnect, 'L1-2') or (ps.bus_events.short_circuit, 'B1'), or as (category, model, unit, action), e.g. ('lines', 'Line', 'L1-2', 'disconnect').
Source code in src/tops/dynamic.py
check_event
¶
Check that an event (see resolve_event) exists, without applying it.
apply_event
¶
Apply an event immediately, given as (event function, unit) or (category, model, unit, action), followed by the keyword arguments of the action. For example:
ps.apply_event(ps.lines.Line.events.disconnect, 'L1-2')
ps.apply_event('lines', 'Line', 'L1-2', 'disconnect')
ps.apply_event(ps.loads.Load.events.set_power, 'L1', P=900.0)
Source code in src/tops/dynamic.py
apply_effect
¶
Source code in src/tops/dynamic.py
state_derivatives
¶
dead_buses
¶
Names of the buses that have lost all their admittance since the initialisation, e.g. a bay node whose switches are all open. The variable admittances are taken at the states x (default: the initial states).
Source code in src/tops/dynamic.py
solve_algebraic
¶
Solves algebraic equations given states
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
t
|
|
required | |
x
|
|
required |
Returns:
| Type | Description |
|---|---|
|
|
Source code in src/tops/dynamic.py
ode_fun
¶
Can be integrated with any ODE-integration method (e.g. Euler, Runge-Kutta etc.)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
t
|
|
required | |
x
|
|
required |
Returns:
| Type | Description |
|---|---|
|
|