Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ docs/site/
# committed for packages, but should be committed for applications that require a static
# environment.
Manifest.toml

data/*.jld2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should only be in your local .gitignore

30 changes: 16 additions & 14 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,37 @@ uuid = "2fff4b78-0b6c-428d-bac8-85ccea8c4bdf"
version = "0.1.0"

[deps]
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
PGLib = "07a8691f-3d11-4330-951b-3c50f98338be"
PowerModels = "c36e90e8-916a-50a6-bd94-075b64ef4655"
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
ExaModels = "1037b233-b668-4ce9-9b63-f9f681f55dd2"
ExaPowerIO = "14903efe-9500-4d7f-a589-7ab7e15da6de"
GOC3Benchmark = "3a45b339-860d-44d0-a64b-5f943cdd120b"
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
GOC3Benchmark = "3a45b339-860d-44d0-a64b-5f943cdd120b"
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"

[sources]
ExaPowerIO = {rev = "003970f", url = "https://github.com/MadNLP/ExaPowerIO.jl"}
GOC3Benchmark = {rev = "588f356", url = "https://github.com/lanl-ansi/GOC3Benchmark.jl"}

[compat]
ExaModels = "~0.9"
PowerModels = "~0.21"
JLD2 = "~0.5"
CUDA = "5 - 5.8.2"
ExaModels = "0.9.1"
ExaPowerIO = "0.2.0"
JLD2 = "~0.5"
MadNLP = "~0.8"
MadNLPGPU = "~0.7"

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

[targets]
test = ["Test", "MadNLP", "MadNLPGPU", "KernelAbstractions", "CUDA", "Ipopt", "JuMP", "NLPModelsJuMP"]

[sources]
GOC3Benchmark = {url = "https://github.com/lanl-ansi/GOC3Benchmark.jl", rev = "588f356"}
test = ["Test", "MadNLP", "MadNLPGPU", "KernelAbstractions", "CUDA", "Ipopt", "JuMP", "NLPModelsJuMP", "PowerModels"]
1 change: 1 addition & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ ExaModelsPower = "2fff4b78-0b6c-428d-bac8-85ccea8c4bdf"

[compat]
CUDA = "5 - 5.8.2"
ExaModels = "0.9.1"

[sources]
ExaModelsPower = {path = ".."}
3 changes: 0 additions & 3 deletions src/ExaModelsPower.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ module ExaModelsPower
import JLD2
import Downloads
import ExaModels: ExaCore, variable, constraint, ExaModel, objective, constraint!, convert_array, solution
import PGLib
import PowerModels


include("parser.jl")
Expand Down Expand Up @@ -32,7 +30,6 @@ function __init__()
global TMPDIR = joinpath(@__DIR__,"..","data")
mkpath(TMPDIR)
end
PowerModels.silence()
end

end # module ExaModelsExamples
13 changes: 7 additions & 6 deletions src/constraint.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# cost1
function gen_cost(g, pg)
return g.cost1 * pg^2 + g.cost2 * pg + g.cost3
return g.c[1] * pg^2 + g.c[2] * pg + g.c[3]
end

function c_ref_angle_polar(va)
Expand Down Expand Up @@ -46,7 +47,7 @@ end

#no coordinates specified
function c_thermal_limit(b, p,q)
return p^2 + q^2 - b.rate_a_sq
return p^2 + q^2 - b.rate_a^2
end

#only for mp
Expand Down Expand Up @@ -125,15 +126,15 @@ function c_ohms_rect(pst, qst, vr, vim, I2)
end

function c_stor_state(s, E0, E1, pstc, pstd)
return E0 - E1 - (s.etac*pstc - pstd/s.etad)
return E0 - E1 - (s.charge_efficiency*pstc - pstd/s.discharge_efficiency)
end

function c_storage_state_smooth(s, E0, E1, discharge_func::Function, pstd)
return E0 - E1 + discharge_func(pstd, s.Srating)
return E0 - E1 + discharge_func(pstd, s.thermal_rating)
end

function c_transfer_lim(s, pst, qst)
return pst^2 + qst^2 - s.Srating^2
return pst^2 + qst^2 - s.thermal_rating^2
end

#used for charge and discharge limits
Expand All @@ -147,4 +148,4 @@ end

function c_comp(pstd, pstc)
return pstd*pstc
end
end
Loading
Loading