Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 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

15 changes: 9 additions & 6 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ version = "0.1.0"

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

[compat]
ExaModels = "~0.9"
PowerModels = "~0.21"
JLD2 = "~0.5"
CUDA = "5 - 5.8.2"
CUDA = "~5"
Copy link
Member

Choose a reason for hiding this comment

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

we shouldn't defer supporting 5.8.3 due to JuliaGPU/CUDA.jl#2844

ExaPowerIO = "~0.2"
MadNLP = "~0.8"
MadNLPGPU = "~0.7"
PowerModels = "~0.21"

[extras]
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
Expand All @@ -29,9 +29,12 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Ipopt = "b6b21f68-93f8-5de0-b562-5493be1d77c9"
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
NLPModelsJuMP = "792afdf1-32c1-5681-94e0-d7bf7a5df49e"
PGLib = "07a8691f-3d11-4330-951b-3c50f98338be"
PowerModels = "c36e90e8-916a-50a6-bd94-075b64ef4655"

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

[sources]
GOC3Benchmark = {url = "https://github.com/lanl-ansi/GOC3Benchmark.jl", rev = "588f356"}
GOC3Benchmark = {url = "https://github.com/lanl-ansi/GOC3Benchmark.jl", rev = "588f356"}
ExaModels = {url = "https://github.com/hfytr/ExaModels.jl", rev = "d8f3a00"}
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
19 changes: 10 additions & 9 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 @@ -105,15 +106,15 @@ end

#Formulation from Geth, Coffrin, Fobes (2020)
function c_active_stor_power(s, pst, pstd, pstc, I2)
return pst + pstd - pstc - s.Pexts - s.Zr*I2
return pst + pstd - pstc - s.ps - s.r*I2
end

function c_active_storage_power_smooth(s, pst, pstd, I2)
return pst + pstd - s.Pexts - s.Zr*I2
return pst + pstd - s.ps - s.r*I2
end

function c_reactive_stor_power(s, qst, qint, I2)
return qst - qint - s.Qexts - s.Zim*I2
return qst - qint - s.qs - s.x*I2
end

function c_ohms_polar(pst, qst, vm, I2)
Expand All @@ -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