el1xr_opt.Modules.oM_Investment

el1xr_opt.Modules.oM_Investment#

el1xr_opt.Modules.oM_Investment.create_investment(model, optmodel, indlog)[source]#

Add the capacity-sizing (investment) layer to the model.

Candidate units are those with a positive investment cost. In this model the generator sets already include storage, so the candidates are collected in egc (electricity, includes BESS and fuel cells) and hgc (hydrogen, includes electrolysers and hydrogen storage); egsc and hgsc are the storage subsets. For each candidate the model chooses a build fraction in [0, 1] (or a binary build decision); the usable capacity is the nameplate capacity times that fraction. The annualized build cost enters the objective through vTotalICost.

This function is additive: it introduces new variables and constraints plus a single extra term in the objective. It does not modify any existing operating constraint. Run it after create_variables and before create_objective_function so that vTotalICost exists when the total system cost is assembled.