In transient stability simulation, you may want to define a dynamic source or load, where source/load injection current into the network is a function of bus voltage and time
I = f(V, t)
The function could be a set of differential and/or algebraic equations. Dynamic Bus Device will give you a generic way to script such a function. It could be used to model dynamic load including motors, SVC, FACTS or complex generation station dynamics.
In the above figure, a bus object and time t is passed to a generic function f to calculate bus injection current during the transient stability simulation process.
To script a Dynamic Bus Device, you need to implement the ScriptDynamicBusDevice (JavaAPI) interface. You can extend the ScriptDynamicBusDeviceImpl (JavaAPI) class, which provides some default implementations of the interface. Specifically, you need to override the following methods of the interface to tell InterPSS how your device behaves:
In this example, load at a bus (2.0+j1.0) is modeled as Dynamic Bus Device injection current. Half of the load is modeled as a bus Z and the other half is modeled as an injection current.
public class <classname> extends ScriptDynamicBusDeviceImpl {
private Complex z1;
public boolean initStates(DStabBus abus, Network net, IPSSMsgHub msg) {
super.initStates(abus, net, msg);
// the total load on the bus is 2.0+j1.0 pu, half is treated as static load
// the other half is model as a Bus Device
Complex load = new Complex(1.0, 0.5);
Complex cload = load.conjugate();
this.z1 = ComplexFunc.div(abus.getVoltageMag()*abus.getVoltageMag(), cload);
abus.setZ1(z1);
return true;
}
public boolean nextStep(double dt, DynamicSimuMethods method, Network net, IPSSMsgHub msg) {
// do nothing
return true;
}
public Object getOutputObject() {
// half of the load is treated as an injection current
Complex i = getDStabBus().getVoltage().divide(this.z1);
return new Complex(-i.getReal(), -i.getImaginary());
}
public Hashtable getStates(Object refMach) {
DStabBus abus = getDStabBus();
Hashtable<String, Double> hashtable = new java.util.Hashtable<String, Double>();
hashtable.put("Bus Voltage Msg", new Double(abus.getVoltageMag()));
double refAngle = 0.0;
if (refMach != null) {
refAngle = ((Machine)refMach).getAngle();
}
hashtable.put("Bus Voltage Ang (deg)", new Double((abus.getVoltageAng()-refAngle)*Constants.RtoD));
return hashtable;
}
public boolean updateAttributes(boolean netChange) {
return true;
}
}
Please see the sample - workspace/Scripting/BusScripting-5Bus.ipss for more details. In real life, you may not want to model a constant-Z load in this way. This example is only for illustration purpose.
InterPSS has an implementation of IEEE standard machine models. For each machine, you can attach an exciter, a governor and a stabilizer. InterPSS exciter, governor and stabilizer are plugins. You can develop your own controllers. We think this will cover most common use cases.
However, there are situations that the One Bus <-> One Machine <-> One Exciter <-> One Governor <-> One stabilizer model may not be enough to solve certain very complex problem. You may need a generic composite model, as outline in the following diagram:
InterPSS scripting is one possible way to solve the complex problem.
Machine Scripting Examples
You can write you own machine models by scripting. In the InterPSS distribution, there are samples to write custom machine swing equations and Park's equations under the project folder MachineScripting in the Sample Workspace.