-
sim.zip while running helics with gridlabd, I am facing the following issue:
I have attached some files that may be relevant to the issue, and I would be grateful if you could take a look at them if possible to help me gain a better understanding. The attached zip file contains broker.py file, the main federate file named mainfed.py that publishes and subscribes, the gridlabd model file named r1.glm, the gridlabd config file named r1config.json. Given your expertise in this field, I believe that you could provide valuable insights and guidance on how to fix this issue. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hello @Barsha96 The connection issue is due to the publication is being defined as a global publication in r1config.json. either set "global": false, or remove the "R1/" from your subscription in mainfed.py. I also saw some other potential issues as a GridLAB-D developer and user. First is the clock object in r1.glm has no starttime or stoptime defined. Without it GridLAB-D won't know when to start and stop it's simulation. I'm surprised it didn't throw an error. The period is set to 20 seconds in the GridLAB-D federate. This could potentially cause a crash in GridLAB-D. It is always recommended that period be set to 1 second. Especially since you set the minimum_timestep=1 in r1.glm. You can try setting the minimum_timestep to 20 so it matches the period and that should work. I also recommend adding a recorder object with a recording interval of 20 seconds set as well to ensure the simulation moves forward at 20 second timesteps. This is due to the model being used contains no objects that would cause internal state of the objects to changes at a future time so all objects would request to jump to the end of the simulation which you probably don't want. The helics_msg object is kind of special than the others and waits to see what all the other objects want to go to and then requests makes that request to the broker. The GridLAB-D federate subscription is overwriting the nominal_voltage property of the substation object. This will have no effect on the powerflow results as nominal_voltage is an initial condition property. In powerflow it's used at the beginning of the simulation and is overwritten by what is set in positive_sequence_voltage so I would recommend changing your subscription to write to positive_sequence_voltage. Please keep in mind that positive_sequence_voltage is a complex type and not a double like nominal_voltage so you will need to modify mainfed.py accordingly. |
Beta Was this translation helpful? Give feedback.
-
Thank you for the detailed answers. You helped me with the problems I did not even knew existed. I was able to get the data out from the first solution you provided. |
Beta Was this translation helpful? Give feedback.
Hello @Barsha96 The connection issue is due to the publication is being defined as a global publication in r1config.json. either set "global": false, or remove the "R1/" from your subscription in mainfed.py. I also saw some other potential issues as a GridLAB-D developer and user.
First is the clock object in r1.glm has no starttime or stoptime defined. Without it GridLAB-D won't know when to start and stop it's simulation. I'm surprised it didn't throw an error.
The period is set to 20 seconds in the GridLAB-D federate. This could potentially cause a crash in GridLAB-D. It is always recommended that period be set to 1 second. Especially since you set the minimum_timestep=1 in r1.glm. You…