For FOM financial models, the SAM UI hides "Sell" column of the Energy Charge table on the Electricity Purchases page because the sell rate is not applicable for calculating the cost of electricity purchases. For this to work correctly with SSC, the values in the sell column should all be zeros, which they are by default.
However, it is possible for a user's LK script or the URDB download callback script to set sell rate values to non-zero values. For example, this line of LK script:
set('ur_ec_tou_mat',[ [ 1, 1, 5000, 0, 0.12, 0.06 ], [ 1, 2, 1e+38, 0, 0.09, 0.045 ] ]);
Or this rate structure from the URDB with non-zero sell rates:
Tucson Electric Power Company, Small General Service TGSGS (Single Phase)
The on_load() function for the Utility Rate - Energy Charge UI form sets the sell rate to zero and displays a UI message when this happens. However, it only performs the check when the form is loaded so it misses URDB downloads and LK script changes:

There are two possible solutions to this:
Steps to Replicate
- Create a default PVWatts / Single Owner case.
- On the Electricity Purchases page, choose Use retail electricity rate(s)
- Open a script window and run the line of LK script above.
- Click Simulate and note negative LCOE in Metrics table and negative electricity purchases on Cash Flow tab.
- Click Electricity Purchases page and note UI message about setting sell rate to zero.
- Click Simulate and note positive LCOE and zero electricity purchases (no inverter nighttime consumption for PVWatts).
For FOM financial models, the SAM UI hides "Sell" column of the Energy Charge table on the Electricity Purchases page because the sell rate is not applicable for calculating the cost of electricity purchases. For this to work correctly with SSC, the values in the sell column should all be zeros, which they are by default.
However, it is possible for a user's LK script or the URDB download callback script to set sell rate values to non-zero values. For example, this line of LK script:
Or this rate structure from the URDB with non-zero sell rates:
Tucson Electric Power Company, Small General Service TGSGS (Single Phase)
The on_load() function for the Utility Rate - Energy Charge UI form sets the sell rate to zero and displays a UI message when this happens. However, it only performs the check when the form is loaded so it misses URDB downloads and LK script changes:
There are two possible solutions to this:
Generate an SSC error when the sell rate is non-zero for FOM financial models.
Add the UI check to on_change{'ur_ec_tou_mat'}
Steps to Replicate