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
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | |
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
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | |
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
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | |