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.""") psspy.branch_p_and_q_channel([4, -1, -1, 800, 900], 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""")
psspy.resq(GridInfoPath + file_name + ".seq") psspy.dyre_new([1, 1, 1, 1], GridInfoPath + file_name + ".dyr", "", "", "") psspy.machine_data_2(101, r"""1""", [_i, _i, _i, _i, _i, _i], [ ActivePowerSetpoint[test_no] * S, _f, _f, _f, 100, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f ]) psspy.machine_data_2(101, r"""1""", [_i, _i, _i, _i, _i, _i], [ _f, _f, ReactivePowerSetpoint[test_no] * S, _f, 100, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f ]) psspy.machine_data_2(101, r"""1""", [_i, _i, _i, _i, _i, _i], [ _f, _f, _f, ReactivePowerSetpoint[test_no] * S, 100, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f ]) psspy.dynamics_solution_param_2([_i, _i, _i, _i, _i, _i, _i, _i], [ acc_factor[test_no], _f, 0.001 * step_size[test_no], 0.004, _f, _f, _f, _f ]) ## calculate impedance for POC and fault z_g[test_no] = 1 / SCR_31_60[test_no] # grid impedance r_g[test_no] = sqrt(z_g[test_no]**2 / (GXR_31_60[test_no]**2 + 1)) #grid r x_g[test_no] = GXR_31_60[test_no] * r_g[test_no] #grid_x z_f[test_no] = d * z_g[test_no] * u_dip / (1 - u_dip) r_f[test_no] = sqrt(z_f[test_no]**2 / 10) x_f[test_no] = 3 * r_f[test_no] psspy.branch_chng_3( 400, 46660, r"""1""", [_i, _i, _i, _i, _i, _i], [r_g[test_no], x_g[test_no], _f, _f, _f, _f, _f, _f, _f, _f, _f, _f], [_f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f, _f], "") psspy.fdns([1, 0, 0, 1, 1, 1, 0, 0]) psspy.bus_frequency_channel([1, 400], r"""System frequency""") # psspy.voltage_channel([2, -1, -1, 101], r"""Inverter Voltage Mag.""")
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 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.branch_p_channel([-1, -1, -1, 39, 9], r"""1""", "") psspy.branch_mva_channel([-1, -1, -1, 5, 8], r"""1""", "") psspy.branch_mva_channel([-1, -1, -1, 6, 5], r"""1""", "") psspy.branch_mva_channel([-1, -1, -1, 4, 5], r"""1""", "") psspy.load_array_channel([-1, 1, 71], r"""1""", "") psspy.load_array_channel([-1, 2, 71], r"""1""", "") psspy.load_array_channel([-1, 1, 8], r"""1""", "") psspy.load_array_channel([-1, 2, 8], r"""1""", "") psspy.chsb(0, 1, [-1, -1, -1, 1, 5, 0]) psspy.chsb(0, 1, [-1, -1, -1, 1, 27, 0]) psspy.strt(0, out_file) # Run simulation DELTA = 0.005 psspy.dynamics_solution_param_2(realar3=DELTA) # set sample time, DELTA sec. # Simulation Procedure ##1. System initialization and run simulation to t = 1 s. psspy.run(0, 1, 0, 0, 0) ##2. Apply 3-phase fault at line B6 – B7 at t = 1s. psspy.dist_branch_fault(6, 7, '1', 3, 0.0, [75.625e-5, 0]) ##3. Continue simulation to t = 1.1s. psspy.run(0, 1.1, 0, 0, 0) ##4. Trip line B6 – B7 and clear fault at t = 1.1s. psspy.dist_clear_fault() psspy.dist_branch_trip(6, 7, '1') ##5. Continue simulation to t = 6.1s. psspy.run(0, 6.1, 0, 0, 0) ##6. Reschedule generator with run-up M1 from 250 MW to 500 MW and run-down M2 from about 573 MW to 300 MW, and trip load at B7 at t = 6.1s at t = 6.1s