I need your help please. I have created two simulations in SAM, one PV and the other CSP, then I took the code to Python 3. So far there is no problem. I can see the results in my IDE. However, since the generation is not in the code, I added in each file:
gen_pv = ssc.data_get_array (data, b'gen ');
gen_csp = ssc.data_get_array (data, b'gen ');
And I can also see the hourly generation without problems.
The problem is when from a file (for example CSP.py), I want to call the generation of the other file (gen_pv). That is, I want to import the variable from one file to another.
For example, in the CSP.py file I call a variable from PV.py
from PV import *
There I have "NameError: name 'gen_pv' is not defined".
Each one separately works fine when I add gen_pv and gen_csp, but when I want to import variables, it tells me that it is undefined. The problem is clearly in these variables that I added, maybe they are not in the right place or I have to do something else, like define them.
I hope I was clear.
I attach all the files, in case someone can help me, please.
Thank you very much in advance,
Thank you dear Paul,
I use the default values in the code, which are the ones brought from SAM. With that I can get results without problems. Should I enter any other input?
The problem is when I add new lines of code, which do not come from the original code generated by SAM.
Request the hourly generation as:
gen_pv = ssc.data_get_array (data, b'gen ')
do you think it's okay?