Menu

solution mode

2024-09-12
2024-09-12
  • Yan Ademar Invernizzi

    I have been solving a circuit in yearly mode with a stepsize of 15 minutes, resulting in 96 values ​​of voltage, current, or power verified, correct?
    When I try to pull these 96 values ​​from python it only returns 4. Why is this? Am I doing something wrong?
    I am trying to get the 96 values ​​from each bar of my circuit, but the result is the one shown in the pinned image.

    #realizando a integração dss com o pyhton
    dss_file = r"C:\py-dss-interface_pg\pythonProject\Microgrid_test\15m.dss"
    dss = py_dss_interface.DSS()
    dss.text("compile [{}]".format(dss_file))
    dss.solution.solve()
    #Pegando todas as barras:
    buses = dss.circuit.buses_names
    
    
    
    #Determinando o tamanho da matriz(n x m)
    n=96
    matriz = pd.DataFrame(np.nan,index=range(n),columns=buses)
    #Matriz pronta, devemos pegar o valor da tensão em cada barra.
    #Não será necessario o uso de medidor.
    aux=0
    #preenchendo a matriz com os devidos valores de tensão.
    print("here")
    for i in buses:
        if pd.isna(matriz.loc[aux,i]):
            try:
                dss.circuit.set_active_bus("{}".format(i))
                matriz[aux,i] = dss.bus.vmag_angle
            except Exception as e:
                print("erro ao processar a barra {} sendo o erro igual a {}".format(i,e))
    
     
  • Yan Ademar Invernizzi

    the excel files pulled directly from opendss give me 96 values.

     
    • Davis Montenegro

      Hello,

      OK, you need to understand that the values you are extracting from the buses are only the last values reported, this is, if you simulated 96 steps, the values reported with your actual method will only capture the values for step 96, not the ones before.
      You see, that's what monitors are for. During the simulation, they capture and record the assigned values for every simulation step. There are several ways to solve this issue:

      1. Add monitors to the parts of the system you want to observe and record.
      2. Do the simulation using 1 step and move forward within a for loop recording the values you are interested in for each simulation step.
      3. ...

      Best regards,

       

Log in to post a comment.