psspy.bus_frequency_channel([1, 400], r"""System frequency""") psspy.voltage_channel([2, -1, -1, 101], r"""Inverter Voltage Mag.""") psspy.voltage_channel([3, -1, -1, 400], r"""NEOEN SF POC Voltage Mag.""") 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 101""") ierr = psspy.machine_array_channel([8, 3, 101], r"""1""", r"""Qelec 101""") ierr = psspy.machine_array_channel([9, 2, 102], r"""1""", r"""Pelec 102""") ierr = psspy.machine_array_channel([10, 3, 102], r"""1""", r"""Qelec 102""") ierr = psspy.machine_array_channel([11, 2, 103], r"""1""", r"""Pelec 103""") ierr = psspy.machine_array_channel([12, 3, 103], r"""1""", r"""Qelec 103""") ierr = psspy.machine_array_channel([13, 2, 104], r"""1""", r"""Pelec 104""") ierr = psspy.machine_array_channel([14, 3, 104], r"""1""", r"""Qelec 104""") #ierr = psspy.state_channel([15, var_inv_stt + 6], r"""Inverter Voltage Measurement""") psspy.var_channel([15, var_ppc_setp + 68], r"""Voltage Setpoint""") psspy.change_plmod_icon(101, r"""1""", r"""HWS2000""", 4, 1) # start simulation psspy.strt_2([0, 0], OutputFilePath) psspy.run(0, 5, 1000, 1, 0) psspy.change_var(var_ppc_setp + 68, 1.05) psspy.run(0, 25, 1000, 1, 0) psspy.change_var(var_ppc_setp + 68, 1.06) psspy.run(0, 45, 1000, 1, 0) psspy.change_var(var_ppc_setp + 68, 1.05) psspy.run(0, 65, 1000, 1, 0) psspy.change_var(var_ppc_setp + 68, 1.04) psspy.run(0, 85, 1000, 1, 0) psspy.change_var(var_ppc_setp + 68, 1.03) psspy.run(0, 105, 1000, 1, 0)
psspy.change_plmod_con(600, r"""1""", r"""SEXS""", 3, 50.0) psspy.change_plmod_con(600, r"""1""", r"""SEXS""", 4, 0.05) psspy.change_plmod_con(600, r"""1""", r"""SEXS""", 6, 2.5) psspy.change_plmod_con(600, r"""1""", r"""GENCLS""", 1, 0.9) psspy.change_plmod_con(600, r"""1""", r"""GENCLS""", 2, 1) psspy.change_plmod_con(101, r"""1""", r"""HWS2000""", 13, -0.3) psspy.change_plmod_con(101, r"""1""", r"""HWS2000""", 14, 0.5) psspy.change_plmod_con(102, r"""1""", r"""HWS2000""", 13, -0.3) psspy.change_plmod_con(102, r"""1""", r"""HWS2000""", 14, 0.5) psspy.change_plmod_con(103, r"""1""", r"""HWS2000""", 13, -0.3) psspy.change_plmod_con(103, r"""1""", r"""HWS2000""", 14, 0.5) psspy.change_plmod_con(104, r"""1""", r"""HWS2000""", 13, -0.3) psspy.change_plmod_con(104, r"""1""", r"""HWS2000""", 14, 0.5) psspy.change_plmod_con(101, r"""1""", r"""GPMPPC""", 10, 1.0) psspy.change_plmod_icon(101, r"""1""", r"""GPMPPC""", 4, 2) psspy.change_plmod_con(101, r"""1""", r"""GPMPPC""", 23, 0.001) psspy.change_plmod_con(101, r"""1""", r"""GPMPPC""", 24, 0.4) for t_var in range(1, 9000): psspy.change_var(t_var, 0) [ierr, var_ppc_conp] = psspy.mdlind(101, '1', 'EXC', 'CON') [ierr, var_ppc_setp] = psspy.mdlind(101, '1', 'EXC', 'VAR') [ierr, var_ppc_mode] = psspy.mdlind(101, '1', 'EXC', 'ICON') [ierr, var_inv_con] = psspy.mdlind(101, '1', 'GEN', 'CON') [ierr, var_inv_var] = psspy.mdlind(101, '1', 'GEN', 'VAR') [ierr, var_inv_stt] = psspy.mdlind(101, '1', 'GEN', 'STATE') psspy.bus_frequency_channel([1, 400], r"""System frequency""") psspy.voltage_channel([2, -1, -1, 101], r"""Inverter Voltage Mag.""") psspy.voltage_channel([3, -1, -1, 400], r"""WD SF POC Voltage Mag.""")
psspy.machine_array_channel([2, 4, 101], r"""1""", r"""Inverter Voltage Mag.""") psspy.voltage_channel([3, -1, -1, 400], r"""WD SF POC Voltage Mag.""") 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 101""") ierr = psspy.machine_array_channel([8, 3, 101], r"""1""", r"""Qelec 101""") psspy.cong(0) # psspy.conl(0, 1, 1, [0, 0], [0.0, 0.0, 0.1, 0.0]) # psspy.conl(0, 1, 2, [0, 0], [0.0, 0.0, 0.1, 0.0]) # psspy.conl(0, 1, 3, [0, 0], [0.0, 0.0, 0.1, 0.0]) psspy.ordr(1) psspy.fact() psspy.tysl(1) psspy.change_plmod_icon(101, r"""1""", r"""HWS2000""", 1, 0) psspy.change_plmod_icon(102, r"""1""", r"""HWS2000""", 1, 0) psspy.change_plmod_icon(103, r"""1""", r"""HWS2000""", 1, 0) psspy.change_plmod_icon(104, r"""1""", r"""HWS2000""", 1, 0) psspy.change_plmod_icon(101, r"""1""", r"""HWS2000""", 2, 0) psspy.change_plmod_icon(102, r"""1""", r"""HWS2000""", 2, 0) psspy.change_plmod_icon(103, r"""1""", r"""HWS2000""", 2, 0) psspy.change_plmod_icon(104, r"""1""", r"""HWS2000""", 2, 0) #psspy.change_plmod_icon(101,r"""1""",r"""GPMPPC""",4,0) # start simulation psspy.strt_2([0, 0], OutputFilePath) psspy.run(0, 1, 1000, 1, 0) psspy.load_data_3(600, r"""1""", [_i, _i, _i, _i, _i], [885, 20, _f, _f, _f, _f]) #0.08pu/s to -0.02pu psspy.run(0, 1.25, 1000, 1, 0) psspy.load_data_3(600, r"""1""", [_i, _i, _i, _i, _i],
# _f]) # be careful, partial active power = not enough solar irraidance. psspy.fdns([1, 0, 0, 1, 0, 0, 99, 0]) t_q = 0.569 # psspy.change_plmod_con(101, r"""1""", r"""GPMPPC""", 5, 0.6667) # psspy.change_plmod_con(101, r"""1""", r"""GPMPPC""", 5, -0.5) psspy.change_plmod_con(101, r"""1""", r"""HWS2000""", 13, -t_q) psspy.change_plmod_con(101, r"""1""", r"""HWS2000""", 14, t_q) psspy.change_plmod_con(102, r"""1""", r"""HWS2000""", 13, -t_q) psspy.change_plmod_con(102, r"""1""", r"""HWS2000""", 14, t_q) psspy.change_plmod_con(103, r"""1""", r"""HWS2000""", 13, -t_q) psspy.change_plmod_con(103, r"""1""", r"""HWS2000""", 14, t_q) psspy.change_plmod_con(104, r"""1""", r"""HWS2000""", 13, -t_q) psspy.change_plmod_con(104, r"""1""", r"""HWS2000""", 14, t_q) psspy.change_plmod_con(101, r"""1""", r"""GPMPPC""", 23, 0.001) # QV droop deadband psspy.change_plmod_con(101, r"""1""", r"""GPMPPC""", 24, 0.4) # QV droop psspy.change_plmod_icon(101, r"""1""", r"""GPMPPC""", 4, 2) # kVar control =0, PF control = 1, Droop Control = 2, Voltage Control = 3 psspy.change_plmod_con(101, r"""1""", r"""GPMPPC""", 10, 1.0) for t_var in range(0, 9000): psspy.change_var(t_var, 0) psspy.plmod_status(30531, r"""1""", 1, 0) psspy.plmod_status(30531, r"""1""", 6, 0) psspy.plmod_status(30531, r"""1""", 7, 0) psspy.plmod_status(37530, r"""1""", 1, 0) psspy.plmod_status(37530, r"""1""", 6, 0) psspy.plmod_status(37530, r"""1""", 7, 0) psspy.bus_frequency_channel([1, 400], r"""System frequency""") psspy.voltage_channel([2, -1, -1, 101], r"""Inverter Voltage Mag.""") psspy.voltage_channel([3, -1, -1, 400], r"""WDs SF POC Voltage Mag.""") psspy.branch_p_and_q_channel([4, -1, -1, 400, 46660], r"""1""", [r"""P Injection""", r"""Q Injection"""]) psspy.branch_p_and_q_channel([7, -1, -1, 101, 111], r"""1""", [r"""Pelec 101""", r"""Qelec 101"""])
psspy.conl(1, 0, 2, [0, 0], [100.0, 0.0, 0.0, 100.0]) psspy.conl(0, 1, 2, [0, 0], [100.0, 0.0, -306.02, 303.0]) psspy.conl(0, 1, 3, [0, 0], [100.0, 0.0, -306.02, 303.0]) psspy.ordr(0) psspy.fact() psspy.tysl(0) psspy.bsys(0, 0, [0.4, 500.], 0, [], 0, [], 0, [], 0, []) # psspy.plmod_status(500,r"""1""",6,0) # psspy.plmod_status(500,r"""1""",3,0) # psspy.change_plmod_con(500,r"""1""",r"""GPMPPC""",26, 0.85) # psspy.change_plmod_con(500,r"""1""",r"""GPMPPC""",27, 1.15) # psspy.change_plmod_icon(500,r"""1""",r"""HWS2000""",2,1) # disable PF function of the inverter # psspy.plmod_status(500,r"""1""",6,0) # disable PPC psspy.change_plmod_icon(500, r"""1""", r"""HWS2000""", 1, 0) psspy.change_plmod_icon(500, r"""1""", r"""HWS2000""", 2, 0) psspy.change_plmod_con(500, r"""1""", r"""GPMPPC""", 16, 6) psspy.change_plmod_con(500, r"""1""", r"""GPMPPC""", 17, 6) psspy.change_plmod_con(500, r"""1""", r"""GPMPPC""", 33, 50.15) psspy.change_plmod_con(500, r"""1""", r"""GPMPPC""", 34, 52.0) psspy.change_plmod_con(500, r"""1""", r"""GPMPPC""", 35, 50.2) psspy.change_plmod_con(500, r"""1""", r"""GPMPPC""", 36, 20.0) psspy.change_plmod_con(500, r"""1""", r"""GPMPPC""", 37, 49.85) psspy.change_plmod_con(500, r"""1""", r"""GPMPPC""", 38, 47.0) psspy.change_plmod_icon(500, r"""1""", r"""GPMPPC""", 8, 1) psspy.change_plmod_icon(500, r"""1""", r"""GPMPPC""", 9, 1) # this is for the votlage control psspy.change_plmod_icon(500, r"""1""", r"""GPMPPC""", 1, 20) #ori=5 psspy.change_plmod_icon(500, r"""1""", r"""GPMPPC""", 2, 20) #ori=5 psspy.change_plmod_icon(500, r"""1""", r"""GPMPPC""", 3, 50) #ori=5
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.change_plmod_icon(500, r"""1""", r"""GPMPPC""", 1, 20) #ori=5 psspy.change_plmod_icon(500, r"""1""", r"""GPMPPC""", 2, 20) #ori=5 psspy.change_plmod_icon(500, r"""1""", r"""GPMPPC""", 3, 50) #ori=5 psspy.change_plmod_icon(500, r"""1""", r"""GPMPPC""", 4, 2) #ori=3 psspy.change_plmod_con(500, r"""1""", r"""GPMPPC""", 23, 0.003) #ori=0.003 psspy.change_plmod_con(500, r"""1""", r"""GPMPPC""", 24, 0.5) # droop ori=5% psspy.change_plmod_con(500, r"""1""", r"""GPMPPC""", 2, 0.02) # proportional gain ori=0.001 psspy.change_plmod_con(500, r"""1""", r"""GPMPPC""", 3, 0.25) # integral gain ori=0.15 psspy.change_plmod_con(500, r"""1""", r"""GPMPPC""", 5, 0.5) #PPC reactive power UB #ori=1 psspy.change_plmod_con(500, r"""1""", r"""GPMPPC""", 6, -0.3) #PPC reactive power LB #ori=1 # psspy.change_plmod_con(500,r"""1""",r"""GPMPPC""",7, 0.01) ##ramp up
psspy.resq(GridInfoPath + file_name + ".seq") # psspy.addmodellibrary(GridInfoPath+'dsusr.dll') 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.addmodellibrary(GridInfoPath+'GEWTG34.dll') # psspy.addmodellibrary(GridInfoPath+'SMAPPC_B111_34_IVF111.dll') # psspy.addmodellibrary(GridInfoPath+'SMASC_C135_34_IVF111.dll') psspy.dyre_new([1, 1, 1, 1], GridInfoPath + file_name + ".dyr", "", "", "") 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(Disturbance_Load_Amount)): # re - initialize psspy.read(0, GridInfoPath + file_name + ".raw") psspy.dyre_new([1, 1, 1, 1], GridInfoPath + file_name + ".dyr", "", "", "") psspy.change_plmod_icon(101, r"""1""", r"""HWS2000""", 1, 2) psspy.change_plmod_icon(102, r"""1""", r"""HWS2000""", 1, 2) psspy.change_plmod_icon(103, r"""1""", r"""HWS2000""", 1, 2) psspy.change_plmod_icon(104, r"""1""", r"""HWS2000""", 1, 2) psspy.change_plmod_con(101, r"""1""", r"""GPMPPC""", 10, 0.45) psspy.change_plmod_icon(101, r"""1""", r"""GPMPPC""", 4, 3) psspy.change_plmod_icon(101, r"""1""", r"""GPMPPC""", 8, 1) psspy.add_plant_model(600, r"""1""", 6, r"""SEXS""", 0, "", 0, [], [], 6, [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]) psspy.change_plmod_con(600, r"""1""", r"""SEXS""", 1, 0.1) psspy.change_plmod_con(600, r"""1""", r"""SEXS""", 2, 10.0) psspy.change_plmod_con(600, r"""1""", r"""SEXS""", 3, 100.0) psspy.change_plmod_con(600, r"""1""", r"""SEXS""", 4, 0.1) psspy.change_plmod_con(600, r"""1""", r"""SEXS""", 5, -10.0) psspy.change_plmod_con(600, r"""1""", r"""SEXS""", 6, 10.0) psspy.change_plmod_con(600, r"""1""", r"""GENCLS""", 1, 0.5) psspy.change_plmod_con(600, r"""1""", r"""GENCLS""", 2, 0.1)