InterPSS-Project / ipss-plugin

InterPSS plugin projects
8 stars 11 forks source link

'The bus for createFunctionLoad is not a ZIP load bus' in ipss.sample #33

Open thakars opened 4 years ago

thakars commented 4 years ago

Hello everyone,

I was trying to run 'SampleLoadFlow.java' from the package 'org.interpss.sample.aclf'. In the main function, lines simpleLoadflow(msg); and simpleLoadflowPSSL(msg);, but loadflowWithAdjustment(msg); gives the following error:

com.interpss.common.exp.InterpssException: The bus for createFunctionLoad is not a ZIP load bus at com.interpss.CoreObjectFactory.createFunctionLoad(CoreObjectFactory.java:741) at org.interpss.sample.aclf.SampleLoadflow.loadflowWithAdjustment(SampleLoadflow.java:187) at org.interpss.sample.aclf.SampleLoadflow.main(SampleLoadflow.java:68)

It seems that this happens because when running loadflowWithAdjustment(msg), it first calls setSimpleLoadflowDataByPSSL(net, msg) to create the network object, and in that function (in line number 160) sets loadcode for bus2 as CONST_P. Since this function is also called in simpleLoadflowPSSL(msg), we may not want to change the load code inside the function. In such case, adding a line bus2.setLoadCode(AclfLoadCode.ZIP); before the try-catch of lines 181-190 seemed to solve the issue (at least as a quick fix - I don't know if CoreObjectFactory.createFunctionLoad(bus2) is supposed to change the bus load code if it is not ZIP).

Thanks!