overloop = 0 # add this line. P_BESS_max = 19 Capacitor = 0 # capacitor for temperature in [25, 50]: for terminalv in [0.9, 1.0, 1.1]: if temperature == 50: derate = 0.909 else: derate = 1.0 psspy.plant_chng_3(SMIB_bus_no, 0, _i, [terminalv, _f]) # the infinate bus number for P_Gen_1 in numpy.arange(0, S_1 * derate + 0.01, 2): psspy.read(0, GridInfoPath + file_name) psspy.plant_data_3(SMIB_bus_no, 0, _i, [terminalv, _f]) # ierr = psspy.fdns([1, 0, 0, 1, 1, 0, 99, 0]) P_BESS = P_Gen_1 / (S_1 * derate + 0.01) * P_BESS_max Q_Gen_1 = max( -50.16, -math.sqrt( max((S_1 * S_1 * derate * derate - P_Gen_1 * P_Gen_1), 0))) Q_Gen_BESS = max( -9.26, -math.sqrt( max(S_BESS * S_BESS * derate * derate - P_BESS * P_BESS, 0))) psspy.machine_chng_2(100, r"""1""", [_i, _i, _i, _i, _i, _i], [
file_name="SummerHi-20171219-153047-34-SystemNormal" if LoadScenario=="SummerLowLoad": file_name="SummerLowNormal-20161225-040047" if LoadScenario=="SimplifiedSystem": 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""")
Voltage_KV_Record = [[] for i in range(len(Bus_Num))] Voltage_PU_Record = [[] for i in range(len(Bus_Num))] P_Flow_Record = [[] for i in range(len(Power_Flow_Monitor_Start))] S_Flow_Record = [[] for i in range(len(Power_Flow_Monitor_Start))] Event_Name = [] P_setpoint = [ 0, 100, 50, 0 ] # CHANG: change this value according to your suggestion from 5.2.5.1 Reactive Power Capability Q_max_setpoint = [0, 40, 40, 40] # CHANG: sample : change this value according to your suggestion from 5.2.5.1 Reactive Power Capability Q_min_setpoint = [0, -40, -40, -40] # CHANG: sample :change this value according to your suggestion from 5.2.5.1 Reactive Power Capability InverterCapacity = 120 # CHANG: sample :change this value according to your suggestion from 5.2.5.1 Reactive Power Capability psspy.plant_chng_3(101, 0, 400, [_f, _f]) psspy.plant_chng_3(102, 0, 400, [_f, _f]) psspy.plant_chng_3(103, 0, 400, [_f, _f]) psspy.plant_chng_3(104, 0, 400, [_f, _f]) ###### standard power variation for i in range(0, len(P_setpoint)): psspy.read(0, GridInfoPath + FileName) ## psspy.dscn(20022) # eliminate negative power output by slack bus, does not need to consider outside NSW. psspy.machine_data_2(101, r"""1""", [_i, _i, _i, _i, _i, _i], [ P_setpoint[i], 0, Q_max_setpoint[i], Q_min_setpoint[i], InverterCapacity, 0, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f ]) psspy.machine_data_2(102, r"""1""", [_i, _i, _i, _i, _i, _i], [ P_setpoint[i], 0, Q_max_setpoint[i], Q_min_setpoint[i], InverterCapacity, 0, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f