Python utilitrate3 call input error

8 posts / 0 new
Last post
gex
Python utilitrate3 call input error

We ran into this error:
utilityrate V3 simulation error
: exec fail(utilityrate3): invalid number of gen records (350): must be an integer multiple of 8760
Utility mod failed

We made sure gen and load are set as arrays of 8760
print(len(ssc.data_get_array(data2,'load')))
print(len(ssc.data_get_array(data2,'gen')))
print(len(ssc.data_get_array(data2,'degradation')))
8760
8760
1
if run_utilityrate3(ssc,data2):
elec_cost_with_system = self.sscapi.data_get_number("gen")
else:
print("Utility mod failed")

Can you tell us what can possibly wrong? Or is there anyway that we can take a look at the section C code that returns the error?
Thank you so much for your help!
Xiaolin Ge

Paul Gilman

Dear Xiaolin,

It's hard for me to tell what's wrong from the code you provided.

Did you use SAM's code generator to create the initial code? That is a good way to make sure all of the input variables are assigned valid values.

The source code for the utilityrate3 module is available in the SAM GitHub repository:

https://github.com/NREL/ssc/blob/develop/ssc/cmod_utilityrate3.cpp

Note that SAM 2017.9.5 uses utilityrate5.

Best regards,
Paul.

gex

Thank you, Paul! I was able to pass that error using the source code.

Could you please point a link to me on how to use Python SAM code generator?

Best regards,
Xiaolin

Paul Gilman

Dear Xiaolin,

Here is a link to one of the posts on the code generator:

https://sam.nrel.gov/node/75313

Best regards,
Paul.

gex

How do I start "SAM 2017.9.5"(to use the code generator)? Is there an URL? I can only start SSC SDKTool. Sorry for being un-knowledgeable.

gex

Please ignore my question above. I got it. Thank you so much!

SOMAYEH

Hello I'm new to SAM. How can design off-grid PV system with SAM? Considering that, I want to gain DC power from PV system.

Paul Gilman

Hello,

SAM cannot model off-grid systems. It assumes the renewable energy system is connected to the grid.

Best regards,
Paul.

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer