topotherm.sets
Create sets for the optimization. The sets are used to define the variables and constraints.
Functions
|
Create sets for the optimization. The sets are used to define variables |
Module Contents
- topotherm.sets.create(matrices)[source]
Create sets for the optimization. The sets are used to define variables and constraints. Depending on the matrices, the sets are computed with the defined directions (
i -> jas reference).- Parameters:
matrices (dict) – Matrices of the district heating network with keys: -
a_i: Incidence matrix (rows: nodes, columns: edges). -a_p: Adjacency matrix for producers (rows: nodes, columns: supply IDs). -a_c: Adjacency matrix for consumers (rows: nodes, columns: consumer IDs).- Returns:
Sets for the optimization containing: -
connection_c_ij: Indices of consumers connected to the network in directioni -> j. -lambda_c_ij: Binary vector (1 where consumers are connected in directioni -> j). -connection_c_ji: Indices of consumers connected to the network in directionj -> i. -lambda_c_ji: Binary vector (1 where consumers are connected in directionj -> i). -a_i_out: Dict mapping node index → array of outgoing pipe indices (i -> jis+1). -a_i_in: Dict mapping node index → array of incoming pipe indices (i -> jincoming is-1). -a_p_in: Dict mapping producer index → array of incoming pipe indices (-1). -a_c_out: Dict mapping consumer index → array of outgoing pipe indices (+1). -a_c_out_edge: Dict mapping consumer index → array of adjacent edge indices.- Return type: