Bus_Nam[Bus_Num.index(Fault_Equipment_End[i])]) ierr = psspy.branch_chng_3( Fault_Equipment_Start[i], Fault_Equipment_End[i], r"""1""", [0, _i, _i, _i, _i, _i], [_f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f], [_f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f], _s) if Fault_Equipment_Type[i] == 'TX' and Third_Bus_Record[ i] == 0: # disconnect 2-winding transformer Event_Name.append('Output=' + str(4 * P_setpoint) + 'MW' + ' ' + 'Tx Outage - ' + Bus_Nam[Bus_Num.index(Fault_Equipment_Start[i])] + ' to ' + Bus_Nam[Bus_Num.index(Fault_Equipment_End[i])]) ierr, whatever = psspy.two_winding_chng_5( Fault_Equipment_Start[i], Fault_Equipment_End[i], r"""1""", [0, _i, _i, _i, _i, _i, _i, _i, _i, _i, _i, _i, _i, _i, _i], [ _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f ], [_f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f], _s, _s) if Fault_Equipment_Type[i] == 'TX' and Third_Bus_Record[ i] != 0: # disconnect 3-winding transformer Event_Name.append('Output=' + str(4 * P_setpoint) + 'MW' + ' ' + 'Tx Outage - ' + Bus_Nam[Bus_Num.index(Fault_Equipment_Start[i])] + ' to ' + Bus_Nam[Bus_Num.index(Fault_Equipment_End[i])] + ' ' + Equipment_ID[i]) ierr, whatever = psspy.three_wnd_imped_chng_4( Fault_Equipment_Start[i], Fault_Equipment_End[i], Third_Bus_Record[i], Equipment_ID[i], [_i, _i, _i, _i, _i, _i, _i, 0, _i, _i, _i, _i, _i], [ _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f,
psspy.branch_p_and_q_channel( [4, -1, -1, 400, 46660], r"""1""", [r"""P Injection""", r"""Q Injection"""]) ierr = psspy.machine_array_channel([7, 2, 101], r"""1""", r"""Pelec 100""") ierr = psspy.machine_array_channel([8, 3, 101], r"""1""", r"""Qelec 100""") # ierr = psspy.state_channel([9, var_inv_stt + 6], r"""Inverter Voltage Measurement""") # start simulation psspy.strt_2([0, 0], OutputFilePath) psspy.run(0, 1, 1000, 1, 0) psspy.run(0, 5, 1000, 1, 0) psspy.two_winding_chng_5( 500, 46660, r"""1""", [_i, _i, _i, _i, _i, _i, _i, _i, 500, _i, _i, 0, _i, _i, _i], [ _f, _f, _f, _f, _f, _f, vref[k], _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f ], [_f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f], "", "") psspy.run(0, 20, 1000, 1, 0) # start draw curves # new folder if necessary if ActivePowerSetpoint[i] == 0: PName = r"""P = 0%""" if ActivePowerSetpoint[i] == 50: PName = r"""P = 50%""" if ActivePowerSetpoint[i] == 100: PName = r"""P = 100%""" if ReactivePowerSetpoint[j] == 40: QName = r"""Q = Max""" if ReactivePowerSetpoint[j] == -40:
file_name="WISF_1.05" # Initialize 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.plant_chng_3(500,0,_i,[ 1.05,_f]) psspy.plant_chng_3(1000,0,_i,[ 1.047,_f]) 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],[87, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f]) psspy.two_winding_chng_5(700,800,r"""1""",[_i,_i,_i,_i,_i,_i,_i,_i,800,_i,_i,1,_i,_i,_i],[_f,_f,_f, 1.0,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f],[_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f],r"""SS-TF-1""", r"""YNYN0""") psspy.machine_chng_2(500,r"""1""",[_i,_i,_i,_i,_i,_i],[_f,0.0,0,0,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f]) psspy.fnsl([0,0,0,1,0,0,99,0]) # convert load , do not change psspy.cong(0) psspy.bus_frequency_channel([1,1000],r"""System frequency""") ierr=psspy.machine_array_channel([2,4,500],r"""1""",r"""Inverter Terminal Voltage""") ierr=psspy.voltage_channel([3,-1,-1,800],r"""WISF PoC Voltage""") psspy.branch_p_and_q_channel([4,-1,-1,800,900],r"""1""",[r"""P Injection""",r"""Q Injection"""]) psspy.branch_p_and_q_channel([6,-1,-1,500,600],r"""1""",[r"""P Injection""",r"""Q Injection"""]) # ierr=psspy.machine_array_channel([6,2,500],r"""1""",r"""Pelec Inverter""") # ierr=psspy.machine_array_channel([7,3,500],r"""1""",r"""Qelec Inverter""") [ierr, var_ppc_conp] = psspy.mdlind(500, '1', 'EXC', 'CON')
file_name="WISF_1.05" # Initialize 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.plant_chng_3(500,0,_i,[ 1.05,_f]) psspy.plant_chng_3(1000,0,_i,[ 1.045,_f]) 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],[85, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f]) psspy.two_winding_chng_5(700,800,r"""1""",[_i,_i,_i,_i,_i,_i,_i,_i,800,_i,_i,1,_i,_i,_i],[_f,_f,_f, 1.0,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f],[_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f],r"""SS-TF-1""", r"""YNYN0""") psspy.machine_chng_2(500,r"""1""",[_i,_i,_i,_i,_i,_i],[_f, 0.0, 0.0, 0.0,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f,_f]) psspy.fnsl([0,0,0,1,0,0,99,0]) # convert load , do not change psspy.cong(0) psspy.bus_frequency_channel([1,1000],r"""System frequency""") ierr=psspy.machine_array_channel([2,4,500],r"""1""",r"""Inverter Terminal Voltage""") ierr=psspy.voltage_channel([3,-1,-1,800],r"""WISF PoC Voltage""") psspy.branch_p_and_q_channel([4,-1,-1,800,900],r"""1""",[r"""P Injection""",r"""Q Injection"""]) psspy.branch_p_and_q_channel([6,-1,-1,500,600],r"""1""",[r"""Pelec Inverter""",r"""Pelec Inverter"""]) # ierr=psspy.machine_array_channel([6,2,500],r"""1""",r"""Pelec Inverter""") # ierr=psspy.machine_array_channel([7,3,500],r"""1""",r"""Qelec Inverter""") [ierr, var_ppc_conp] = psspy.mdlind(500, '1', 'EXC', 'CON') [ierr, var_ppc_setp] = psspy.mdlind(500, '1', 'EXC', 'VAR')
file_name = "WISF_ADD" # Initialize 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.two_winding_chng_5( 700, 800, r"""1""", [_i, _i, _i, _i, _i, _i, _i, _i, 800, _i, _i, 1, _i, _i, _i], [ _f, _f, _f, 1.0, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f ], [_f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f], r"""WI_MAINTX1""", "") psspy.machine_data_2( 500, r"""1""", [_i, _i, _i, _i, _i, _i], [120, _f, _f, _f, 120, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f]) psspy.machine_chng_2( 500, r"""1""", [_i, _i, _i, _i, _i, _i], [_f, 0.0, 0.0, 0.0, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f]) psspy.plant_chng_3(500, 0, _i, [1.05, _f]) psspy.plant_chng_3(1000, 0, _i, [1.05, _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.""")
# convert load , do not change psspy.cong(0) psspy.conl(0, 1, 1, [0, 0], [100.0, 0.0, 0.0, 100.0]) psspy.conl(0, 1, 2, [0, 0], [100.0, 0.0, 0.0, 100.0]) psspy.conl(0, 1, 3, [0, 0], [100.0, 0.0, 0.0, 100.0]) psspy.ordr(0) # ! Order the matrix: ORDR psspy.fact() # ! Factorize the matrix: FACT psspy.tysl(0) # ! TYSL psspy.bus_frequency_channel([1, 969], r"""System frequency""") psspy.voltage_channel([2, -1, -1, 969], r"""IB_Voltage""") psspy.voltage_channel([3, -1, -1, 100], r"""UUT_Voltage""") psspy.voltage_channel([4, -1, -1, 106], r"""POC_Voltage""") psspy.machine_array_channel([5, 2, 100], r"""1""", r"""UUT_Pelec""") psspy.machine_array_channel([6, 3, 100], r"""1""", r"""UUT_Qelec""") psspy.branch_p_and_q_channel([7, -1, -1, 105, 106], r"""1""", [r"""POC_Flow""", ""]) psspy.machine_array_channel([9, 9, 100], r"""1""", r"""UUT_IDcmd""") psspy.machine_array_channel([10, 12, 100], r"""1""", r"""UUT_IQcmd""") psspy.machine_array_channel([11, 8, 100], r"""1""", r"""PPC_Pcmd""") psspy.machine_array_channel([12, 5, 100], r"""1""", r"""PPC_Qcmd""") # Run dynamic simulations psspy.strt_2([0, 0], OutputFilePath) psspy.run(0, 1.0, 1000, 5, 5) psspy.two_winding_chng_5(bus_flt, bus_IDTRF, r"""1""", realari4=1.10) psspy.run(0, 10.0, 1000, 5, 5) psspy.two_winding_chng_5(bus_flt, bus_IDTRF, r"""1""", realari4=0.90) psspy.run(0, 20.0, 1000, 5, 5) psspy.two_winding_chng_5(bus_flt, bus_IDTRF, r"""1""", realari4=1.00) psspy.run(0, 30.0, 1000, 5, 5)