# Is it possible to change generator and load values in dynamic simulation?

for example in IEEE 39 dynamic simulation G1=100MW at t=0s load in bus 3 is 75MW and then G1=150MW at t=0.5s load in bus 3 changes to 75MW and then G1 return to 100MW at t=1s load in bus 3 changes to 20MW print the dynamic curves for G1

edit retag close merge delete

Sort by » oldest newest most voted

The output from the generator is determined by the turbine power (PMECH). The variable PMECH(MC) may be updated by code in CONEC subroutine during a simulation but that needs some Fortran code and a compiler.

Instead I propose that governor model IEESGO is used for update of PMECH as you wish during the simulation. With the parameters I have chosen below the model will instantaneously update PMECH after changes to GREF. The script is adapted to savnw test case, but the concept can be used for any case.

psspy.case('savnw.sav')
psspy.rstr('savnw.snp')
psspy.cong(0)
psspy.conl(0,1,1,[0,0],[ 80.0,0.0, 20.0, 80.0])
psspy.conl(0,1,2,[0,0],[ 80.0,0.0, 20.0, 80.0])
psspy.conl(0,1,3,[0,0],[ 80.0,0.0, 20.0, 80.0])
ibus = 3011
gid = '1'
dp = 50.  # MW change for generator
ierr, mbase = psspy.macdat(ibus, gid, 'MBASE')
# add dummy governor without droop and time constants
psspy.machine_array_channel([-1,6,ibus],gid,"")

ierr = psspy.strt(0, 'test1.out')
psspy.run(0, 0.5,0,1,0)
psspy.increment_gref(ibus,gid, dp/mbase)
psspy.run(0, 1.0,0,1,0)
psspy.increment_gref(ibus,gid,-dp/mbase)
psspy.run(0, 2.0,0,1,0)


The following Figure shows how PMECH for the studied generator is updated during the simulation.

PMECH is always in pu generator base (Mbase=1000). The turbine power is here temporarily increased with 50 MW (50/1000=0.05 pu) at t=0.5 s and reset again at t=1 s.

EDIT:

Since the post is revived, I can improve by showing the block diagram of IEESGO:

With the selected parameter all blocks except the limiter block are ignored. Speed input signal is blocked and the output PMECH only depends on Po and Pmax and Pmin. Those limits are set to 1 and 0 in the script above. Note, set Pmin negative if you want to set negative PMECH.

PMECH will immediately follow Po with no time delay. Any number of step changes can be made on PMECH during the simulation using API increment_gref or change_gref.

It is thereby very easy to manually update the turbine power of a generator using this governor model and parameters.

more

( 2019-01-25 01:34:42 -0500 )edit

The annotated diagram really helps to understand!

( 2021-12-12 18:38:13 -0500 )edit

You can use machine_chng_2 to change machine data, and load_chng_4 for load changes during dynamic simulations for PSS/E 33 at least.

more

Thanks ,but I have used function machine_chng_2, it could only change the power flow data. It could not make any changes in the dynamic simultaion

( 2015-12-18 00:46:17 -0500 )edit

Did you get some error? Are you using the PSS/E 33? I have used load_chng_4 successfully myself in my own dynamic script.

( 2015-12-18 00:51:02 -0500 )edit

I use PSSE 33 too,and the function load_chng_4 is useful but it could only change load data.I mean the function machine_chng_2 could not change the machine output power in dynamic simulation

( 2015-12-18 01:57:34 -0500 )edit

Thanks for the clarification. I'm not 100% sure, but this sounds like the dynamics data controls the power output, and you'd have to use the change_var or such methods. In order to do that, you'd need to first check which dynamics models your system is using and consult MODELS.pdf.

( 2015-12-18 02:08:06 -0500 )edit

No,I just simply use psspy.read psspy.dyre_new and psspy.dynamics_solution_param_2 and psspy.strt and psspy.run I could not copy my hold code here because the 300 characters limit, could you please leave your email so I could send my code to you. Thanks

( 2015-12-18 02:23:15 -0500 )edit

The below code snippet has been made as per the details of the original question.

Note 0: The method for changing the real power generation in dynamic simulation is based on @peroflofl 's answer.

Note 1: psspy.scal2 works fine for dynamic simulation as far as load increments are concerned. It however, does not change the dynamic generation values for me. So in such a case @peroflofl's code does the job. I have added a slightly modified version of his code into this snippet.

Note 2: Any slashes in the command below ' \ ' are used to split the command in multiple lines in Python2

# Housekeeping code before running the simulation for efficient changing of loads and generations.
genBus = 1
subsystemNum = 1
ierr = psspy.bsyso(subsystemNum, loadBus) #Adding Bus 3 to Subsystem 1. It is assumed that a subsystem identified by that number has not been created.
ierr, mbase1 = psspy.macdat(genBus, '1', 'MBASE')
# add dummy governor without droop and time constants to Bus 1
psspy.add_plant_model(genBus, '1', 7, r"""IEESGO""", 0, "", 0, [], [], 11, \
[0.0,0.0,0.05,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0])
psspy.machine_array_channel([-1,6, genBus], '1' ,"")

ierr = psspy.strt(0, 'ieee39_outfile.out')
psspy.run(0, 0.5, 0, 1, 0) #It is assumed that your initial values of Bus 1 generation and Bus 3 load are already set

changeType = 1 # Parameter for psspy.scal_2. Use 2 for Percent change and 3 for Incremental change. I've used 1 since you need to specify a new value.

ierr, totals, moto = psspy.scal_2(subsystemNum, 1, 0, \
[psspy._i, 2, 0, 1, 0], \
[loadChange, changeType, 0.0, 0.0, 0.0, -0.0, 0.0]) # Now Bus 3 PLoad is 75 MW.

genChange = 100 # New generation should be 100 MW
psspy.increment_gref(genBus, '1',genChange/mbase1) # Now Bus 1 PGen is 100 MW.

psspy.run(0, 1.0, 0, 1, 0) # Run till 1.0 s

ierr, totals, moto = psspy.scal_2(subsystemNum, 1, 0, \
[psspy._i, 2, 0, 1, 0], \
[loadChange, changeType, 0.0, 0.0, 0.0, -0.0, 0.0]) # Now Bus 3 PLoad is 20 MW.

psspy.run(0, 2.0, 0, 1, 0) # Run till 2.0 s


Assuming you are using dyntools.CHNF to record the dynamic simulation state variable values, you may then plot POWR 1 [BUS 1 BasKV_val]1 values from the .xlsx file using your preferred progarmming software.

more

informative

more

May be you can make a workaround by creating an artificial generator that is not actually there in reality but will serve you to make changes in load? If the simplifications of this artificial generator are o.k. with you may be it is a good compromise. You will disconnect this generator at times when the load needs to increase and you will increase the governor reference (Pmech power) mechanical power of this generator when your load needs to decrease.

more

i am trying to find ways to change generator output values using PSAS, however load changes can be done using ALTER command...

more

You can use govnernor model IEESGO as I describe above and change the setpoint in PSAS with SET VAR n to r, where n is the VAR number for the model.

( 2022-03-07 06:34:51 -0500 )edit