Menu

How can I have a daily dynamic loadshape

2019-10-31
2019-11-01
  • DHIAA ELHAK Rebbah

    Hello,

    I would like to run the simulation using the TCP interface in python.

    I have a 33 bus system and I would like to use the plot command in a dynamic way for the loadshape, I am using the default loadshape for example.

    and would like to run the system for 24 hours (a day or 3 days or a week for example)

    with a daily or hourly or in seconds loadshape but in a dynamic way that I can see the loadshape changing not a static figure each time I click plot.

    How would I be able to do that ?

    is : ODGTCP.sendCommand('set LoadshapeClass=yearly mode=DYnamic controlmode=time stepsize=0.001s number=1000')

    then how would I do it in the realtime simulation ?
    data = ODGTCP.stepIn()
    NumHours = 3
    time.sleep(0.1)
    for x in range(0,NumHours):
    time.sleep(0.2)

    thank you.
    Dhiaa.

     
    • Davis Montenegro

      Hello,

      So, you are running a simulation using the yearly loadshapeclass, dynamic mode and control mode time every 1 ms to complete a second? OK, the first thing I would do is to send the commands in a different order, like this:

      ODGTCP.sendCommand('set mode=DYnamic LoadshapeClass=yearly  controlmode=time stepsize=0.001s number=1000')
      

      You see, everytime you change the simulation mode several default values change, so, before changing those, set the simulation mode and then modify the other parameters. To see the changes in voltage you can place monitors across the model, these can be created from your python script or in OpenDSS-G directly. If the monitors are created from the Python script OpenDSS-G will bring them on the next simulation step, so no worries. At the end of the simulation all the monitors will store the data you want, which you can export later.

      Best regards

      Davis

       
  • DHIAA ELHAK Rebbah

    Hello Davis,

    I appreciate the reply, and it was useful.

    However I am not sure it is what I am asking for. In my code I have a loop that starts from 0 to 60 (60 seconds meaning one minute for example)

    then from 0 to 60 it has to select object Load.load1 then it gets me the power voltages and currents of that specific load.

    I want to see some changes on the values of the load, or at least have a change in the load shape if I plot it for example. How can I plot a dynamic load shape for like 3 different seconds or 30 different seconds? and How can I get some changed measurements at least in terms of what I am doing. is the command:

    PVkW_Load2=abs(float(ODGTCP.sendCommand('powers').pop(0).decode("utf-8").replace(',','')))

    sufficient to get me power measurements and voltages and currents etc for that load ?

    Best Regards,
    Dhiaa.

     
    • Davis Montenegro

      Why don't you put a monitor on that load? it will record everyhting.

      Best regards

      Davis

       
      • DHIAA ELHAK Rebbah

        and then I plot the loads ? what is the command to get the values of power, voltages and currents of each load from each monitor installed on that load?

        also how can I get an instantaneous loadshape from monitors?

        Best Regards,
        Dhiaa.

         
        • Davis Montenegro

          Hi,

          I'm not sure if the python lib includes all the commands (I didn't write it,), but is open source so you can complement it if you want. All the commands and instructions that you can use with OpenDSS-G are documented here:

          https://sourceforge.net/projects/dssimpc/files/Documents/DSTCP_protocol.pdf/download

          All the commands are in this document, see if the one you need is implemented in the library, if it doesn't, you can add it as needed.

          Best regards

          Davis

           

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.