Skip to content

Commit c7ff488

Browse files
committed
Update existing capacity check to specifically look for tiny dropped capacities
Signed-off-by: Davey Elder <iandavidelder@gmail.com>
1 parent cb0c4c5 commit c7ff488

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

temoa/components/technology.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
from pyomo.environ import value
1919

20+
from temoa.components.utils import get_adjusted_existing_capacity
21+
2022
if TYPE_CHECKING:
2123
from collections.abc import Iterable
2224

@@ -440,14 +442,18 @@ def check_existing_capacity(model: TemoaModel) -> None:
440442
)
441443
logger.warning(msg)
442444
continue
443-
if t not in model.tech_all:
445+
adjusted_cap = get_adjusted_existing_capacity(model, r, t, v)
446+
if adjusted_cap <= 0.0:
447+
# Was retired in a previous period (myopic mode)
444448
continue
449+
p = model.time_optimize.first()
445450
life = value(model.lifetime_process[r, t, v])
446-
if (r, t, v) not in model.process_periods and v + life > model.time_optimize.first():
451+
if (r, t, v) not in model.process_periods and v + life > p:
452+
surviving_cap = adjusted_cap * value(model.lifetime_survival_curve[r, p, t, v])
447453
msg = (
448-
f'Existing capacity {r, t, v} with lifetime {life} and capacity {cap} '
449-
'should extend into future periods but is not an active process. '
450-
'May be missing from Efficiency table or too small to carry forward '
451-
'if running in myopic mode.'
454+
f'Existing capacity {r, t, v} with lifetime {life} and surviving capacity '
455+
f'{surviving_cap} should extend into future periods but is not an active '
456+
'process. It may be missing from the Efficiency table or have too little '
457+
'capacity to output and carry forward if running in myopic mode.'
452458
)
453459
logger.warning(msg)

0 commit comments

Comments
 (0)