os.environ['PATH']) sys.path.append(PYTHONPATH) os.environ['PATH'] += ';' + PYTHONPATH import excelpy import dyntools OutNames = "C:\python27\linetrip_no_fault" #[Out1, Out2] Ruta = os.getcwd() outFile = dyntools.CHNF(OutNames + ".out") #Extrae informaciĆ³n del archivo *.out short_title, chanid_dict, chandata_dict = outFile.get_data() a = zip([chanid_dict]) print a print len(a) report = Ruta + '\\' + 'my.xlsx' xl = excelpy.workbook(xlsfile=report, sheet="Voltage", overwritesheet=True, mode='w') #xl.show() #xl.worksheet_add_end(sheet="Voltage") #address=(1,'b') #xl.autofit_columns(address, sheet=chandata_dict) #xl.set_range(1, 'a', zip([short_title])) #xl.set_range(1, 'b', zip([chanid_dict])) #xl.set_range(1, 'c', zip([chandata_dict]) ) #xl.save() #xl.close() #xl.show()
### ### ### ### ### ### distpercent = 20 #% of distrubance seems to be the maximum possible disturbance on the whole loads ### ### ### ### ### ### ndist = 10 nswitch = 20 [volt, voltd, vpn, vpnd, dvpn, switch] = randdist([ filename, distpercent, 'random', 0, capbus, capstep, capQ, pilot, ndist, nswitch ]) x1 = excelpy.workbook( r'C:\Documents and Settings\xw0419\Mes documents\Mon Projet\Simulation\IREQ\PythonProgs\test4data.xls', sheet="Feuil1", overwritesheet=True, mode='w') x1.show() x1.show_alerts(False) r0 = 2 c0 = 1 ## Initialzation data for MATLAB x1.set_cell((1, 1), npn) x1.set_cell((1, 2), ncap) x1.set_cell((1, 3), ndist) x1.set_cell((1, 4), nswitch) x1.set_cell((1, 5), r0) x1.set_cell((1, 6), c0)
) psspy.fnsl(options1=0, options5=0) ierr, volt = psspy.abusreal(-1, string="PU") ierr = psspy.load_data_3(i=1020, intgar1=0) ierr, buses = psspy.abusint(-1, string="NUMBER") psspy.fnsl(options1=0, options5=0) ierr, voltd = psspy.abusreal(-1, string="PU") n = len(volt[0][:]) dv = [[0] * n] for i in range(0, n - 1): dv[0][i] = voltd[0][i] - volt[0][i] import excelpy x1 = excelpy.workbook( r'C:\Documents and Settings\xw0419\Mes documents\Mon Projet\Simulation\IREQ\PythonProgs\outdata1.xls', sheet="Feuil1", overwritesheet=False, mode='w') x1.show() x1.show_alerts(False) x1 = excelpy.workbook( r'C:\Documents and Settings\xw0419\Mes documents\Mon Projet\Simulation\IREQ\PythonProgs\outdata1.xls', sheet="Feuil1", overwritesheet=False, mode='w') x1.set_cell('e1', 'Bus No.') x1.set_cell('f1', 'Vnom (p.u)') x1.set_cell('g1', 'Vdist (p.u)') x1.set_cell('h1', 'Vd (p.u)') x1.set_range(2, 'e', zip(*buses)) x1.set_range(2, 'f', zip(*volt))
Zip = scopfaddress + '\\' + caseX + '\\' + caseX + '.zip' #Progress = address + '\\' + caseX + '\\' + 'Progress_' + caseX + '.txt' #logFile = file(Progress, "a") #sys.stdout = logFile psspy.dfax([1, 1], fileSub, fileMon, fileCon, acccdfx) psspy.solution_parameters_4(intagar=[_i, 150, _i]) # run ACCC psspy.accc_with_dsp_3(tol, options, 'ALL', acccdfx, accout, "", fileINL, Zip) xlsfile = scopfaddress + '\\' + caseX + '\\' + caseX + '.xlsx' pssexcel.accc(accout, string, colabel, stype, busmsm, sysmsm, rating, namesplit, xlsfile, sheet, overwritesheet, show, ratecon, baseflowvio, basevoltvio, flowlimit, flowchange, voltchange) excelfile = excelpy.workbook(xlsfile) excelfile.close() # Saving post-contingency cases #pywin.debugger.set_trace() archive = zipfile.ZipFile(Zip, 'r') ziplist = archive.namelist() isvfiles = [] for file in ziplist: if '.isv' in file: isvfiles.append(file[:-4]) if '.sav' in file: savefile = file #pywin.debugger.set_trace() # Get contingency names from excel sheet workbook_accc = xlrd.open_workbook(xlsfile)
Q_s = min(Q_s1,Q_s2) elif Q_s1 > 0 and Q_s2 > 0: Q_s = max(Q_s1,Q_s2) return Q_s, Q_s1, Q_s2 #################################################INPUTS##################################################### # Model of collector added to get max of voltage values in Full Collector System # Swing buses swing_bus = [206294] POI_bus =swing_bus[0] V_POI = 1.05 record_output = 1 psspy.case(r"""Larrabee_MW_MVOW_0.95.sav""") ACF = 0.5 myxls = excelpy.workbook("RPS_ASOW_Scn3_13p6MW_"+str(V_POI)+".xlsx", sheet="RPS", overwritesheet=True) num_shunt = 8 oltc_ratio_ons = 0.96 oltc_ratio_ofs = 0.97 STATCOM_size = 50 # statcom start value and iteration vset step #Vset_STAT = .9497#0.9996#1.0087 ##############INPUT #Vset_step = 0.000001 ##############INPUT #Vset_STAT = 0.9996#1.0087 ##############INPUT #Vset_step = 0.000001 ##############INPUT Vset_STAT = 1.0497#0.9996#1.0087 ##############INPUT Vset_step = 0.000001 ##############INPUT # Vset_STAT = 0.949947000000007 #special loop_num = 650 ########################################################################################################## # BUSES NEED TO BE ADAPTED FOR EACH SCENARIO