Describe the bug
When the maximum usage units on the Electricity Rates page are "kWh/kW" in the energy rates table, running the REopt optimization from the Battery Cell and System page causes SAM to crash.
For examples with kWh/kW units, see Duke Energy Large General Servcice (LGS) rates.
To Reproduce
Steps to reproduce the behavior:
- Open example file kwh-kw-max-usage-units.zip
- Note kWh/kW units in energy rate table on Electricity Rates page.
- On Battery Cell and System page, click Get size and dispatch.
- SAM crashes.
Expected behavior
REopt optimization should either run work kWh/kW units, or SAM should display an error message like "REopt optmization does not support kWh/kW maximum usage units for energy rates."
Operating System and Version
SAM 2025.4.16 r1 for Windows.
Additional context
This seems like it should be handled as an error by Line 97 of try_get_rate_structure() in cmod_utilityrate5_eqns.cpp:
But perhaps this REopt error handling issue is preventing the error from being displayed correctly: #2131.
See also:
Describe the bug
When the maximum usage units on the Electricity Rates page are "kWh/kW" in the energy rates table, running the REopt optimization from the Battery Cell and System page causes SAM to crash.
For examples with kWh/kW units, see Duke Energy Large General Servcice (LGS) rates.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
REopt optimization should either run work kWh/kW units, or SAM should display an error message like "REopt optmization does not support kWh/kW maximum usage units for energy rates."
Operating System and Version
SAM 2025.4.16 r1 for Windows.
Additional context
This seems like it should be handled as an error by Line 97 of
try_get_rate_structure()in cmod_utilityrate5_eqns.cpp:But perhaps this REopt error handling issue is preventing the error from being displayed correctly: #2131.
See also: