Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Errors in "Extending PowerModelsDistribution.jl " tutorial #456

Open
John-Boik opened this issue Feb 10, 2024 · 1 comment
Open

[BUG] Errors in "Extending PowerModelsDistribution.jl " tutorial #456

John-Boik opened this issue Feb 10, 2024 · 1 comment
Labels

Comments

@John-Boik
Copy link
Contributor

The tutorial Extending PowerModelsDistribution.jl throws an error towards the end, in this block:

for k in K, l in 1:length(data_eng["load"])
		bus_id = data_eng["load"]["load$l"]["bus"]
		bus_ind = data_math_mn["bus_lookup"][bus_id]   # <--- error here
		sol_bus = sol_eng["nw"]["$k"]["bus"][bus_id]
		data_bus = data_eng["bus"][bus_id]
		vbase = data_math_mn["nw"]["$k"]["bus"]["$bus_ind"]["vbase"]
		phase = data_eng["load"]["load$l"]["connections"][1]
		ind = findfirst(data_bus["terminals"].==phase)
		vm_pu_lk[l,k] = abs(sol_bus["vr"][ind]+im*sol_bus["vi"][ind])/vbase
	end

The error is:
KeyError: key "34" not found The error line is indicated above. As an aside, the next two lines do not throw an error:

sol_bus = sol_eng["nw"]["$k"]["bus"][bus_id]
data_bus = data_eng["bus"][bus_id]

The data_math_mn["bus_lookup"] has 10 elements that look like so:

  "8"  => Dict("101"=>1, "475"=>2, "619"=>3, "505"=>4, "332"=>5, "817"=>6, "453"=>7, "289"=>8, "596"=>9, "387"=>10…)
  "4"  => Dict("101"=>1, "475"=>2, "619"=>3, "505"=>4, "332"=>5, "817"=>6, "453"=>7, "289"=>8, "596"=>9, "387"=>10…)

Key "34" is not one of them. The data_eng["load"] has 55 elements that look like so:

  "load34" => Dict{String, Any}("model"=>POWER, "connections"=>[1, 4], "pd_nom"=>[0.701], "bus"=>"629", "configuration"…
  "load33" => Dict{String, Any}("model"=>POWER, "connections"=>[3, 4], "pd_nom"=>[9.584], "bus"=>"619", "configuration"…
  "load2"  => Dict{String, Any}("model"=>POWER, "connections"=>[2, 4], "pd_nom"=>[0.694], "bus"=>"47", "configuration"=…
  "load47" => Dict{String, Any}("model"=>POWER, "connections"=>[3, 4], "pd_nom"=>[0.045], "bus"=>"835", "configuration"…

The data_eng["load"]["load34"] looks like so:

Dict{String, Any} with 11 entries:
  "model"         => POWER
  "connections"   => [1, 4]
  "pd_nom"        => [0.701]
  "bus"           => "629"
  "configuration" => WYE
  "status"        => ENABLED
  "time_series"   => Dict("qd_nom"=>"normalized_load_profile", "pd_nom"=>"normalized_load_profile")
  "source_id"     => "load.load34"
  "vm_nom"        => 0.23
  "dispatchable"  => NO
  "qd_nom"        => [0.230408]

Can anyone suggest why the two problems would have a different set of buses for terminals that have loads? I'm using PowerModelsDistribution v0.15.1.

Copy link

stale bot commented Aug 9, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Aug 9, 2024
@pseudocubic pseudocubic added pinned and removed wontfix This will not be worked on labels Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants