Knowledge Base

Moving and Combining Generators and Comparing Power Flows

Auxiliary File: Move-Combine.aux
PowerWorld Case: B7OPF.pwb
PowerWorld Oneline: B7OPF.pwd
Output Files: none

(Right-click on the above files and select Save Target As to save them to your computer.)

In this example we will use a script to combine and move generators in a seven-bus case. We will solve the power flow, move and combine some generators, re-solve the power flow, and then look at a difference flow to see how our changes in generation have affected the power flow.

The auxiliary file contains five script sections:

The Before script solves the power flow and sets the solution as the base case.
The CombineGenerators script creates a second generator at bus 4 using the CreateData command, and then combines the two generators at bus 4 into one generator.
The MoveGenerator script moves the generator from bus 4 to bus 7.
The EnforceLimits script makes sure that the output limits are enforced for all generators in the system.
The After script solves the power flow, and then sets the DiffFlowMode to difference so that the difference case is displayed. Looking at the oneline after running all of these scripts we can see how combing the two generators at bus 4 and then moving the combined generator to bus 7 affects the power flow.
Move-Combine.aux:

//This script adds a new generator, combines it with an
//existing generator, moves another generator, and then
//shows the change in the power flow.SCRIPT Before
{
//First we will run the power flow to set a base case.
//We must be in PowerFlow mode.
EnterMode(PowerFlow);
//Solve the power flow.
SolvePowerFlow;
//Set the current system state as the base case.
//Later we will use difference flows to compare the changed //system with the base case.
DiffFlowSetAsBase;
}SCRIPT CombineGenerators
{
//First we will create a new generator at bus 4.
//Then we will combine the new generator with
//the existing one.
//To do this we must be in Edit mode.
EnterMode(Edit);
//Create the new generator using the CreateData command.
//If we were creating several generators we would make
//a separate data section. CreateData is good for one though.
//These are the arguments in CreateData:
//CreateData(Obejct, [List of fields], [list of values])
//The CreateData command is too long for one line.
//This is not a problem – just continue on the next line.
CreateData(GEN, [BusNum, GenID, GENMWMax, GENAGCAble, GenEnforceMWLimits],[4, 2, 35, “YES”, “YES”]);
//Combine the old generator at bus 4 with the new one.
//Combine([object to move] [object to combine with]);
//In the brackets: [Object Bus number Object ID] Combine([GEN 4 1], [GEN 4 2]);
}SCRIPT MoveGenerator
{
//Move the (newly combined) generator from bus 4 to bus 7
//Enter the Edit mode
EnterMode(Edit);
//Move([object to move] [where to move it]);
//In the brackets: [Object Bus number Object ID] //and [Bus number Object ID] Move([GEN 4 2], [7 2]);
}SCRIPT EnforceLimits
{
//Make sure the MW limits are enforced for all generators
//Enter the Edit mode.
Entermode(Edit);
//Select all the generators
SelectAll(GEN);
//Set the EnforceMWLimits? To Yes for all the selected
//generators
SetData(GEN, [GenEnforceMWLimits], [“YES”], SELECTED);
//Unselect the generators
UnSelectAll(GEN);
}

SCRIPT After
{
//Solve the power flow, look at the difference case.
//Enter the PowerFlow mode.
EnterMode(PowerFlow);
//Solve the Power Flow.
SolvePowerFlow;
//Look at the difference flow case to see how moving the
//generators has changed the power flow in comparison to
//the base case.
DiffFlowMode(DIFFERENCE);
}

Tags: ,,,

June 29, 2012