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

State Estimation Error bus_append[aux_bus, ZERO_INJ_FLAG] = True IndexError: index 1866 is out of bounds for axis 0 with size 999 #2435

Open
4 tasks done
258796535 opened this issue Nov 2, 2024 · 0 comments

Comments

@258796535
Copy link

Feature Checklist

Issue

first, net is right,and pp.runpp(net, max_iteration=10, tolerance_mva=1e-5, numba=True) is successful!
but,I tried to design a state estimation example,as bellow:
def state_estimation(self, request):
bb_case_id = request.GET.get("bb_case_id")
net_json = bb_service.get_json_format_net(bb_case_id=bb_case_id)
net = pp.from_json_string(net_json)
# 假设 df 是你的 DataFrame 对象
print(net.bus)
for index, row in net.bus.iterrows():
if row['dt_vn_kv'] is None or row['dt_vn_kv'] <0.1:
print(str(index)+':'+row['name']+':'+row['bus_name'])
else:
pp.create_measurement(net, "v", "bus",row['dt_vn_kv']/row['vn_kv'], 0.004, index)

    success = est.estimate(net, init="flat")
    print(success)
    return DetailResponse(data=None, msg="成功")

I tried to running,but report error。
[2024-11-03 07:28:39][dvadmin.utils.exception.CustomExceptionHandler():54] [ERROR] Traceback (most recent call last):
File "D:\workspace_py\energy-api\venv\lib\site-packages\rest_framework\views.py", line 506, in dispatch
response = handler(request, *args, **kwargs)
File "D:\workspace_py\energy-api\dvadmin\poweranalysis\views\CimeModel.py", line 534, in state_estimation
success = est.estimate(net, init="flat")
File "D:\workspace_py\energy-api\venv\lib\site-packages\pandapower\estimation\state_estimation.py", line 87, in estimate
return se.estimate(v_start=v_start, delta_start=delta_start,
File "D:\workspace_py\energy-api\venv\lib\site-packages\pandapower\estimation\state_estimation.py", line 262, in estimate
self.net, self.ppc, self.eppci = pp2eppci(self.net, v_start=v_start, delta_start=delta_start,
File "D:\workspace_py\energy-api\venv\lib\site-packages\pandapower\estimation\ppc_conversion.py", line 410, in pp2eppci
ppci = _add_measurements_to_ppci(net, ppci, zero_injection)
File "D:\workspace_py\energy-api\venv\lib\site-packages\pandapower\estimation\ppc_conversion.py", line 198, in _add_measurements_to_ppci
bus_append = _add_zero_injection(net, ppci, bus_append, zero_injection)
File "D:\workspace_py\energy-api\venv\lib\site-packages\pandapower\estimation\ppc_conversion.py", line 291, in _add_zero_injection
bus_append[aux_bus, ZERO_INJ_FLAG] = True
IndexError: index 1866 is out of bounds for axis 0 with size 999

Label

  • Relevant labels are selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant