Ask Your Question

Alex_barajas's profile - activity

2023-10-23 12:20:45 -0500 received badge  Teacher (source)
2023-02-09 18:22:45 -0500 commented answer How to run a Static DC powerflow?

it's running the power flwo but the internal values are not updating. any clue as to why?

2023-02-09 17:16:09 -0500 commented answer Can I extract updated values after running DC Loadflow (DCLF_2)?

i was able to reproduce the same error, I'm not sure what's going on but I'll post if I find an answer.

2023-02-09 16:54:18 -0500 commented answer Can I extract updated values after running DC Loadflow (DCLF_2)?

how are updating your machine values? I use - psspy.machine_chng_3(ibus, "1", [], [p]).

2023-02-08 23:20:45 -0500 answered a question Can I extract updated values after running DC Loadflow (DCLF_2)?

which values are you attempting to grab? abusreal() might be a good start

2023-01-26 08:08:38 -0500 received badge  Famous Question (source)
2023-01-25 21:17:37 -0500 received badge  Notable Question (source)
2023-01-25 18:37:10 -0500 received badge  Popular Question (source)
2023-01-25 13:30:11 -0500 asked a question Creating Dynamic (.dyr) files

Hey y'all, I'm writing a python wrapper to integrate Wave Energy Converters onto PSSe and I finished steady state and I'm moving onto dynamics. We're trying to understand how to create the .dyr files for a given micro-grid and wave energy converter. How can I go about generating new .dyr files from a .raw or .sav?

2022-10-12 11:33:19 -0500 received badge  Enthusiast
2022-09-26 02:29:28 -0500 received badge  Famous Question (source)
2022-09-20 20:53:15 -0500 commented answer How to run a Static DC powerflow?

it seems not to be updating and just solving the AC. Any reason that would be happening?

2022-09-20 20:50:58 -0500 answered a question PSSE to Python and run from inside of the PSSE

Hey! you'll need to import PSSe to a python script. I'll copy an example below. you'll need to update the paths with the location of your PSSe install on your machine.

import os,sys

# Path stuff
sys.path.append(r"C:\Program Files\PTI\PSSE35\35.3\PSSPY37")
sys.path.append(r"C:\Program Files\PTI\PSSE35\35.3\PSSBIN")
sys.path.append(r"C:\Program Files\PTI\PSSE35\35.3\PSSLIB")
sys.path.append(r"C:\Program Files\PTI\PSSE35\35.3\EXAMPLE")
os.environ['PATH'] = (r"C:\Program Files\PTI\PSSE35\35.3\PSSPY37;" 
  + r"C:\Program Files\PTI\PSSE35\35.3\PSSBIN;" 
  + r"C:\Program Files\PTI\PSSE35\35.3\EXAMPLE;" + os.environ['PATH'])

import psse35
psse35.set_minor(3)

import psspy
psspy.psseinit(50)

case_file = '../input_files/case14.raw' # update this with a path to an example case
psspy.read(1, case_file)
psspy.fnsl()
2022-09-15 09:33:31 -0500 received badge  Notable Question (source)
2022-09-15 09:33:31 -0500 received badge  Popular Question (source)
2022-09-09 14:41:34 -0500 received badge  Editor (source)
2022-09-09 14:41:14 -0500 asked a question How to run a Static DC powerflow?

Hi y'all, I'm attempting to run a DC power flow using just a Python script. From my understanding using psspy.fnsl() is running an AC powerflow. I feel like I'm missing an obvious function call. please help if you can :^)

here's my code for reference:

import os,sys

# Path stuff
sys.path.append(r"C:\Program Files\PTI\PSSE35\35.3\PSSPY37")
sys.path.append(r"C:\Program Files\PTI\PSSE35\35.3\PSSBIN")
sys.path.append(r"C:\Program Files\PTI\PSSE35\35.3\PSSLIB")
sys.path.append(r"C:\Program Files\PTI\PSSE35\35.3\EXAMPLE")
os.environ['PATH'] = (r"C:\Program Files\PTI\PSSE35\35.3\PSSPY37;" 
  + r"C:\Program Files\PTI\PSSE35\35.3\PSSBIN;" 
  + r"C:\Program Files\PTI\PSSE35\35.3\EXAMPLE;" + os.environ['PATH'])

# imports all the GOOOOOOD stuff we need for our program / automation stuff 
import glob
from pathlib import Path
import pandas as pd
import psse35
psse35.set_minor(3)
import math
import numpy as np

import psspy
psspy.psseinit(50)


case_file = '../input_files/case14.raw'
psspy.read(1, case_file)
psspy.fnsl()


injection_file = ('../input_files/WECgen_data.csv')
injection = pd.read_csv(injection_file)

for i in range(len(injection)):
    print("Time: {}".format(injection.iloc[i].time))
    print("P setpoint: {}".format(injection.pg.iloc[i]))
    ierr = psspy.machine_chng_3(3, "1", [], [injection.pg.iloc[i]])
    if ierr > 0:
        print("Failed | machine_chng_3 code = {}".format(ierr))
    psspy.fnsl() # needs to be DC solver not AC 
    print("========================")

UPDATE: seems like PSSe isn't actually solving the DC powerflow, I feel like I'm missing something simple. using these function parameters

psspy.dclf(1, 1, [1,0,1,2,1,1],[0,0,0], '1')
2022-08-08 19:12:59 -0500 answered a question Porting PSSPY to Python 3

I believe if you use PSSe 35 you can use Python 3