@@ -9,7 +9,8 @@ ExaModelsPower.jl is an optimal power flow models using ExaModels.jl
99## Usage
1010### Static optimal power flow
1111``` julia
12- using ExaModelsPower, MadNLP, MadNLPGPU, CUDA
12+ using ExaModelsPower, MadNLP, MadNLPGPU, CUDA, ExaModels, GOC3Benchmark, JSON
13+
1314
1415model, vars, cons = opf_model (
1516 " pglib_opf_case118_ieee.m" ;
@@ -21,11 +22,32 @@ result = madnlp(model; tol=1e-6)
2122
2223### Security-constrained optimal power flow
2324``` julia
24- model, vars, cons = scopf_model (
25- " pglib_opf_case118_ieee.m" ; contingencies = [1 ,2 ],
25+ # This model is based on the GOC3 formulation of the SCOPF problem
26+ # https://www.pnnl.gov/publications/grid-optimization-competition-challenge-3-problem-formulation
27+
28+ # The current implementation requires a UC solution to be provided, which is then parsed with
29+ # the other input data to generate a structure of named tuples which can then interface with
30+ # ExaModels to generate the full model. We do not make any relaxations or decompositions for this problem
31+
32+ model, sc_data, vars, lengths = scopf_model (
33+ " data/C3E4N00073D1_scenario_303.json" , " data/C3E4N00073D1_scenario_303_solution.json" ;
2634 backend = CUDABackend ()
2735)
28- result = madnlp (model; tol= 1e-6 ) # currently failing
36+ result = madnlp (model; tol= 1e-4 )
37+
38+ # Solution from GPU can be used to warm start a CPU solution or vice versa
39+ model_cpu, sc_data, vars, lengths = scopf_model (
40+ " data/C3E4N00073D1_scenario_303.json" , " data/C3E4N00073D1_scenario_303_solution.json" ;
41+ result_set = [result, vars]
42+ )
43+ result_cpu = ipopt (model_cpu; tol= 1e-8 )
44+
45+ # Additionally, the SC problem can be evaluated without contingencies
46+ model, sc_data, vars, lengths = scopf_model (
47+ " data/C3E4N00073D1_scenario_303.json" , " data/C3E4N00073D1_scenario_303_solution.json" ;
48+ backend = CUDABackend (), include_ctg = false
49+ )
50+ result = madnlp (model; tol= 1e-4 )
2951```
3052
3153### Multi-period optimal power flow
@@ -59,7 +81,7 @@ result = madnlp(model; tol=1e-6)
5981
6082# Alternatively, provide a smooth function for the charge/discharge efficiency to remove complementarity constraint
6183function example_func (d, srating)
62- return d + . 2 / srating * d ^ 2
84+ return - ((s_rating / 2 ) ^ d) + 1
6385end
6486
6587model, vars, cons = mpopf_model (
0 commit comments