Solvers¶
This module provides functions for running power flow calculations.
run_opf¶
Run Optimal Power Flow (OPF) calculation using Julia interface.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
net
|
Network
|
A Network object containing the power system model. |
required |
jl
|
Any
|
Julia interface object for running OPF. |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
OPF result containing termination status and solution data. |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If OPF fails to converge or encounters an error. |
Source code in gridfm_datakit/process/solvers.py
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 | |
run_pf¶
Run Power Flow (PF) calculation using Julia interface.
This function runs the power flow calculation using the Julia interface and returns the result with termination status.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
net
|
Network
|
A network object containing the power system model. |
required |
jl
|
Any
|
Julia interface object for running power flow. |
required |
fast
|
Union[bool, None]
|
If True, use the direct (non-optimizer) computation. If None, defaults to False (uses optimizer-based solver). |
None
|
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
Power flow result containing termination status and solution data. |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If power flow fails to converge or encounters an error. |
Source code in gridfm_datakit/process/solvers.py
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 | |
run_dcpf¶
Run DC Power Flow (DCPF) calculation using Julia interface.
This function runs the DC power flow calculation using the Julia interface and returns the result with termination status.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
net
|
Network
|
A network object containing the power system model. |
required |
jl
|
Any
|
Julia interface object for running DC power flow. |
required |
fast
|
Union[bool, None]
|
If True, use the direct (non-optimizer) computation. If None, defaults to False (uses optimizer-based solver). |
None
|
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
DC power flow result containing termination status and solution data. |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If DC power flow fails to converge or encounters an error. |
Source code in gridfm_datakit/process/solvers.py
215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 | |