PSSE Blown Up Case or Iteriation Limit Exceeded
I'm am trying to run an automation program I made on PSSE. I am pretty much accessing data from an excel sheet and transferring it to PSSE. The code is shown below. When running this code, I either get a blown up case or an iteration limit exceeded message. Are there any ways to fix this, change settings of program, or any solving method? Any help would be appreciated. The function I am using is psspy.fdns
, I need to use fixed slope decoupled Newton Raphson method. And it is shown many times in the code.
from __future__ import print_function
import os.path
import win32com.client
#---------------------------------------------------------------------------------------------------------------------
xlApp = win32com.client.DispatchEx('Excel.Application') # Running Excel
xlsPath = os.path.expanduser('I:\TPGeneral\Ten Year Load Forecasts 2017-2026.xlsm')# Reading xlsm file
wb = xlApp.Workbooks.Open(Filename=xlsPath) # Opening file
xlApp.Run('csvfile4')# Running macro---- csvfile2 is the macro name. It is under the "csv" module in the VBA editor
wb.Save()
xlApp.Quit()
#---------------------------------------------------------------------------------------------------------------------
import os, sys
import psspy
import redirect
import csv
psspy.throwPsseExceptions = True
from Tkinter import * # File Dialog
import tkFileDialog
import tkSimpleDialog
import tkMessageBox
import Tkinter as tk
LOAD_GEN_DATAFILE = 'I:\TPGeneral\Load_Forecasts.csv' # CSV File to Read
#-------------------------------------------------------------------------------
# read the entire CSV into Python.
# CSV has columns starting with Year,busnum,busname,scaled_power,tla,location
data = list(csv.reader(open(LOAD_GEN_DATAFILE)))
mydict = {}
for row in data:
Year,busnum,busname,scaled_power,tla,data_location,empty,year_link,from_,to,digit,name2,tla_2,min_value,max_value = row[0:15]
#If this is a year not seen before, add it to the dictionary
if Year not in mydict:
mydict[Year] = {}
busses_in_year = mydict[Year]
if data_location not in busses_in_year:
busses_in_year[data_location] = []
#Add the bus to the list of busses that stop at this location
busses_in_year[data_location].append((busnum,busname,scaled_power))
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------------------------------------------------------------
#User Input Statement
year = raw_input("Please Select Year of Study: ")
print("\n")
location=raw_input(" \n The list above show the TLA Pockets as well as the ID numbers assigned to them ()\n\n Please enter the ID #: ")
print("\n")
Year=year
data_location=location
#---------------------------------------------------------------------------------------------------------------------------------------
#-------------------------------------------------LOAD FORECASTS--------------------------------------------------------------------
outputs=[]
if Year in mydict and data_location in mydict[Year]:
busses_in_year = mydict[Year]
#print("Here are all the busses at that location for that year and the new LOAD TOTAL: ")
#print("\n")
#Busnum, busname,scaled_power read from excel sheet matching year and location
for busnum,busname,scaled_power in busses_in_year[data_location]:
scaled_power= float(scaled_power)
busnum = int(busnum)
output='Bus #: {}\t Area Station: {}\t New Load Total: {} MW\t'
formatted = output.format(busnum, busname, scaled_power)
outputs.append(formatted)
psspy.bsys(1,0,[0.0,0.0],0,[],1,[busnum],0,[],0,[])
psspy.scal_2(1,0,1,[0,0,0,0,0],[0.0,0.0,0.0,0.0,0.0,0.0,0.0])
psspy.scal_2(0,1,2,[0,1,0,1,0],[scaled_power,0.0,0,-.0,0.0,-.0,0])
#psspy.fdns([0,0,0,0,0,0,0,0])
#psspy.fdns([1,0,0,0,0,0,0,0])
#psspy.fdns([1,0,1,0,0,0,0,0 ...