Skip to content

Commit

Permalink
OPF tests running again - need to specify controllable parameter for …
Browse files Browse the repository at this point in the history
…loads
  • Loading branch information
friederikemeier committed Jan 27, 2017
1 parent 8ba3da5 commit a341adb
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@ doc/_build/*
tutorials/.ipynb_checkpoints
.cache
*__pycache__*

.vs
*.pyproj
*.user
*.sln
*.bak
6 changes: 3 additions & 3 deletions pandapower/test/opf/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def test_simplest_voltage():
pp.create_gen(net, 1, p_kw=-100, controllable=True, max_p_kw=-5, min_p_kw=-150, max_q_kvar=50,
min_q_kvar=-50, cost_per_kw=100)
pp.create_ext_grid(net, 0)
pp.create_load(net, 1, p_kw=20)
pp.create_load(net, 1, p_kw=20, controllable = False)
pp.create_line_from_parameters(net, 0, 1, 50, name="line2", r_ohm_per_km=0.876,
c_nf_per_km=260.0, imax_ka=0.123, x_ohm_per_km=0.1159876,
max_loading_percent=100*690)
Expand Down Expand Up @@ -61,7 +61,7 @@ def test_eg_voltage():
pp.create_gen(net, 1, p_kw=-100, controllable=True, max_p_kw=-5, min_p_kw=-150, max_q_kvar=50,
min_q_kvar=-50)
pp.create_ext_grid(net, 0, vm_pu=1.01)
pp.create_load(net, 1, p_kw=20)
pp.create_load(net, 1, p_kw=20, controllable = False)
pp.create_line_from_parameters(net, 0, 1, 50, name="line2", r_ohm_per_km=0.876,
c_nf_per_km=260.0, imax_ka=0.123, x_ohm_per_km=0.1159876,
max_loading_percent=100*690)
Expand Down Expand Up @@ -92,7 +92,7 @@ def test_simplest_dispatch():
pp.create_gen(net, 1, p_kw=-100, controllable=True, max_p_kw=-5, min_p_kw=-150, max_q_kvar=50,
min_q_kvar=-50, cost_per_kw=100)
pp.create_ext_grid(net, 0, cost_per_kw=101)
pp.create_load(net, 1, p_kw=20)
pp.create_load(net, 1, p_kw=20, controllable = False)
pp.create_line_from_parameters(net, 0, 1, 50, name="line2", r_ohm_per_km=0.876,
c_nf_per_km=260.0, imax_ka=0.123, x_ohm_per_km=0.1159876,
max_loading_percent=100*690)
Expand Down
6 changes: 3 additions & 3 deletions pandapower/test/opf/test_curtailment.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ def test_minimize_active_power_curtailment():
pp.create_line(net, bus4, bus2, length_km=40., std_type='149-AL1/24-ST1A 110.0')

# create loads
pp.create_load(net, bus2, p_kw=60e3)
pp.create_load(net, bus3, p_kw=70e3)
pp.create_load(net, bus4, p_kw=10e3)
pp.create_load(net, bus2, p_kw=60e3, controllable = False)
pp.create_load(net, bus3, p_kw=70e3, controllable = False)
pp.create_load(net, bus4, p_kw=10e3, controllable = False)

# create generators
pp.create_ext_grid(net, bus1)
Expand Down
2 changes: 1 addition & 1 deletion pandapower/test/opf/test_dcline.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def dcline_net():
pp.create_ext_grid(net, b1, 1.02, max_p_kw=0.)
pp.create_ext_grid(net, b5, 1.02, max_p_kw=0.)

pp.create_load(net, bus=b4, p_kw=800e3)
pp.create_load(net, bus=b4, p_kw=800e3, controllable = False)
return net

def test_dispatch1(dcline_net):
Expand Down
3 changes: 2 additions & 1 deletion pandapower/test/opf/test_oberrhein.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ def test_opf_oberrhein():
net.sgen["max_q_kvar"]=1
net.sgen["min_q_kvar"]=-1
net.sgen["controllable"] =1
net.load["controllable"] = 0
# run OPF
pp.runopp(net, verbose=False)
assert net["OPF_converged"]

if __name__ == "__main__":
pytest.main(["test_opf.py", "-xs"])
pytest.main(["test_oberrhein.py", "-xs"])

0 comments on commit a341adb

Please sign in to comment.