huminan / PowerGrid

simulate centralized and distributed power grid, in order to implement state estimation and bad data detection. Also, simplest FDI Attack.
19 stars 8 forks source link

Hello, I have been reporting mistakes, I would like to ask where the problem is #2

Open Haoran4 opened 1 year ago

Haoran4 commented 1 year ago

Exception in Tkinter callback Traceback (most recent call last): File "E:\python\python\lib\tkinter__init.py", line 1883, in call__ return self.func(*args) File "E:\pycharm\FDIA detection\PowerGrid-master1\PowerGrid-master\main.py", line 739, in confirm model = DistributedNonLinearPowerGrid(nodes, PMU, conf_dict) File "E:\pycharm\FDIA detection\PowerGrid-master1\PowerGrid-master\decentralized\distributed_nonlinear_powergrid.py", line 14, in init super().init(nodes=nodes, pmu=pmu, conf_dict=conf_dict) File "E:\pycharm\FDIA detection\PowerGrid-master1\PowerGrid-master\decentralized\distributed_linear_powergrid.py", line 45, in init self.reorder(nodes) # 9.8s File "E:\pycharm\FDIA detection\PowerGrid-master1\PowerGrid-master\decentralized\distributed_linear_powergrid.py", line 178, in reorder bus_connection_reorder[node] = self.bus_info_dict[node] KeyError: 18

huminan commented 1 year ago

Thanks for your report. Sincerely, this code is a bit ugly and the Tkinter module has been out of style, it is not worth to be fixed. Besides, I have my research interest changed two years ago. So, I am sorry that the code will not be updated anymore. By the way, in my opinion, Matlab is more suitable for power grid simulation (state estimation and FDI) according to my experience, rather than Python, especially if some distributed performs were considered. Firstly, Matlab has professional instruments for power grid model building, which provides more detailed power grid parameters and could be config in a visualized way. Besides, when distributed estimation is considered, I created some distributed agents in this code and designed their communication. However, the GIL feature of Python's thread makes the distributed computing operation inefficient, and the coding difficulty is a disaster. It is recommended to aggregate the information matrix of each agent into a large one, which looks like a Jordan matrix. In this way, the FDI Attack is easier to be injected and the estimation process is equal to some large matrix computing tasks which Matlab is good at. Moreover, Matlab is more convenient to code and shows the results in elegance. For these reasons, though this code can indeed run after some struggle, it is hard to develop new algorithms based on it, and I have no movement to promote it. Thanks for your interest again, wish you success with your research!