Skip to content

Commit 1fdbdf2

Browse files
authored
ExaPowerIO (#19)
Updated parser efficiency (introduce dependency on ExaPowerIO instead of PowerModels), sc parser update
1 parent 6af678a commit 1fdbdf2

File tree

12 files changed

+517
-568
lines changed

12 files changed

+517
-568
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@ docs/site/
2222
# committed for packages, but should be committed for applications that require a static
2323
# environment.
2424
Manifest.toml
25+
26+
data/*.jld2

Project.toml

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,37 @@ uuid = "2fff4b78-0b6c-428d-bac8-85ccea8c4bdf"
33
version = "0.1.0"
44

55
[deps]
6+
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
67
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
7-
PGLib = "07a8691f-3d11-4330-951b-3c50f98338be"
8-
PowerModels = "c36e90e8-916a-50a6-bd94-075b64ef4655"
8+
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
99
ExaModels = "1037b233-b668-4ce9-9b63-f9f681f55dd2"
10+
ExaPowerIO = "14903efe-9500-4d7f-a589-7ab7e15da6de"
11+
GOC3Benchmark = "3a45b339-860d-44d0-a64b-5f943cdd120b"
1012
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
1113
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
12-
GOC3Benchmark = "3a45b339-860d-44d0-a64b-5f943cdd120b"
13-
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
14+
15+
[sources]
16+
ExaPowerIO = {rev = "003970f", url = "https://github.com/MadNLP/ExaPowerIO.jl"}
17+
GOC3Benchmark = {rev = "588f356", url = "https://github.com/lanl-ansi/GOC3Benchmark.jl"}
1418

1519
[compat]
16-
ExaModels = "~0.9"
17-
PowerModels = "~0.21"
18-
JLD2 = "~0.5"
1920
CUDA = "5 - 5.8.2"
21+
ExaModels = "0.9.1"
22+
ExaPowerIO = "0.2.0"
23+
JLD2 = "~0.5"
2024
MadNLP = "~0.8"
2125
MadNLPGPU = "~0.7"
2226

2327
[extras]
2428
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
29+
Ipopt = "b6b21f68-93f8-5de0-b562-5493be1d77c9"
30+
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
2531
KernelAbstractions = "63c18a36-062a-441e-b654-da1e3ab1ce7c"
2632
MadNLP = "2621e9c9-9eb4-46b1-8089-e8c72242dfb6"
2733
MadNLPGPU = "d72a61cc-809d-412f-99be-fd81f4b8a598"
28-
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
29-
Ipopt = "b6b21f68-93f8-5de0-b562-5493be1d77c9"
30-
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
3134
NLPModelsJuMP = "792afdf1-32c1-5681-94e0-d7bf7a5df49e"
35+
PowerModels = "c36e90e8-916a-50a6-bd94-075b64ef4655"
36+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
3237

3338
[targets]
34-
test = ["Test", "MadNLP", "MadNLPGPU", "KernelAbstractions", "CUDA", "Ipopt", "JuMP", "NLPModelsJuMP"]
35-
36-
[sources]
37-
GOC3Benchmark = {url = "https://github.com/lanl-ansi/GOC3Benchmark.jl", rev = "588f356"}
39+
test = ["Test", "MadNLP", "MadNLPGPU", "KernelAbstractions", "CUDA", "Ipopt", "JuMP", "NLPModelsJuMP", "PowerModels"]

docs/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ ExaModelsPower = "2fff4b78-0b6c-428d-bac8-85ccea8c4bdf"
1010

1111
[compat]
1212
CUDA = "5 - 5.8.2"
13+
ExaModels = "0.9.1"
1314

1415
[sources]
1516
ExaModelsPower = {path = ".."}

src/ExaModelsPower.jl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ module ExaModelsPower
33
import JLD2
44
import Downloads
55
import ExaModels: ExaCore, variable, constraint, ExaModel, objective, constraint!, convert_array, solution
6-
import PGLib
7-
import PowerModels
86

97

108
include("parser.jl")
@@ -32,7 +30,6 @@ function __init__()
3230
global TMPDIR = joinpath(@__DIR__,"..","data")
3331
mkpath(TMPDIR)
3432
end
35-
PowerModels.silence()
3633
end
3734

3835
end # module ExaModelsExamples

src/constraint.jl

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
# cost1
12
function gen_cost(g, pg)
2-
return g.cost1 * pg^2 + g.cost2 * pg + g.cost3
3+
return g.c[1] * pg^2 + g.c[2] * pg + g.c[3]
34
end
45

56
function c_ref_angle_polar(va)
@@ -46,7 +47,7 @@ end
4647

4748
#no coordinates specified
4849
function c_thermal_limit(b, p,q)
49-
return p^2 + q^2 - b.rate_a_sq
50+
return p^2 + q^2 - b.rate_a^2
5051
end
5152

5253
#only for mp
@@ -125,15 +126,15 @@ function c_ohms_rect(pst, qst, vr, vim, I2)
125126
end
126127

127128
function c_stor_state(s, E0, E1, pstc, pstd)
128-
return E0 - E1 - (s.etac*pstc - pstd/s.etad)
129+
return E0 - E1 - (s.charge_efficiency*pstc - pstd/s.discharge_efficiency)
129130
end
130131

131132
function c_storage_state_smooth(s, E0, E1, discharge_func::Function, pstd)
132-
return E0 - E1 + discharge_func(pstd, s.Srating)
133+
return E0 - E1 + discharge_func(pstd, s.thermal_rating)
133134
end
134135

135136
function c_transfer_lim(s, pst, qst)
136-
return pst^2 + qst^2 - s.Srating^2
137+
return pst^2 + qst^2 - s.thermal_rating^2
137138
end
138139

139140
#used for charge and discharge limits
@@ -147,4 +148,4 @@ end
147148

148149
function c_comp(pstd, pstc)
149150
return pstd*pstc
150-
end
151+
end

0 commit comments

Comments
 (0)