FigurePath = "F:/PosDoc Projects/11_Industrial Projects/HuaWei/WISF/R_Results/" TestName = "5.2.5.5_contingency" if LoadScenario == "SummerPeakLoad": file_name = "SummerHi-20171219-153047-34-SystemNormal" if LoadScenario == "SummerLowLoad": file_name = "SummerLowNormal-20161225-040047" if LoadScenario == "SimplifiedSystem": file_name = "WISF_ADD" # start simulation OutputFilePath = ProgramPath + str(fault_type) + "SimulationOutput4.outx" TimeShift = 0 psspy.case(GridInfoPath + file_name + ".sav") # psspy.rstr(GridInfoPath+file_name+".snp") psspy.resq(GridInfoPath + "/" + file_name + ".seq") psspy.dyre_new([1, 1, 1, 1], GridInfoPath + "/" + file_name + ".dyr", "", "", "") psspy.addmodellibrary(HuaweiModelPath + 'HWS2000_psse34.dll') psspy.addmodellibrary(HuaweiModelPath + 'MOD_GPM_PPC_V13_34.dll') psspy.addmodellibrary(HuaweiModelPath + 'MOD_GPM_SB_V7.dll') psspy.dynamics_solution_param_2([_i, _i, _i, _i, _i, _i, _i, _i], [0.300, _f, 0.001, 0.004, _f, _f, _f, _f]) psspy.machine_data_2( 500, r"""1""", [_i, _i, _i, _i, _i, _i], [90, _f, _f, _f, 96.8, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f]) psspy.fnsl([0, 0, 0, 1, 1, 1, 99, 0]) psspy.bus_frequency_channel([1, 1000], r"""System frequency""") psspy.voltage_channel([2, -1, -1, 500], r"""Inverter Voltage Mag.""") psspy.voltage_channel([3, -1, -1, 800], r"""WISF POC Voltage Mag.""")
+ os.environ['PATH']) #add the the above line #Here is the macro script import psspy import redirect _i=psspy.getdefaultint() _f=psspy.getdefaultreal() _s=psspy.getdefaultchar() redirect.psse2py() import pssdb psspy.psseinit(80000) psspy.case(r"""psse.sav""") psspy.resq(r""" psse.seq""") psspy.lines_per_page_one_device(1,60) psspy.report_output(2,r"""report.txt""",[0,0]) psspy.flat([1,1,1,0],[0.0,0.0]) psspy.seqd([0,0]) psspy.sequence_network_setup(0) psspy.scmu(1,[0,0,0,0,0,0,0],[0.0,0.0,0.0,0.0,0.0],"") psspy.scmu(2,[7,1082,0,0,0,0,0],[0.0,0.0,0.0,0.0,0.0],"") psspy.scmu(3,[7,1082,0,0,0,0,0],[0.0,0.0,0.0,0.0,0.0],"") psspy.sequence_network_setup(0) #end of script # add below line to show the report f=open("report.txt",'r') for line in f.readlines(): print line
integration_step = ts[test - 1] # Simulation time step[s] _i = psspy.getdefaultint() _f = psspy.getdefaultreal() _s = psspy.getdefaultchar() redirect.psse2py() psspy.psseinit(50000) dVref = 0.05 POC_VCtrl_Tgt = 1.00 CON_PPCVref = 10 VAR_PPCVini = 1 FileName = f_list[case[test - 1] - 1] psspy.case(CasePath + FileName) psspy.resq(CasePath + "Tamworth_SMIB.seq") psspy.addmodellibrary(CasePath + 'SMASC_E161_SMAPPC_E130_342_IVF150.dll') psspy.dyre_new([1, 1, 1, 1], CasePath + "Tamworth_SMIB_E161_E130.dyr", '', '', '') OutputFilePath = FigurePath + '05. PoC Vref Step Test' + "\\" + 'Test' + str( test + 18) + '_' + FileName + '_sFac' + str(acceleration) + '_dT' + str( integration_step) + '_PoC Vref Step Test.out' # Setup Dynamic Simulation parameters psspy.dynamics_solution_param_2( [n_iteration, _i, _i, _i, _i, _i, _i, _i], [acceleration, tolerance, integration_step, _f, _f, _f, _f, _f]) psspy.fdns([0, 0, 1, 1, 0, 0, 99, 0]) # convert load , do not change
file_name = "SummerHi-20171219-153047-34-SystemNormal_all_bus_DDSF" if LoadScenario == "SummerLowLoad": file_name = "SummerLo-20171226-043047-34-SystemNormal_all_bus_DDSF" if LoadScenario == "SimplifiedSystem": file_name = "NEOEN Western Downs Solar Farm_C3WV_mod" ######################################### Read Input List ####################################### # Active Power Setpoint ActivePowerSetpoint = range(0, 101, 50) ReactivePowerSetpoint = [-40, 40] vref = numpy.arange(0.70, 1.3, 0.05) S = 100 # Initialize psspy.read(0, GridInfoPath + LoadScenario + "/" + file_name + ".raw") psspy.resq(GridInfoPath + LoadScenario + "/" + file_name + ".seq") psspy.dyre_new([1, 1, 1, 1], GridInfoPath + LoadScenario + "/" + file_name + ".dyr", "", "", "") psspy.addmodellibrary(HuaweiModelPath + 'HWH9001_342.dll') psspy.addmodellibrary(HuaweiModelPath + 'PPC_PSSE_ver_13_08_34_2_10082018_AUS.dll') psspy.addmodellibrary(HuaweiModelPath + 'MOD_GPM_SB_V7.dll') psspy.dynamics_solution_param_2([_i, _i, _i, _i, _i, _i, _i, _i], [1.000, _f, 0.001, 0.004, _f, _f, _f, _f]) for i in range(0, len(ActivePowerSetpoint)): for j in range(0, len(ReactivePowerSetpoint)): for k in range(0, len(vref)): # re - initialize psspy.read(0,
OutputFilePath = ProgramPath + "VS_SimulationOutput.outx" FigurePath = "D:/NEOEN/" file_name = "SummerHi-20171219-153047-34-SystemNormal_all_bus_DDSF" # Initialize ierr = psspy.addmodellibrary(GridInfoPath + 'dsusr.dll') ierr = psspy.addmodellibrary(HuaweiModelPath + 'HWH9001_342.dll') ierr = psspy.addmodellibrary(HuaweiModelPath + 'PPC_PSSE_ver_13_08_34_2_10082018_AUS.dll') ierr = psspy.addmodellibrary(HuaweiModelPath + 'MOD_GPM_SB_V7.dll') ierr = psspy.addmodellibrary(GridInfoPath + 'GEWTG34.dll') ierr = psspy.addmodellibrary(GridInfoPath + 'SMAPPC_B111_34_IVF111.dll') ierr = psspy.addmodellibrary(GridInfoPath + 'SMASC_C135_34_IVF111.dll') ierr = psspy.read(0, GridInfoPath + file_name + ".raw") ierr = psspy.resq(GridInfoPath + file_name + ".seq") ierr = psspy.dyre_new([1, 1, 1, 1], GridInfoPath + file_name + ".dyr", "", "", "") # psspy.machine_data_2(100,r"""1""",[_i,_i,_i,_i,_i,_i],[_f,_f, 80,_f, 132,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f]) # psspy.machine_data_2(100,r"""1""",[_i,_i,_i,_i,_i,_i],[_f,_f,_f, 80, 132,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f]) psspy.fdns([1, 0, 1, 1, 1, 1, 99, 0]) #psspy.change_plmod_icon(101, r"""1""", r"""GPMPPC""", 4, 3) #psspy.change_plmod_con(101, r"""1""", r"""GPMPPC""", 10, 0.45) psspy.dynamics_solution_param_2([_i, _i, _i, _i, _i, _i, _i, _i], [1.000, _f, 0.001, 0.004, _f, _f, _f, _f]) # discard disturbance psspy.dscn(30531) psspy.dscn(36530) psspy.dscn(37530) psspy.machine_data_2(30531, r"""12""", [0, _i, _i, _i, _i, _i],