Hi Rob,
To assign values as they appear in this screenshot of the energy charge input table in the SAM user interface,
the 'ur_ec_tou_mat' array would be defined as (with line breaks and spacing to make it more legible):
ur_ec_tou_mat =
[
[ 1, 1, 1+38, 0, 0.12, 0 ],
[ 2, 1, 1+38, 0, 0.05, 0 ],
[ 3, 1, 1+38, 0, 0.25, 0 ],
[ 4, 1, 1+38, 0, 0.26, 0 ]
]
To assign the buy rate for Period 1, Tier 1 to $0.10/kWh, you would set:
ur_ec_tou_mat[0][4] = 0.1
So, that part of your assignment looks correct.
From the PySAM 2.0 documentation for the Utilityrate5 module, it looks like 'ur_ec_tou_mat' is a sequence:
nrel-pysam.readthedocs.io/en/2.0.2/modules/Utilityrate5.html#module-PySAM.Utilityrate5.
The error message suggests that `ur.ElectricityRates.ur_ec_tou_mat` is a tuple. Tuples, unlike lists, are immutable in Python, so they can't be changed.
Is that enough information to solve the problem?
Thanks,
Paul.