Skip to content

Commit 1b3b7f7

Browse files
syntax update for acopf
1 parent ec6cc4d commit 1b3b7f7

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ExaModelsPower.jl is an optimal power flow models using ExaModels.jl
1313
using ExaModelsPower, MadNLP, MadNLPGPU, CUDA, ExaModels, GOC3Benchmark, JSON
1414

1515

16-
model, vars, cons = opf_model(
16+
model, vars, cons = ac_opf_model(
1717
"pglib_opf_case118_ieee.m";
1818
backend = CUDABackend(),
1919
form = :polar

docs/src/opf_demo.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ using MadNLP, MadNLPGPU #, NLPModelsIpopt
1212
using ExaModels
1313

1414
# We will begin by constructing and solving a static OPF using the function opf_model. For the static OPF, the only input required is the filename for the OPF matpower file. The file does not need to be locally installed, and it will be automatically downloaded from __[power-grid-library](https://github.com/power-grid-lib/pglib-opf)__ if the file is not found in the user's data folder. If keywords are not specified, the numerical type will default to Float64, the backend will default to nothing (used on CPU) and the form will default to polar coordinates.
15-
model, vars, cons = opf_model(
15+
model, vars, cons = ac_opf_model(
1616
"pglib_opf_case118_ieee.m";
1717
backend = CUDABackend(),
1818
form = :polar,
@@ -30,7 +30,7 @@ solution(result, vars.vm)[1:10]
3030
result.objective
3131

3232
# ExaModelsPower supports solving the OPF in either polar or rectangular coordinates.
33-
model, vars, cons = opf_model(
33+
model, vars, cons = ac_opf_model(
3434
"pglib_opf_case118_ieee.m";
3535
form = :rect
3636
)

docs/src/opf_demo.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ using ExaModels
2727
We will begin by constructing and solving a static OPF using the function opf_model. For the static OPF, the only input required is the filename for the OPF matpower file. The file does not need to be locally installed, and it will be automatically downloaded from __[power-grid-library](https://github.com/power-grid-lib/pglib-opf)__ if the file is not found in the user's data folder. If keywords are not specified, the numerical type will default to Float64, the backend will default to nothing (used on CPU) and the form will default to polar coordinates.
2828

2929
````julia
30-
model, vars, cons = opf_model(
30+
model, vars, cons = ac_opf_model(
3131
"pglib_opf_case118_ieee.m";
3232
backend = CUDABackend(),
3333
form = :polar,
@@ -97,7 +97,7 @@ result.objective
9797
ExaModelsPower supports solving the OPF in either polar or rectangular coordinates.
9898

9999
````julia
100-
model, vars, cons = opf_model(
100+
model, vars, cons = ac_opf_model(
101101
"pglib_opf_case118_ieee.m";
102102
form = :rect
103103
)

src/opf.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ function build_rect_opf(data, user_callback; backend = nothing, T=Float64, kwarg
195195
end
196196

197197
"""
198-
opf_model(filename; backend, T, form)
198+
ac_opf_model(filename; backend, T, form)
199199
200200
Return `ExaModel`, variables, and constraints for a static AC Optimal Power Flow (ACOPF) problem from the given file.
201201
@@ -213,7 +213,7 @@ A vector `(model, variables, constraints)`:
213213
- `variables`: NamedTuple of model variables.
214214
- `constraints`: NamedTuple of model constraints.
215215
"""
216-
function opf_model(
216+
function ac_opf_model(
217217
filename;
218218
backend = nothing,
219219
T = Float64,

test/runtests.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,11 @@ function runtests()
105105
for (filename, case, test_function) in test_cases
106106
data_pm = parse_pm(filename)
107107
for (form_str, form, power_model, test_voltage) in static_forms
108-
m32, v32, c32 = opf_model(filename; T=Float32, backend = backend, form=form)
108+
m32, v32, c32 = ac_opf_model(filename; T=Float32, backend = backend, form=form)
109109
result32 = madnlp(m32; print_level = MadNLP.ERROR)
110110
va32, vm32, pg32, qg32, p32, q32 = v32
111111

112-
m64, v64, c64 = opf_model(filename; T=Float64, backend = backend, form=form)
112+
m64, v64, c64 = ac_opf_model(filename; T=Float64, backend = backend, form=form)
113113
result64 = madnlp(m64; print_level = MadNLP.ERROR)
114114
va64, vm64, pg64, qg64, p64, q64 = v64
115115

0 commit comments

Comments
 (0)