CEC module database values

  • jtopham
  • Topic Author
More
02 Jan 2013 09:07 #1108 by jtopham
CEC module database values was created by jtopham
I wrote a basic function to find the number of modules per string, but the two lines with the (*) take the value from the CEC user entered specifications, rather than the CEC module database. I specified the PV module type in line 3, but dispite this it does not get it from the correct location. If anyone could help me with this issue it would be appreciated. Also: is there a way to have SAMUL select a different module from the CEC database within a script? i.e.: I want to have SAM cycle through multiple modules to see which has the best dc output per my location.

any help would be appreciated,

Jon

function modulePerString(mintemp)
type = getInput("pv.mod.model_type")
setInput("pv.mod.model_type",1)
oldmodules = getinput("pv.array.user_modules_per_string")
out("there were ", oldmodules , " modules per string\n")
STC = 25
tempc = (mintemp-STC)
*Voc = getInput("pv.mod.6par.voc")
*Vcoef = getInput("pv.mod.6par.bvoc")
vdcmax = 600
vocmax= (tempc*(Vcoef))+Voc
modules = (vdcmax/vocmax)
modulesint = integer(modules)
out("type :",type, "Voc:",Voc,"Vcoef: ",Vcoef,"Vocmax: ",vocmax,"\n")
setInput( "pv.array.user_modules_per_string", modulesint)
out("there are now ", modulesint , " modules per string\n")
end

Please Log in or Create an account to join the conversation.

  • jtopham
  • Topic Author
More
02 Jan 2013 09:09 #1109 by jtopham
Replied by jtopham on topic CEC module database values
sorry, I didn't preview my question.

here is the code in a visable format:

function modulePerString(mintemp)
type = getInput("pv.mod.model_type")
setInput("pv.mod.model_type",1)
oldmodules = getinput("pv.array.user_modules_per_string")
out("there were ", oldmodules , " modules per string\n")
STC = 25
tempc = (mintemp-STC)
Voc = getInput("pv.mod.6par.voc")
Vcoef = getInput("pv.mod.6par.bvoc")
vdcmax = 600
vocmax= (tempc*(Vcoef))+Voc
modules = (vdcmax/vocmax)
modulesint = integer(modules)
out("type :",type, "Voc:",Voc,"Vcoef: ",Vcoef,"Vocmax: ",vocmax,"\n")
setInput( "pv.array.user_modules_per_string", modulesint)
out("there are now ", modulesint , " modules per string\n")
end

Please Log in or Create an account to join the conversation.

  • pgilman
More
02 Jan 2013 11:37 #1110 by pgilman
Replied by pgilman on topic CEC module database values
Hello,

It is not possible to use SamUL to change the values stored in a library. For example, you cannot change the Voc value for module in the CEC Module library. SamUL does allow you to change the value of input variables that are editable on the input pages.

You can use SamUL to choose different modules from the CEC module library. Here is sample script that shows a few library-related functions:

BEGIN SAMUL SCRIPT

SetActiveCase("New Flat Plate PV Case 1")

'Show a list of libraries
lib = Library()
outln(lib)
outln()

'Show a list of all modules in the CECModule library
lib_cec = library("CECModule")
outln(lib_cec)
outln()

'Show the module model that is currently active on the Module page:
' 0 = Simple Efficiency Model
' 1 = CEC Performance Model with Module Database,
' 2 = CEC Performance Model with User Entered Specifications
' 3 = Sandia PV Array Performance Model with Module Database
model = GetInput("pv.mod.model_type")
outln(model)
outln()

'Set the current module model to CEC with database
SetInput("pv.mod.model_type",1)

'Show the name of the CEC module that is currently active on the Module page
name = GetInput("pv.mod.cec.module_name")
outln(name)
outln()

'Run a simulation and show the system's total annual output
'for the first five modules in the CECModule library
for ( i=0 ; i

Please Log in or Create an account to join the conversation.

  • jtopham
  • Topic Author
More
02 Jan 2013 14:00 #1111 by jtopham
Replied by jtopham on topic CEC module database values
Thank you for the sample script, I will be able to find good use for it.

My concern is not to change the library values, but to access the data within it, as you can see from the lines:

Voc = getInput("pv.mod.6par.voc")
Vcoef = getInput("pv.mod.6par.bvoc")

I am trying to retrieve the input for the calculation, and it is not working. It is instead accessing the CEC user entered specifications section, dispite the line:

setInput("pv.mod.model_type",1)


Thanks,

Jonathan Topham

Please Log in or Create an account to join the conversation.

  • pgilman
More
02 Jan 2013 15:06 #1112 by pgilman
Replied by pgilman on topic CEC module database values
Dear Jonathan,

Sorry I misunderstood your question. The variable names for the CEC Module model with database parameters are not available in the SamUL input variable list. Here they are:

Efficiency: pv.mod.cec.eff
Maximum Power (Pmp): pv.mod.cec.p_mp_ref
Max Power Voltage (Vmp): pv.mod.cec.v_mp_ref
Max Power Current (Imp): pv.mod.cec.i_mp_ref
Open Circuit Voltage (Voc): pv.mod.cec.v_oc_ref
Short Circuit Current (Isc): pv.mod.cec.i_sc_ref
Temperature Coefficient of Power (%/C): pv.mod.cec.gamma_r
Temperature Coefficient of Power (W/C): pv.mod.cec.gamma_r_calc
Temperature Coefficient of Open Circuit Voltage (%/C): pv.mod.cec.beta_oc_calc
Temperature Coefficient of Open Circuit Voltage (V/C): pv.mod.cec.beta_oc
Temperature Coefficient of Short Circuit Current (%/C): pv.mod.cec.alpha_sc_calc
Temperature Coefficient of Short Circuit Current (A/C): pv.mod.cec.alpha_sc

You should only use SamUL to read these values, not to set them. (If you want to change the values, you should use the CEC model with user-entered specifications instead.)

Best regards,
Paul.

Please Log in or Create an account to join the conversation.

Moderators: pgilman
Powered by Kunena Forum