First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!

Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

answered Mar 11 '2

jconto gravatar image

Load data in a CSV file can be read as follow:

import csv
with open('loaddata.csv', 'r') as file:
     reader = csv.reader(file)
for row in reader:
    #format=node number, load MW, load Mvar
    #             10004,       5,         5
    loaddatalst = row.split(',')
    loadbus = int(loaddatalst [0])
    loadid = '1'             #or loaddatalst [x], x is position of load id in row
    loadp = float(loaddatalst [1])
    loadq = float(loaddatalst [2])
    psspy.load_data_4(loadbus, loadid, 1, [loadp, loadq, 0, 0, 0, 0])

With a second "CSV read block" the data for generators can be updated. Search the internet for "python CSV read", converting data types and the PSSe API for fuctions and data types needed as parameters.

click to hide/show revision 2
No.2 Revision

Load data in a CSV file can be read as follow:

import csv
with open('loaddata.csv', 'r') as file:
     reader = csv.reader(file)
for row in reader:
    #format=node number, load MW, load Mvar
    #             10004,       5,         5
    loaddatalst = row.split(',')
    loadbus = int(loaddatalst [0])
    loadid = '1'             #or loaddatalst [x], x is position of load id in row
    loadp = float(loaddatalst [1])
    loadq = float(loaddatalst [2])
    psspy.load_data_4(loadbus, loadid, 1, [loadp, loadid,[_i,_i,_i,_i,_i,_i],[loadp, loadq, 0, 0, 0, 0])

With a second "CSV read block" the data for generators can be updated. Search the internet for "python CSV read", converting data types and the PSSe API for fuctions and data types needed as parameters.

click to hide/show revision 3
No.3 Revision

Load data in a CSV file can be read as follow:

import csv
with open('loaddata.csv', 'r') as file:
     reader = csv.reader(file)
for row in reader:
    #format=node number, load MW, load Mvar
    #             10004,       5,         5
    loaddatalst = row.split(',')
    loadbus = int(loaddatalst [0])
int(loaddatalst[0])
    loadid = '1'             #or loaddatalst [x], x is position of load id in row
    loadp = float(loaddatalst [1])
float(loaddatalst[1])
    loadq = float(loaddatalst [2])
float(loaddatalst[2])
    psspy.load_data_4(loadbus, loadid,[_i,_i,_i,_i,_i,_i],[loadp, loadq, 0, 0, 0, 0])

With a second "CSV read block" the data for generators can be updated. Search the internet for "python CSV read", converting data types and the PSSe API for fuctions and data types needed as parameters.

click to hide/show revision 4
No.4 Revision

Load data in a CSV file can be read as follow:

import csv
with open('loaddata.csv', 'r') as file:
     reader = csv.reader(file)
for row in reader:
    #format=node number, load MW, load Mvar
    #             10004,       5,         5
    loaddatalst = row.split(',')
    loadbus = int(loaddatalst[0])
    loadid = '1'             #or loaddatalst [x], x is position of load id in row
    loadp = float(loaddatalst[1])
    loadq = float(loaddatalst[2])
    psspy.load_data_4(loadbus, loadid,[_i,_i,_i,_i,_i,_i],[loadp, loadq, 0, 0, 0, 0])

With a second "CSV read block" the data for generators can be updated. Search the internet for "python CSV read", converting data types and the PSSe API for fuctions and data types needed as parameters.

click to hide/show revision 5
No.5 Revision

Load data in a CSV file can be read as follow:

import csv
with open('loaddata.csv', 'r') as file:
     reader = csv.reader(file)
for row in reader:
    #format=node number, load MW, load Mvar
    #             10004,       5,         5
    loaddatalst #loaddatalst = row.split(',')
    loadbus = int(loaddatalst[0])
    loadid = '1'             #or loaddatalst [x], x is position of load id in row
    loadp = float(loaddatalst[1])
    loadq = float(loaddatalst[2])
    psspy.load_data_4(loadbus, loadid,[_i,_i,_i,_i,_i,_i],[loadp, loadq, 0, 0, 0, 0])

With a second "CSV read block" the data for generators can be updated. Search the internet for "python CSV read", converting data types and the PSSe API for fuctions and data types needed as parameters.