public class ACPowerCalc
extends java.lang.Object
Constructor and Description |
---|
ACPowerCalc(PAModel model,
java.util.Collection<FixedShuntListIfc<? extends FixedShunt>> shInSvc,
Active1TData actvLoads,
Active1TData actvGens)
Constructs a new calculator object allowing overrides for injections.
|
ACPowerCalc(PAModel model,
float sbase)
Constructs a new calculator object from an entire model.
|
Modifier and Type | Method and Description |
---|---|
void |
applyMismatch(float[] pmm,
float[] qmm)
Calculate mismatches on each bus, and apply to provided mismatch objects
|
void |
calc(float[] vm,
float[] va)
Calculate flows and fixed shunts
|
java.util.List<ACBranchFlows> |
getBranchFlows()
return AC Branch calculator (one for each branch type in PAModel)
|
java.util.List<FixedShuntCalcList> |
getFixedShuntCalc()
return fixed shunt calculator (one for each list PAModel)
|
SVCList |
getPvSvcList()
Get the set of SVC's with no slope defined.
|
SVCCalcList |
getSVCCalc()
return SVC calculator for SVC's modeled with positive slope
|
static void |
main(java.lang.String... args)
Provide a main routine for testing and command-line to report branch
flows and mismatches
|
static Active1TData |
setupActiveGens(PAModel model,
float sbase)
Review the model for generats that are in-service and turning.
|
static Active1TData |
setupActiveLoads(PAModel model,
float sbase)
Provide a standard interface to retrieve desired active and reactive
power
|
static java.util.Collection<FixedShuntListIfc<? extends FixedShunt>> |
setupFixedShunts(PAModel model)
Review the model for fixed shunts that are in-service
|
void |
updateResults()
Update current results back into the OpenPA lists
|
public ACPowerCalc(PAModel model, float sbase) throws PAModelException
model
- Power System modelbri
- system bus topologyPAModelException
public ACPowerCalc(PAModel model, java.util.Collection<FixedShuntListIfc<? extends FixedShunt>> shInSvc, Active1TData actvLoads, Active1TData actvGens) throws PAModelException
Constructs a new calculator object allowing overrides for injections.
For example, injections from generators might normally be taken from case data Gen.getP and Gen.getQ, but during a power flow, we might want the active power to be from a setpoint Gen.getPS, and not the case.
model
- Current working power modelbri
- Utility class to help manage different topologiesshInSvc
- In-service shuntsactvLoads
- In-service loadsactvGens
- Generators that are in-service and runningPAModelException
public static Active1TData setupActiveLoads(PAModel model, float sbase) throws PAModelException
model
- Current working power modelsbase
- system basePAModelException
public static Active1TData setupActiveGens(PAModel model, float sbase) throws PAModelException
bri
- Utility to help manage different topologiesmodel
- Current working power modelsbase
- system basePAModelException
public static java.util.Collection<FixedShuntListIfc<? extends FixedShunt>> setupFixedShunts(PAModel model) throws PAModelException
model
- Current working power modelPAModelException
public java.util.List<FixedShuntCalcList> getFixedShuntCalc()
public java.util.List<ACBranchFlows> getBranchFlows()
public SVCCalcList getSVCCalc()
public SVCList getPvSvcList() throws PAModelException
PAModelException
public void calc(float[] vm, float[] va) throws PAModelException
vm
- Voltage magnitude, per-unit on bus base KVva
- Voltage angle, radiansPAModelException
public void applyMismatch(float[] pmm, float[] qmm) throws PAModelException
pmm
- active power bus mismatchesqmm
- reactive power bus mismatchesPAModelException
public void updateResults() throws PAModelException
PAModelException
public static void main(java.lang.String... args) throws java.lang.Exception
Provide a main routine for testing and command-line to report branch flows and mismatches
The intent of user-defined topology is to allow topological groupings to be consistent when comparing external case data. This use case is specialized
For example, some external tools allow zero-impedance branches to be merged during a solution. However, the cutoff or other algorithm parameters may not clear, and any differences throw off the mismatches. To account for this, if a mapping of source-bus to merged-bus is available, then it can be used to compare values with a consistent topology.
To use this option, the --topologyparameter must specify UserDefined, and a CSV file with the mapping must be provided using the --userdeftop parameter. The CSV file must contain a column named "ID" that has the bus number for every bus in the system, and a "MappedBus" column that provides the mapping.
For example, A 5-bus system might have 2 user-defined topological nodes (at buses 2 and 4), the lists would look like:
ID | MappedBus |
---|---|
1 | 2 |
2 | 2 |
3 | 4 |
4 | 4 |
5 | 4 |
args
-
--uri | Resource identifier for source data |
--outdir | Location of output directory for results. This class generates a file named branches.csv by default for the branch flows, and mismatches.csv if that option is selected |
--topology |
|
--userdeftop | Path to a CSV file that provides the bus-to-topological group mapping. See detail and example in method description. |
--mismatches | Report mismatch and every flow & injection at every bus |
java.lang.Exception