Example #1
0
from java.util.logging                import Level;

from com.interpss.common.util         import IpssLogger;
from com.interpss.pssl.simu           import IpssAclf, IpssPTrading;
from com.interpss.pssl.plugin         import IpssAdapter;

from com.interpss.core.dclf           import SenAnalysisType;

dir(IpssAclf);

# set log level

IpssAclf.setLogLevel(Level.WARNING);

# load a data in IEEE common format and create an AclfNetwork object

aclfNet = IpssAdapter.importAclfNet("sampleData/ieee14.ieee")  \
			.setFormat(IpssAdapter.FileFormat.IEEECommonFormat)    \
			.load();

# create a DClfAlgorithm and perform sensitivity analysis for the injection
# and withdraw buses.			

dclfAlgo = IpssPTrading.createDclfAlgorithm(aclfNet)           \
			.setSenAnalysisType(SenAnalysisType.PANGLE)        \
			.setInjectionBusNo(2).withdrawBusNo(14)            \
			.runSenAnalysis();			
			
# output PTDF for the branch No2->No14			

print "Power Transfer Distribution Factor: ",                  \
Example #2
0
from com.interpss.pssl.simu           import IpssAclf;
from com.interpss.pssl.plugin         import IpssAdapter;
from com.interpss.pssl.plugin         import IpssUtil;

from com.interpss.common.datatype    import UnitType;
from com.interpss.core.algorithm     import AclfMethod;

aclfNet = IpssAdapter.importAclfNet("sampleData/ieee14.ieee")  \
			.setFormat(IpssAdapter.FileFormat.Custom)              \
			.setClassname("org.interpss.custom.exchange.FileAdapter_IeeeCommonFormat") \
			.load();
 				
IpssAclf.createLoadflowAlgorithm(aclfNet)           \
  			.setLfMethod(AclfMethod.NR)             \
  			.setTolerance(0.0001, UnitType.PU)      \
  			.runLoadflow(); 				
  			
print IpssUtil.outputAclfNet(aclfNet)                 \
            .setFormat(IpssUtil.AclfOutFormat.IEEEBusStype)  \
            .toString();

Example #3
0
from com.interpss.pssl.simu              import IpssAclf;
from com.interpss.pssl.plugin            import IpssUtil;

from com.interpss.common.datatype        import UnitType;
from org.apache.commons.math.complex     import Complex;
from com.interpss.core.aclf              import AclfGenCode, AclfLoadCode, AclfBranchCode;
from com.interpss.core.algorithm         import AclfMethod;

aclfNet = IpssAclf.createAclfNetwork("Sample AclfNetwork")       \
            .setBaseKva(100000.0)                                \
            .getAclfNet(); 

IpssAclf.addAclfBus("Bus1", "name-Bus 1", aclfNet)               \
            .setBaseVoltage(4000.0)                              \
            .setGenCode(AclfGenCode.SWING)                       \
            .setVoltageSpec(1.0, UnitType.PU, 0.0, UnitType.Deg);
  		
IpssAclf.addAclfBus("Bus2", "name-Bus 2", aclfNet)               \
  			.setBaseVoltage(4000.0)                              \
  			.setLoadCode(AclfLoadCode.CONST_P)                   \
  			.setLoad(Complex(1.0, 0.8), UnitType.PU);
  		
IpssAclf.addAclfBranch("Bus1", "Bus2", aclfNet)                  \
			.setBranchCode(AclfBranchCode.LINE)                  \
			.setZ(Complex(0.05, 0.1), UnitType.PU);        
				
IpssAclf.createLoadflowAlgorithm(aclfNet)                        \
  			.setLfMethod(AclfMethod.NR)                          \
  			.setTolerance(0.0001, UnitType.PU)                   \
  			.runLoadflow();