diff --git a/docs/usage.rst b/docs/usage.rst index 73b3867f2..bc02bbf07 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -1270,6 +1270,11 @@ Besides the `invest` variable, new variables are introduced as well. These are: has not yet been tested. * For now, both, the `timeindex` as well as the `timeincrement` of an energy system have to be defined since they have to be of the same length for a multi-period model. + * You can choose whether to re-evaluate assets at the end of the optimization horizon. If you set attribute + `use_remaining_value` of the energy system to True (defaults to False), this leads to the model evaluating the + difference in the asset value at the end of the optimization horizon vs. at the time the investment was made. + The difference in value is added to or subtracted from the respective investment costs increment, + assuming assets are to be liquidated / re-evaluated at the end of the optimization horizon. * Also please be aware, that periods correspond to years by default. You could also choose monthly periods, but you would need to be very careful in parameterizing your energy system and your model and also, this would mean monthly discounting (if applicable) as well as specifying your plants lifetimes in months. diff --git a/docs/whatsnew/v0-5-2.rst b/docs/whatsnew/v0-5-2.rst index 76968d64a..6859e1652 100644 --- a/docs/whatsnew/v0-5-2.rst +++ b/docs/whatsnew/v0-5-2.rst @@ -4,15 +4,25 @@ v0.5.2 (????) API changes ########### +* New bool attribute `use_remaining_value` of `oemof.solph.EnergySystem` + New features ############ +* Allow for evaluating differences in the remaining vs. the original value + for multi-period investments. + Documentation ############# Bug fixes ######### +* Fix handling of investment annuities and fixed costs for multi-period models: + Limit to costs that occur within the optimization horizon to prevent a + bias towards investments happening earlier in the optimization horizon. +* Fix bugs in multi-period documentation. + Testing ####### @@ -25,3 +35,7 @@ Contributors ############ * Patrik Schönfeldt +* Johannes Kochems +* Julian Endres +* Hendrik Huyskens +* Raul Ciria Aylagas diff --git a/src/oemof/solph/_energy_system.py b/src/oemof/solph/_energy_system.py index de2d2ad79..2d889787e 100644 --- a/src/oemof/solph/_energy_system.py +++ b/src/oemof/solph/_energy_system.py @@ -62,6 +62,10 @@ class EnergySystem(es.EnergySystem): For a standard model, periods are not (to be) declared, i.e. None. A list with one entry is derived, i.e. [0]. + use_remaining_value : bool + If True, compare the remaining value of an investment to the + original value (only applicable for multi-period models) + kwargs """ @@ -71,6 +75,7 @@ def __init__( timeincrement=None, infer_last_interval=None, periods=None, + use_remaining_value=False, **kwargs, ): # Doing imports at runtime is generally frowned upon, but should work @@ -159,7 +164,8 @@ def __init__( timeindex=timeindex, timeincrement=timeincrement, **kwargs ) - if periods is not None: + self.periods = periods + if self.periods is not None: msg = ( "CAUTION! You specified the 'periods' attribute for your " "energy system.\n This will lead to creating " @@ -170,9 +176,10 @@ def __init__( "please report them." ) warnings.warn(msg, debugging.ExperimentalFeatureWarning) - self.periods = periods - self._extract_periods_years() - self._extract_periods_matrix() + self._extract_periods_years() + self._extract_periods_matrix() + self._extract_end_year_of_optimization() + self.use_remaining_value = use_remaining_value def _extract_periods_years(self): """Map years in optimization to respective period based on time indices @@ -182,13 +189,12 @@ def _extract_periods_years(self): start of the optimization run and starting with 0. """ periods_years = [0] - if self.periods is not None: - start_year = self.periods[0].min().year - for k, v in enumerate(self.periods): - if k >= 1: - periods_years.append(v.min().year - start_year) + start_year = self.periods[0].min().year + for k, v in enumerate(self.periods): + if k >= 1: + periods_years.append(v.min().year - start_year) - self.periods_years = periods_years + self.periods_years = periods_years def _extract_periods_matrix(self): """Determines a matrix describing the temporal distance to each period. @@ -199,13 +205,41 @@ def _extract_periods_matrix(self): between each investment period to each decommissioning period. """ periods_matrix = [] - if self.periods is not None: - period_years = np.array(self.periods_years) - for v in period_years: - row = period_years - v - row = np.where(row < 0, 0, row) - periods_matrix.append(row) - self.periods_matrix = np.array(periods_matrix) + period_years = np.array(self.periods_years) + for v in period_years: + row = period_years - v + row = np.where(row < 0, 0, row) + periods_matrix.append(row) + self.periods_matrix = np.array(periods_matrix) + + def _extract_end_year_of_optimization(self): + """Extract the end of the optimization in years + + Attribute `end_year_of_optimization` of int is set. + """ + duration_last_period = self.get_period_duration(-1) + self.end_year_of_optimization = ( + self.periods_years[-1] + duration_last_period + ) + + def get_period_duration(self, period): + """Get duration of a period in full years + + Parameters + ---------- + period : int + Period for which the duration in years shall be obtained + + Returns + ------- + int + Duration of the period + """ + return ( + self.periods[period].max().year + - self.periods[period].min().year + + 1 + ) def create_time_index( diff --git a/src/oemof/solph/components/_generic_storage.py b/src/oemof/solph/components/_generic_storage.py index ef7b37cd6..fe99af99d 100644 --- a/src/oemof/solph/components/_generic_storage.py +++ b/src/oemof/solph/components/_generic_storage.py @@ -15,6 +15,7 @@ SPDX-FileCopyrightText: Ekaterina Zolotarevskaia SPDX-FileCopyrightText: Johannes Kochems SPDX-FileCopyrightText: Johannes Giehl +SPDX-FileCopyrightText: Raul Ciria Aylagas SPDX-License-Identifier: MIT @@ -362,7 +363,7 @@ class GenericStorageBlock(ScalarBlock): Set storage_content of last time step to one at t=0 if balanced == True .. math:: - E(t_{last}) = &E(-1) + E(t_{last}) = E(-1) Storage balance :attr:`om.Storage.balance[n, t]` .. math:: E(t) = &E(t-1) \cdot @@ -375,8 +376,8 @@ class GenericStorageBlock(ScalarBlock): Connect the invest variables of the input and the output flow. .. math:: InvestmentFlowBlock.invest(source(n), n, p) + existing = \\ - (InvestmentFlowBlock.invest(n, target(n), p) + existing) * \\ - invest\_relation\_input\_output(n) \\ + (InvestmentFlowBlock.invest(n, target(n), p) + existing) \\ + * invest\_relation\_input\_output(n) \\ \forall n \in \textrm{INVEST\_REL\_IN\_OUT} \\ \forall p \in \textrm{PERIODS} @@ -429,7 +430,7 @@ class GenericStorageBlock(ScalarBlock): * :attr: `storage_costs` not 0 - ..math:: + .. math:: \sum_{t \in \textrm{TIMESTEPS}} c_{storage}(t) \cdot E(t) @@ -438,11 +439,14 @@ class GenericStorageBlock(ScalarBlock): * :attr:`fixed_costs` not None .. math:: - \sum_{p \in \textrm{PERIODS}} E_{nom} - \cdot c_{fixed}(p) \cdot DF^{-p} + \displaystyle \sum_{pp=0}^{year_{max}} E_{nom} + \cdot c_{fixed}(pp) \cdot DF^{-pp} + + where: - whereby: - :math:`DF=(1+dr)` is the discount factor with discount rate :math:`dr` + * :math:`DF=(1+dr)` is the discount factor with discount rate :math:`dr`. + * :math:`year_{max}` denotes the last year of the optimization + horizon, i.e. at the end of the last period. """ # noqa: E501 @@ -599,12 +603,12 @@ def _objective_expression(self): if m.es.periods is not None: for n in self.STORAGES: if n.fixed_costs[0] is not None: - for p in m.PERIODS: - fixed_costs += ( - n.nominal_storage_capacity - * n.fixed_costs[p] - * ((1 + m.discount_rate) ** -p) - ) + fixed_costs += sum( + n.nominal_storage_capacity + * n.fixed_costs[pp] + * (1 + m.discount_rate) ** (-pp) + for pp in range(m.es.end_year_of_optimization) + ) self.fixed_costs = Expression(expr=fixed_costs) storage_costs = 0 @@ -620,8 +624,9 @@ def _objective_expression(self): ) self.storage_costs = Expression(expr=storage_costs) + self.costs = Expression(expr=storage_costs + fixed_costs) - return self.fixed_costs + self.storage_costs + return self.costs class GenericInvestmentStorageBlock(ScalarBlock): @@ -751,7 +756,7 @@ class GenericInvestmentStorageBlock(ScalarBlock): & \forall p \in \textrm{PERIODS} - whereby: + where: * (*) is only performed for the first period the condition is True. A decommissioning flag is then set to True to prevent having falsely @@ -883,14 +888,32 @@ class GenericInvestmentStorageBlock(ScalarBlock): E_{invest}(0) \cdot c_{invest,var}(0) + c_{invest,fix}(0) \cdot b_{invest}(0)\\ + Where 0 denotes the 0th (investment) period since + in a standard model, there is only this one period. + *Multi-period model* * :attr:`nonconvex = False` .. math:: & - E_{invest}(p) \cdot A(c_{invest,var}(p), l, ir) \cdot l - \cdot DF^{-p}\\ + E_{invest}(p) \cdot A(c_{invest,var}(p), l, ir) + \cdot \frac {1}{ANF(d, ir)} \cdot DF^{-p}\\ + & + \forall p \in \textrm{PERIODS} + + In case, the remaining lifetime of a storage is greater than 0 and + attribute `use_remaining_value` of the energy system is True, + the difference in value for the investment period compared to the + last period of the optimization horizon is accounted for + as an adder to the investment costs: + + .. math:: + & + E_{invest}(p) \cdot (A(c_{invest,var}(p), l_{r}, ir) - + A(c_{invest,var}(|P|), l_{r}, ir)\\ + & \cdot \frac {1}{ANF(l_{r}, ir)} \cdot DF^{-|P|}\\ + &\\ & \forall p \in \textrm{PERIODS} @@ -898,8 +921,28 @@ class GenericInvestmentStorageBlock(ScalarBlock): .. math:: & - E_{invest}(p) \cdot A(c_{invest,var}(p), l, ir) \cdot l - \cdot DF^{-p} + c_{invest,fix}(p) \cdot b_{invest}(p)\\ + (E_{invest}(p) \cdot A(c_{invest,var}(p), l, ir) + \cdot \frac {1}{ANF(d, ir)}\\ + & + + c_{invest,fix}(p) \cdot b_{invest}(p)) \cdot DF^{-p} \\ + & + \forall p \in \textrm{PERIODS} + + In case, the remaining lifetime of a storage is greater than 0 and + attribute `use_remaining_value` of the energy system is True, + the difference in value for the investment period compared to the + last period of the optimization horizon is accounted for + as an adder to the investment costs: + + .. math:: + & + (E_{invest}(p) \cdot (A(c_{invest,var}(p), l_{r}, ir) - + A(c_{invest,var}(|P|), l_{r}, ir)\\ + & \cdot \frac {1}{ANF(l_{r}, ir)} \cdot DF^{-|P|}\\ + & + + (c_{invest,fix}(p) - c_{invest,fix}(|P|)) + \cdot b_{invest}(p)) \cdot DF^{-p}\\ + &\\ & \forall p \in \textrm{PERIODS} @@ -907,7 +950,7 @@ class GenericInvestmentStorageBlock(ScalarBlock): .. math:: & - \sum_{pp=year(p)}^{year(p)+l} + \sum_{pp=year(p)}^{limit_{end}} E_{invest}(p) \cdot c_{fixed}(pp) \cdot DF^{-pp}) \cdot DF^{-p}\\ & @@ -916,27 +959,47 @@ class GenericInvestmentStorageBlock(ScalarBlock): * :attr:`fixed_costs` not None for existing capacity .. math:: - \sum_{pp=0}^{l-a} E_{exist} \cdot c_{fixed}(pp) + \sum_{pp=0}^{limit_{exo}} E_{exist} \cdot c_{fixed}(pp) \cdot DF^{-pp} - - whereby: - - * :math:`A(c_{invest,var}(p), l, ir)` A is the annuity for - investment expenses :math:`c_{invest,var}(p)` lifetime :math:`l` and - interest rate :math:`ir` - * :math:`DF=(1+dr)` is the discount factor with discount rate math:`dr` - - The annuity hereby is: + where: + + * :math:`A(c_{invest,var}(p), l, ir)` A is the annuity for + investment expenses :math:`c_{invest,var}(p)`, lifetime :math:`l` + and interest rate :math:`ir`. + * :math:`l_{r}` is the remaining lifetime at the end of the + optimization horizon (in case it is greater than 0 and + smaller than the actual lifetime). + * :math:`ANF(d, ir)` is the annuity factor for duration :math:`d` + and interest rate :math:`ir`. + * :math:`d=min\{year_{max} - year(p), l\}` defines the + number of years within the optimization horizon that investment + annuities are accounted for. + * :math:`year(p)` denotes the start year of period :math:`p`. + * :math:`year_{max}` denotes the last year of the optimization + horizon, i.e. at the end of the last period. + * :math:`limit_{end}=min\{year_{max}, year(p) + l\}` is used as an + upper bound to ensure fixed costs for endogenous investments + to occur within the optimization horizon. + * :math:`limit_{exo}=min\{year_{max}, l - a\}` is used as an + upper bound to ensure fixed costs for existing capacities to occur + within the optimization horizon. :math:`a` is the initial age + of an asset. + * :math:`DF=(1+dr)` is the discount factor. + + The annuity / annuity factor hereby is: .. math:: - + & A(c_{invest,var}(p), l, ir) = c_{invest,var}(p) \cdot - \frac {(1+i)^l \cdot i} {(1+i)^l - 1} \cdot + \frac {(1+ir)^l \cdot ir} {(1+ir)^l - 1}\\ + &\\ + & + ANF(d, ir)=\frac {(1+ir)^d \cdot ir} {(1+ir)^d - 1} - It is retrieved, using oemof.tools.economics annuity function. The - interest rate is defined as a weighted average costs of capital (wacc) and - assumed constant over time. + They are retrieved, using oemof.tools.economics annuity function. The + interest rate :math:`ir` for the annuity is defined as weighted + average costs of capital (wacc) and assumed constant over time. The overall summed cost expressions for all *InvestmentFlowBlock* objects can be accessed by @@ -977,7 +1040,7 @@ class GenericInvestmentStorageBlock(ScalarBlock): | Old (nominal) capacity of the storage | to be decommissioned in period p | which was endogenously determined by :math:`E_{invest}(p_{comm})` - | whereby :math:`p_{comm}` is the commissioning period" + | where :math:`p_{comm}` is the commissioning period" ":math:`E(-1)`", ":attr:`init_cap[n]`", "Initial storage capacity (before timestep 0)" ":math:`b_{invest}(p)`", ":attr:`invest_status[i, o, p]`", "Binary @@ -1712,7 +1775,6 @@ def _objective_expression(self): "social planner point of view and does not reflect " "microeconomic interest requirements." ) - for n in self.CONVEX_INVESTSTORAGES: lifetime = n.investment.lifetime interest = n.investment.interest_rate @@ -1728,13 +1790,29 @@ def _objective_expression(self): n=lifetime, wacc=interest, ) + duration = min( + m.es.end_year_of_optimization - m.es.periods_years[p], + lifetime, + ) + present_value_factor = 1 / economics.annuity( + capex=1, n=duration, wacc=interest + ) investment_costs_increment = ( - self.invest[n, p] - * annuity - * lifetime - * ((1 + m.discount_rate) ** (-m.es.periods_years[p])) + self.invest[n, p] * annuity * present_value_factor + ) * (1 + m.discount_rate) ** (-m.es.periods_years[p]) + remaining_value_difference = ( + self._evaluate_remaining_value_difference( + m, + p, + n, + m.es.end_year_of_optimization, + lifetime, + interest, + ) + ) + investment_costs += ( + investment_costs_increment + remaining_value_difference ) - investment_costs += investment_costs_increment period_investment_costs[p] += investment_costs_increment for n in self.NON_CONVEX_INVESTSTORAGES: @@ -1752,36 +1830,63 @@ def _objective_expression(self): n=lifetime, wacc=interest, ) + duration = min( + m.es.end_year_of_optimization - m.es.periods_years[p], + lifetime, + ) + present_value_factor = 1 / economics.annuity( + capex=1, n=duration, wacc=interest + ) investment_costs_increment = ( - self.invest[n, p] * annuity * lifetime + self.invest[n, p] * annuity * present_value_factor + self.invest_status[n, p] * n.investment.offset[p] - ) * ((1 + m.discount_rate) ** (-m.es.periods_years[p])) - investment_costs += investment_costs_increment + ) * (1 + m.discount_rate) ** (-m.es.periods_years[p]) + remaining_value_difference = ( + self._evaluate_remaining_value_difference( + m, + p, + n, + m.es.end_year_of_optimization, + lifetime, + interest, + nonconvex=True, + ) + ) + investment_costs += ( + investment_costs_increment + remaining_value_difference + ) period_investment_costs[p] += investment_costs_increment for n in self.INVESTSTORAGES: if n.investment.fixed_costs[0] is not None: lifetime = n.investment.lifetime for p in m.PERIODS: + range_limit = min( + m.es.end_year_of_optimization, + m.es.periods_years[p] + lifetime, + ) fixed_costs += sum( self.invest[n, p] * n.investment.fixed_costs[pp] - * ((1 + m.discount_rate) ** (-pp)) + * (1 + m.discount_rate) ** (-pp) for pp in range( m.es.periods_years[p], - m.es.periods_years[p] + lifetime, + range_limit, ) - ) * ((1 + m.discount_rate) ** (-m.es.periods_years[p])) + ) * (1 + m.discount_rate) ** (-m.es.periods_years[p]) for n in self.EXISTING_INVESTSTORAGES: if n.investment.fixed_costs[0] is not None: lifetime = n.investment.lifetime age = n.investment.age + range_limit = min( + m.es.end_year_of_optimization, lifetime - age + ) fixed_costs += sum( n.investment.existing * n.investment.fixed_costs[pp] - * ((1 + m.discount_rate) ** (-pp)) - for pp in range(0, lifetime - age) + * (1 + m.discount_rate) ** (-pp) + for pp in range(range_limit) ) self.investment_costs = Expression(expr=investment_costs) @@ -1790,3 +1895,80 @@ def _objective_expression(self): self.costs = Expression(expr=investment_costs + fixed_costs) return self.costs + + def _evaluate_remaining_value_difference( + self, + m, + p, + n, + end_year_of_optimization, + lifetime, + interest, + nonconvex=False, + ): + """Evaluate and return the remaining value difference of an investment + + The remaining value difference in the net present values if the asset + was to be liquidated at the end of the optimization horizon and the + net present value using the original investment expenses. + + Parameters + ---------- + m : oemof.solph.models.Model + Optimization model + + p : int + Period in which investment occurs + + n : oemof.solph.components.GenericStorage + storage unit + + end_year_of_optimization : int + Last year of the optimization horizon + + lifetime : int + lifetime of investment considered + + interest : float + Demanded interest rate for investment + + nonconvex : bool + Indicating whether considered flow is nonconvex. + """ + if m.es.use_remaining_value: + if end_year_of_optimization - m.es.periods_years[p] < lifetime: + remaining_lifetime = lifetime - ( + end_year_of_optimization - m.es.periods_years[p] + ) + remaining_annuity = economics.annuity( + capex=n.investment.ep_costs[-1], + n=remaining_lifetime, + wacc=interest, + ) + original_annuity = economics.annuity( + capex=n.investment.ep_costs[p], + n=remaining_lifetime, + wacc=interest, + ) + present_value_factor_remaining = 1 / economics.annuity( + capex=1, n=remaining_lifetime, wacc=interest + ) + convex_investment_costs = ( + self.invest[n, p] + * (remaining_annuity - original_annuity) + * present_value_factor_remaining + ) * (1 + m.discount_rate) ** (-end_year_of_optimization) + if nonconvex: + return convex_investment_costs + self.invest_status[ + n, p + ] * (n.investment.offset[-1] - n.investment.offset[p]) * ( + 1 + m.discount_rate + ) ** ( + -end_year_of_optimization + ) + else: + return convex_investment_costs + else: + return 0 + else: + return 0 diff --git a/src/oemof/solph/components/experimental/_generic_caes.py b/src/oemof/solph/components/experimental/_generic_caes.py index 69e4d5643..f150dff5a 100644 --- a/src/oemof/solph/components/experimental/_generic_caes.py +++ b/src/oemof/solph/components/experimental/_generic_caes.py @@ -92,7 +92,7 @@ class GenericCAES(Node): ... electrical_input={bel: solph.flows.Flow()}, ... fuel_input={bgas: solph.flows.Flow()}, ... electrical_output={bel: solph.flows.Flow()}, - ... params=concept, fixed_costs=0) + ... params=concept) >>> type(caes) """ diff --git a/src/oemof/solph/components/experimental/_sink_dsm.py b/src/oemof/solph/components/experimental/_sink_dsm.py index eeda335aa..9d9a0c758 100644 --- a/src/oemof/solph/components/experimental/_sink_dsm.py +++ b/src/oemof/solph/components/experimental/_sink_dsm.py @@ -212,7 +212,7 @@ class SinkDSM(Sink): Boolean parameter indicating whether unit is eligible for load shifting fixed_costs : numeric - Nominal value of fixed costs (per period) + Nominal value of fixed costs (per year) Note ---- @@ -446,11 +446,18 @@ class SinkDSMOemofBlock(ScalarBlock): .. math:: & (DSM_{t}^{up} \cdot cost_{t}^{dsm, up} - + DSM_{t}^{do, shift} \cdot cost_{t}^{dsm, do, shift} + + DSM_{t}^{do, shift} \cdot cost_{t}^{dsm, do, shift}\\ + & + DSM_{t}^{do, shed} \cdot cost_{t}^{dsm, do, shed}) \cdot \omega_{t} \\ & \quad \quad \quad \quad \forall t \in \mathbb{T} \\ + * :attr:`fixed_costs` not None + + .. math:: + \displaystyle \sum_{pp=0}^{year_{max}} max\{E_{up, max}, E_{do, max}\} + \cdot c_{fixed}(pp) \cdot DF^{-pp} + **Table: Symbols and attribute names of variables and parameters** .. table:: Variables (V), Parameters (P) and Sets (S) @@ -483,6 +490,7 @@ class SinkDSMOemofBlock(ScalarBlock): :math:`cost_{t}^{dsm, do, shift}` `cost_dsm_down_shift[t]` P Variable costs for a downwards shift (load shifting) :math:`cost_{t}^{dsm, do, shed}` `cost_dsm_down_shift[t]` P Variable costs for shedding load :math:`\omega_{t}` P Objective weighting of the model for timestep t + :math:`year_{max}` P Last year of the optimization horizon ================================= ======================== ==== ======================================= """ # noqa: E501 @@ -683,7 +691,7 @@ def _objective_expression(self): self.dsm_up[g, t] * m.objective_weighting[t] * g.cost_dsm_up[t] - * ((1 + m.discount_rate) ** -m.es.periods_years[p]) + * (1 + m.discount_rate) ** (-m.es.periods_years[p]) ) variable_costs += ( ( @@ -691,16 +699,16 @@ def _objective_expression(self): + self.dsm_do_shed[g, t] * g.cost_dsm_down_shed[t] ) * m.objective_weighting[t] - * ((1 + m.discount_rate) ** -m.es.periods_years[p]) + * (1 + m.discount_rate) ** (-m.es.periods_years[p]) ) if g.fixed_costs[0] is not None: - for p in m.PERIODS: - fixed_costs += ( - max(g.max_capacity_up, g.max_capacity_down) - * g.fixed_costs[p] - * ((1 + m.discount_rate) ** -m.es.periods_years[p]) - ) + fixed_costs += sum( + max(g.max_capacity_up, g.max_capacity_down) + * g.fixed_costs[pp] + * (1 + m.discount_rate) ** (-pp) + for pp in range(m.es.end_year_of_optimization) + ) self.variable_costs = Expression(expr=variable_costs) self.fixed_costs = Expression(expr=fixed_costs) @@ -780,17 +788,32 @@ class SinkDSMOemofInvestmentBlock(ScalarBlock): .. math:: & - P_{invest}(p) \cdot A(c_{invest}(p), l, ir) \cdot l - \cdot DF^{-p} \\ + P_{invest}(p) \cdot A(c_{invest}(p), l, ir) + \cdot \frac {1}{ANF(d, ir)} \cdot DF^{-p} \\ &\\ & \forall p \in \mathbb{P} + In case, the remaining lifetime of a DSM unit is greater than 0 and + attribute `use_remaining_value` of the energy system is True, + the difference in value for the investment period compared to the + last period of the optimization horizon is accounted for + as an adder to the investment costs: + + .. math:: + & + P_{invest}(p) \cdot (A(c_{invest,var}(p), l_{r}, ir) - + A(c_{invest,var}(|P|), l_{r}, ir)\\ + & \cdot \frac {1}{ANF(l_{r}, ir)} \cdot DF^{-|P|}\\ + &\\ + & + \forall p \in \textrm{PERIODS} + * :attr:`fixed_costs` not None for investments .. math:: & - (\sum_{pp=year(p)}^{year(p)+l} + (\sum_{pp=year(p)}^{limit_{end}} P_{invest}(p) \cdot c_{fixed}(pp) \cdot DF^{-pp}) \cdot DF^{-p} \\ &\\ @@ -809,13 +832,37 @@ class SinkDSMOemofInvestmentBlock(ScalarBlock): & \quad \quad \quad \quad \forall p, t \in \textrm{TIMEINDEX} \\ - whereby: + where: * :math:`A(c_{invest,var}(p), l, ir)` A is the annuity for - investment expenses :math:`c_{invest}(p)` lifetime :math:`l` - and interest rate :math:`ir` - * :math:`DF=(1+dr)` is the discount factor with discount rate - :math:`dr` + investment expenses :math:`c_{invest,var}(p)`, lifetime :math:`l` + and interest rate :math:`ir`. + * :math:`ANF(d, ir)` is the annuity factor for duration :math:`d` + and interest rate :math:`ir`. + * :math:`d=min\{year_{max} - year(p), l\}` defines the + number of years within the optimization horizon that investment + annuities are accounted for. + * :math:`year(p)` denotes the start year of period :math:`p`. + * :math:`year_{max}` denotes the last year of the optimization + horizon, i.e. at the end of the last period. + * :math:`limit_{end}=min\{year_{max}, year(p) + l\}` is used as an + upper bound to ensure fixed costs for endogenous investments + to occur within the optimization horizon. + * :math:`DF=(1+dr)` is the discount factor. + + The annuity / annuity factor hereby is: + + .. math:: + & + A(c_{invest,var}(p), l, ir) = c_{invest,var}(p) \cdot + \frac {(1+ir)^l \cdot ir} {(1+ir)^l - 1}\\ + &\\ + & + ANF(d, ir)=\frac {(1+dr)^d \cdot dr} {(1+dr)^d - 1} + + They are retrieved, using oemof.tools.economics annuity function. The + interest rate :math:`ir` for the annuity is defined as weighted + average costs of capital (wacc) and assumed constant over time. See remarks in :class:`oemof.solph.components.experimental._sink_dsm.SinkDSMOemofBlock`. @@ -1338,13 +1385,31 @@ def _objective_expression(self): n=lifetime, wacc=interest, ) + duration = min( + m.es.end_year_of_optimization + - m.es.periods_years[p], + lifetime, + ) + present_value_factor = 1 / economics.annuity( + capex=1, n=duration, wacc=interest + ) investment_costs_increment = ( - self.invest[g, p] - * annuity - * lifetime - * ((1 + m.discount_rate) ** -m.es.periods_years[p]) + self.invest[g, p] * annuity * present_value_factor + ) * (1 + m.discount_rate) ** (-m.es.periods_years[p]) + remaining_value_difference = ( + self._evaluate_remaining_value_difference( + m, + p, + g, + m.es.end_year_of_optimization, + lifetime, + interest, + ) + ) + investment_costs += ( + investment_costs_increment + + remaining_value_difference ) - investment_costs += investment_costs_increment period_investment_costs[ p ] += investment_costs_increment @@ -1356,7 +1421,7 @@ def _objective_expression(self): self.dsm_up[g, t] * m.objective_weighting[t] * g.cost_dsm_up[t] - * ((1 + m.discount_rate) ** -m.es.periods_years[p]) + * (1 + m.discount_rate) ** (-m.es.periods_years[p]) ) variable_costs += ( ( @@ -1364,31 +1429,38 @@ def _objective_expression(self): + self.dsm_do_shed[g, t] * g.cost_dsm_down_shed[t] ) * m.objective_weighting[t] - * ((1 + m.discount_rate) ** -m.es.periods_years[p]) + * (1 + m.discount_rate) ** (-m.es.periods_years[p]) ) if g.investment.fixed_costs[0] is not None: lifetime = g.investment.lifetime for p in m.PERIODS: + range_limit = min( + m.es.end_year_of_optimization, + m.es.periods_years[p] + lifetime, + ) fixed_costs += sum( self.invest[g, p] * g.investment.fixed_costs[pp] - * ((1 + m.discount_rate) ** (-pp)) + * (1 + m.discount_rate) ** (-pp) for pp in range( m.es.periods_years[p], - m.es.periods_years[p] + lifetime, + range_limit, ) - ) * ((1 + m.discount_rate) ** -m.es.periods_years[p]) + ) * (1 + m.discount_rate) ** (-m.es.periods_years[p]) for g in self.EXISTING_INVESTDSM: if g.investment.fixed_costs[0] is not None: lifetime = g.investment.lifetime age = g.investment.age + range_limit = min( + m.es.end_year_of_optimization, lifetime - age + ) fixed_costs += sum( g.investment.existing * g.investment.fixed_costs[pp] - * ((1 + m.discount_rate) ** (-pp)) - for pp in range(0, lifetime - age) + * (1 + m.discount_rate) ** (-pp) + for pp in range(range_limit) ) self.variable_costs = Expression(expr=variable_costs) @@ -1401,6 +1473,69 @@ def _objective_expression(self): return self.costs + def _evaluate_remaining_value_difference( + self, + m, + p, + g, + end_year_of_optimization, + lifetime, + interest, + ): + """Evaluate and return the remaining value difference of an investment + + The remaining value difference in the net present values if the asset + was to be liquidated at the end of the optimization horizon and the + net present value using the original investment expenses. + + Parameters + ---------- + m : oemof.solph.models.Model + Optimization model + + p : int + Period in which investment occurs + + g : oemof.solph.components.experimental.SinkDSM + storage unit + + end_year_of_optimization : int + Last year of the optimization horizon + + lifetime : int + lifetime of investment considered + + interest : float + Demanded interest rate for investment + """ + if m.es.use_remaining_value: + if end_year_of_optimization - m.es.periods_years[p] < lifetime: + remaining_lifetime = lifetime - ( + end_year_of_optimization - m.es.periods_years[p] + ) + remaining_annuity = economics.annuity( + capex=g.investment.ep_costs[-1], + n=remaining_lifetime, + wacc=interest, + ) + original_annuity = economics.annuity( + capex=g.investment.ep_costs[p], + n=remaining_lifetime, + wacc=interest, + ) + present_value_factor_remaining = 1 / economics.annuity( + capex=1, n=remaining_lifetime, wacc=interest + ) + return ( + self.invest[g, p] + * (remaining_annuity - original_annuity) + * present_value_factor_remaining + ) * (1 + m.discount_rate) ** (-end_year_of_optimization) + else: + return 0 + else: + return 0 + class SinkDSMDIWBlock(ScalarBlock): r"""Constraints for SinkDSM with "DIW" approach @@ -1473,12 +1608,18 @@ class SinkDSMDIWBlock(ScalarBlock): .. math:: & DSM_{t}^{up} \cdot cost_{t}^{dsm, up} - + \sum_{tt=0}^{|T|} DSM_{tt, t}^{do, shift} \cdot + + (\sum_{tt=0}^{|T|} DSM_{tt, t}^{do, shift} \cdot cost_{t}^{dsm, do, shift} + DSM_{t}^{do, shed} \cdot cost_{t}^{dsm, do, shed}) \cdot \omega_{t} \\ & \quad \quad \quad \quad \forall t \in \mathbb{T} \\ + * :attr:`fixed_costs` not None + + .. math:: + \displaystyle \sum_{pp=0}^{year_{max}} max\{E_{up, max}, E_{do, max}\} + \cdot c_{fixed}(pp) \cdot DF^{-pp} + **Table: Symbols and attribute names of variables and parameters** .. table:: Variables (V), Parameters (P) and Sets (S) @@ -1521,6 +1662,7 @@ class SinkDSMDIWBlock(ScalarBlock): | and the start of another :math:`\Delta t` P The time increment of the model :math:`\omega_{t}` P Objective weighting of the model for timestep t + :math:`year_{max}` P Last year of the optimization horizon ================================= ======================== ==== ======================================= """ # noqa E:501 @@ -2038,7 +2180,7 @@ def _objective_expression(self): self.dsm_up[g, t] * m.objective_weighting[t] * g.cost_dsm_up[t] - * ((1 + m.discount_rate) ** -m.es.periods_years[p]) + * (1 + m.discount_rate) ** (-m.es.periods_years[p]) ) variable_costs += ( ( @@ -2050,16 +2192,16 @@ def _objective_expression(self): + self.dsm_do_shed[g, t] * g.cost_dsm_down_shed[t] ) * m.objective_weighting[t] - * ((1 + m.discount_rate) ** -m.es.periods_years[p]) + * (1 + m.discount_rate) ** (-m.es.periods_years[p]) ) if g.fixed_costs[0] is not None: - for p in m.PERIODS: - fixed_costs += ( - max(g.max_capacity_up, g.max_capacity_down) - * g.fixed_costs[p] - * ((1 + m.discount_rate) ** -m.es.periods_years[p]) - ) + fixed_costs += sum( + max(g.max_capacity_up, g.max_capacity_down) + * g.fixed_costs[pp] + * (1 + m.discount_rate) ** (-pp) + for pp in range(m.es.end_year_of_optimization) + ) self.variable_costs = Expression(expr=variable_costs) self.fixed_costs = Expression(expr=fixed_costs) @@ -2168,16 +2310,31 @@ class SinkDSMDIWInvestmentBlock(ScalarBlock): .. math:: & - P_{invest}(p) \cdot A(c_{invest}(p), l, ir) \cdot l - \cdot DF^{-p} \\ + P_{invest}(p) \cdot A(c_{invest}(p), l, ir) + \frac {1}{ANF(d, ir)} \cdot DF^{-p} \\ &\\ & \quad \quad \quad \quad \forall p \in \mathbb{P} + In case, the remaining lifetime of a DSM unit is greater than 0 and + attribute `use_remaining_value` of the energy system is True, + the difference in value for the investment period compared to the + last period of the optimization horizon is accounted for + as an adder to the investment costs: + + .. math:: + & + P_{invest}(p) \cdot (A(c_{invest,var}(p), l_{r}, ir) - + A(c_{invest,var}(|P|), l_{r}, ir)\\ + & \cdot \frac {1}{ANF(l_{r}, ir)} \cdot DF^{-|P|}\\ + &\\ + & + \forall p \in \textrm{PERIODS} + * :attr:`fixed_costs` not None for investments .. math:: & - (\sum_{pp=year(p)}^{year(p)+l} + (\sum_{pp=year(p)}^{limit_{end}} P_{invest}(p) \cdot c_{fixed}(pp) \cdot DF^{-pp}) \cdot DF^{-p} \\ &\\ @@ -2195,13 +2352,37 @@ class SinkDSMDIWInvestmentBlock(ScalarBlock): & \quad \quad \quad \quad \forall p, t \in \textrm{TIMEINDEX} \\ - whereby: + where: - * :math:`A(c_{invest,var}(p), l, ir)` is the annuity for - investment expenses :math:`c_{invest}(p)` lifetime :math:`l` - and interest rate :math:`ir` - * :math:`DF=(1+dr)` is the discount factor with discount rate - :math:`dr` + * :math:`A(c_{invest,var}(p), l, ir)` A is the annuity for + investment expenses :math:`c_{invest,var}(p)`, lifetime :math:`l` + and interest rate :math:`ir`. + * :math:`ANF(d, ir)` is the annuity factor for duration :math:`d` + and interest rate :math:`ir`. + * :math:`d=min\{year_{max} - year(p), l\}` defines the + number of years within the optimization horizon that investment + annuities are accounted for. + * :math:`year(p)` denotes the start year of period :math:`p`. + * :math:`year_{max}` denotes the last year of the optimization + horizon, i.e. at the end of the last period. + * :math:`limit_{end}=min\{year_{max}, year(p) + l\}` is used as an + upper bound to ensure fixed costs for endogenous investments + to occur within the optimization horizon. + * :math:`DF=(1+dr)` is the discount factor. + + The annuity / annuity factor hereby is: + + .. math:: + & + A(c_{invest,var}(p), l, ir) = c_{invest,var}(p) \cdot + \frac {(1+ir)^l \cdot ir} {(1+ir)^l - 1}\\ + &\\ + & + ANF(d, ir)=\frac {(1+dr)^d \cdot dr} {(1+dr)^d - 1} + + They are retrieved, using oemof.tools.economics annuity function. The + interest rate :math:`ir` for the annuity is defined as weighted + average costs of capital (wacc) and assumed constant over time. See remarks in :class:`oemof.solph.components.experimental._sink_dsm.SinkDSMOemofBlock`. @@ -3054,13 +3235,31 @@ def _objective_expression(self): n=lifetime, wacc=interest, ) + duration = min( + m.es.end_year_of_optimization + - m.es.periods_years[p], + lifetime, + ) + present_value_factor = 1 / economics.annuity( + capex=1, n=duration, wacc=interest + ) investment_costs_increment = ( - self.invest[g, p] - * annuity - * lifetime - * ((1 + m.discount_rate) ** -m.es.periods_years[p]) + self.invest[g, p] * annuity * present_value_factor + ) * (1 + m.discount_rate) ** (-m.es.periods_years[p]) + remaining_value_difference = ( + self._evaluate_remaining_value_difference( + m, + p, + g, + m.es.end_year_of_optimization, + lifetime, + interest, + ) + ) + investment_costs += ( + investment_costs_increment + + remaining_value_difference ) - investment_costs += investment_costs_increment period_investment_costs[ p ] += investment_costs_increment @@ -3072,7 +3271,7 @@ def _objective_expression(self): self.dsm_up[g, t] * m.objective_weighting[t] * g.cost_dsm_up[t] - * ((1 + m.discount_rate) ** -m.es.periods_years[p]) + * (1 + m.discount_rate) ** (-m.es.periods_years[p]) ) variable_costs += ( ( @@ -3084,31 +3283,38 @@ def _objective_expression(self): + self.dsm_do_shed[g, t] * g.cost_dsm_down_shed[t] ) * m.objective_weighting[t] - * ((1 + m.discount_rate) ** -m.es.periods_years[p]) + * (1 + m.discount_rate) ** (-m.es.periods_years[p]) ) if g.investment.fixed_costs[0] is not None: lifetime = g.investment.lifetime for p in m.PERIODS: + range_limit = min( + m.es.end_year_of_optimization, + m.es.periods_years[p] + lifetime, + ) fixed_costs += sum( self.invest[g, p] * g.investment.fixed_costs[pp] - * ((1 + m.discount_rate) ** (-pp)) + * (1 + m.discount_rate) ** (-pp) for pp in range( m.es.periods_years[p], - m.es.periods_years[p] + lifetime, + range_limit, ) - ) * ((1 + m.discount_rate) ** -m.es.periods_years[p]) + ) * (1 + m.discount_rate) ** (-m.es.periods_years[p]) for g in self.EXISTING_INVESTDSM: if g.investment.fixed_costs[0] is not None: lifetime = g.investment.lifetime age = g.investment.age + range_limit = min( + m.es.end_year_of_optimization, lifetime - age + ) fixed_costs += sum( g.investment.existing * g.investment.fixed_costs[pp] - * ((1 + m.discount_rate) ** (-pp)) - for pp in range(0, lifetime - age) + * (1 + m.discount_rate) ** (-pp) + for pp in range(range_limit) ) self.variable_costs = Expression(expr=variable_costs) @@ -3121,6 +3327,69 @@ def _objective_expression(self): return self.costs + def _evaluate_remaining_value_difference( + self, + m, + p, + g, + end_year_of_optimization, + lifetime, + interest, + ): + """Evaluate and return the remaining value difference of an investment + + The remaining value difference in the net present values if the asset + was to be liquidated at the end of the optimization horizon and the + net present value using the original investment expenses. + + Parameters + ---------- + m : oemof.solph.models.Model + Optimization model + + p : int + Period in which investment occurs + + g : oemof.solph.components.experimental.SinkDSM + storage unit + + end_year_of_optimization : int + Last year of the optimization horizon + + lifetime : int + lifetime of investment considered + + interest : float + Demanded interest rate for investment + """ + if m.es.use_remaining_value: + if end_year_of_optimization - m.es.periods_years[p] < lifetime: + remaining_lifetime = lifetime - ( + end_year_of_optimization - m.es.periods_years[p] + ) + remaining_annuity = economics.annuity( + capex=g.investment.ep_costs[-1], + n=remaining_lifetime, + wacc=interest, + ) + original_annuity = economics.annuity( + capex=g.investment.ep_costs[p], + n=remaining_lifetime, + wacc=interest, + ) + present_value_factor_remaining = 1 / economics.annuity( + capex=1, n=remaining_lifetime, wacc=interest + ) + return ( + self.invest[g, p] + * (remaining_annuity - original_annuity) + * present_value_factor_remaining + ) * (1 + m.discount_rate) ** (-end_year_of_optimization) + else: + return 0 + else: + return 0 + class SinkDSMDLRBlock(ScalarBlock): r"""Constraints for SinkDSM with "DLR" approach @@ -3274,6 +3543,12 @@ class SinkDSMDLRBlock(ScalarBlock): \cdot \omega_{t} \\ & \quad \quad \quad \quad \forall t \in \mathbb{T} \\ + * :attr:`fixed_costs` not None + + .. math:: + \displaystyle \sum_{pp=0}^{year_{max}} max\{E_{up, max}, E_{do, max}\} + \cdot c_{fixed}(pp) \cdot DF^{-pp} + **Table: Symbols and attribute names of variables and parameters** .. table:: Variables (V), Parameters (P) and (additional) Sets (S) @@ -3331,6 +3606,7 @@ class SinkDSMDLRBlock(ScalarBlock): | in the optimization timeframe :math:`t_{dayLimit}` `t_dayLimit` P | Maximum duration of load shifts at full capacity per day | resp. in the last hours before the current" + :math:`year_{max}` P Last year of the optimization horizon =========================================== ================================= ==== ======================================= """ # noqa: E501 @@ -4094,7 +4370,7 @@ def _objective_expression(self): * g.cost_dsm_up[t] ) * m.objective_weighting[t] - * ((1 + m.discount_rate) ** -m.es.periods_years[p]) + * (1 + m.discount_rate) ** (-m.es.periods_years[p]) ) variable_costs += ( ( @@ -4107,16 +4383,16 @@ def _objective_expression(self): + self.dsm_do_shed[g, t] * g.cost_dsm_down_shed[t] ) * m.objective_weighting[t] - * ((1 + m.discount_rate) ** -m.es.periods_years[p]) + * (1 + m.discount_rate) ** (-m.es.periods_years[p]) ) if g.fixed_costs[0] is not None: - for p in m.PERIODS: - fixed_costs += ( - max(g.max_capacity_up, g.max_capacity_down) - * g.fixed_costs[p] - * ((1 + m.discount_rate) ** -m.es.periods_years[p]) - ) + fixed_costs += sum( + max(g.max_capacity_up, g.max_capacity_down) + * g.fixed_costs[pp] + * (1 + m.discount_rate) ** (-pp) + for pp in range(m.es.end_year_of_optimization) + ) self.variable_costs = Expression(expr=variable_costs) self.fixed_costs = Expression(expr=fixed_costs) @@ -4299,17 +4575,32 @@ class SinkDSMDLRInvestmentBlock(ScalarBlock): .. math:: & - P_{invest}(p) \cdot A(c_{invest}(p), l, ir) \cdot l - \cdot DF^{-p} \\ + P_{invest}(p) \cdot A(c_{invest}(p), l, ir) + \cdot \frac {1}{ANF(d, ir)} \cdot DF^{-p} \\ &\\ & \forall p \in \mathbb{P} + In case, the remaining lifetime of a DSM unit is greater than 0 and + attribute `use_remaining_value` of the energy system is True, + the difference in value for the investment period compared to the + last period of the optimization horizon is accounted for + as an adder to the investment costs: + + .. math:: + & + P_{invest}(p) \cdot (A(c_{invest,var}(p), l_{r}, ir) - + A(c_{invest,var}(|P|), l_{r}, ir)\\ + & \cdot \frac {1}{ANF(l_{r}, ir)} \cdot DF^{-|P|}\\ + &\\ + & + \forall p \in \textrm{PERIODS} + * :attr:`fixed_costs` not None for investments .. math:: & - (\sum_{pp=year(p)}^{year(p)+l} + (\sum_{pp=year(p)}^{limit_{end}} P_{invest}(p) \cdot c_{fixed}(pp) \cdot DF^{-pp}) \cdot DF^{-p} \\ &\\ @@ -4329,13 +4620,37 @@ class SinkDSMDLRInvestmentBlock(ScalarBlock): \cdot \omega_{t} \cdot DF^{-p} \\ & \quad \quad \quad \quad \forall p, t \in \textrm{TIMEINDEX} \\ - whereby: + where: * :math:`A(c_{invest,var}(p), l, ir)` A is the annuity for - investment expenses :math:`c_{invest}(p)` lifetime :math:`l` - and interest rate :math:`ir` - * :math:`DF=(1+dr)` is the discount factor with discount rate - :math:`dr` + investment expenses :math:`c_{invest,var}(p)`, lifetime :math:`l` + and interest rate :math:`ir`. + * :math:`ANF(d, ir)` is the annuity factor for duration :math:`d` + and interest rate :math:`ir`. + * :math:`d=min\{year_{max} - year(p), l\}` defines the + number of years within the optimization horizon that investment + annuities are accounted for. + * :math:`year(p)` denotes the start year of period :math:`p`. + * :math:`year_{max}` denotes the last year of the optimization + horizon, i.e. at the end of the last period. + * :math:`limit_{end}=min\{year_{max}, year(p) + l\}` is used as an + upper bound to ensure fixed costs for endogenous investments + to occur within the optimization horizon. + * :math:`DF=(1+dr)` is the discount factor. + + The annuity / annuity factor hereby is: + + .. math:: + & + A(c_{invest,var}(p), l, ir) = c_{invest,var}(p) \cdot + \frac {(1+ir)^l \cdot ir} {(1+ir)^l - 1}\\ + &\\ + & + ANF(d, ir)=\frac {(1+dr)^d \cdot dr} {(1+dr)^d - 1} + + They are retrieved, using oemof.tools.economics annuity function. The + interest rate :math:`ir` for the annuity is defined as weighted + average costs of capital (wacc) and assumed constant over time. See remarks in :class:`oemof.solph.components.experimental._sink_dsm.SinkDSMOemofBlock`. @@ -5412,13 +5727,31 @@ def _objective_expression(self): n=lifetime, wacc=interest, ) + duration = min( + m.es.end_year_of_optimization + - m.es.periods_years[p], + lifetime, + ) + present_value_factor = 1 / economics.annuity( + capex=1, n=duration, wacc=interest + ) investment_costs_increment = ( - self.invest[g, p] - * annuity - * lifetime - * ((1 + m.discount_rate) ** -m.es.periods_years[p]) + self.invest[g, p] * annuity * present_value_factor + ) * (1 + m.discount_rate) ** (-m.es.periods_years[p]) + remaining_value_difference = ( + self._evaluate_remaining_value_difference( + m, + p, + g, + m.es.end_year_of_optimization, + lifetime, + interest, + ) + ) + investment_costs += ( + investment_costs_increment + + remaining_value_difference ) - investment_costs += investment_costs_increment period_investment_costs[ p ] += investment_costs_increment @@ -5436,7 +5769,7 @@ def _objective_expression(self): * g.cost_dsm_up[t] ) * m.objective_weighting[t] - * ((1 + m.discount_rate) ** -m.es.periods_years[p]) + * (1 + m.discount_rate) ** (-m.es.periods_years[p]) ) variable_costs += ( ( @@ -5449,31 +5782,38 @@ def _objective_expression(self): + self.dsm_do_shed[g, t] * g.cost_dsm_down_shed[t] ) * m.objective_weighting[t] - * ((1 + m.discount_rate) ** -m.es.periods_years[p]) + * (1 + m.discount_rate) ** (-m.es.periods_years[p]) ) if g.investment.fixed_costs[0] is not None: lifetime = g.investment.lifetime for p in m.PERIODS: + range_limit = min( + m.es.end_year_of_optimization, + m.es.periods_years[p] + lifetime, + ) fixed_costs += sum( self.invest[g, p] * g.investment.fixed_costs[pp] - * ((1 + m.discount_rate) ** (-pp)) + * (1 + m.discount_rate) ** (-pp) for pp in range( m.es.periods_years[p], - m.es.periods_years[p] + lifetime, + range_limit, ) - ) * ((1 + m.discount_rate) ** -m.es.periods_years[p]) + ) * (1 + m.discount_rate) ** (-m.es.periods_years[p]) for g in self.EXISTING_INVESTDSM: if g.investment.fixed_costs[0] is not None: lifetime = g.investment.lifetime age = g.investment.age + range_limit = min( + m.es.end_year_of_optimization, lifetime - age + ) fixed_costs += sum( g.investment.existing * g.investment.fixed_costs[pp] - * ((1 + m.discount_rate) ** (-pp)) - for pp in range(0, lifetime - age) + * (1 + m.discount_rate) ** (-pp) + for pp in range(range_limit) ) self.variable_costs = Expression(expr=variable_costs) @@ -5485,3 +5825,66 @@ def _objective_expression(self): ) return self.costs + + def _evaluate_remaining_value_difference( + self, + m, + p, + g, + end_year_of_optimization, + lifetime, + interest, + ): + """Evaluate and return the remaining value difference of an investment + + The remaining value difference in the net present values if the asset + was to be liquidated at the end of the optimization horizon and the + net present value using the original investment expenses. + + Parameters + ---------- + m : oemof.solph.models.Model + Optimization model + + p : int + Period in which investment occurs + + g : oemof.solph.components.experimental.SinkDSM + storage unit + + end_year_of_optimization : int + Last year of the optimization horizon + + lifetime : int + lifetime of investment considered + + interest : float + Demanded interest rate for investment + """ + if m.es.use_remaining_value: + if end_year_of_optimization - m.es.periods_years[p] < lifetime: + remaining_lifetime = lifetime - ( + end_year_of_optimization - m.es.periods_years[p] + ) + remaining_annuity = economics.annuity( + capex=g.investment.ep_costs[-1], + n=remaining_lifetime, + wacc=interest, + ) + original_annuity = economics.annuity( + capex=g.investment.ep_costs[p], + n=remaining_lifetime, + wacc=interest, + ) + present_value_factor_remaining = 1 / economics.annuity( + capex=1, n=remaining_lifetime, wacc=interest + ) + return ( + self.invest[g, p] + * (remaining_annuity - original_annuity) + * present_value_factor_remaining + ) * (1 + m.discount_rate) ** (-end_year_of_optimization) + else: + return 0 + else: + return 0 diff --git a/src/oemof/solph/flows/_flow.py b/src/oemof/solph/flows/_flow.py index 964f570d1..ae9b4e6e6 100644 --- a/src/oemof/solph/flows/_flow.py +++ b/src/oemof/solph/flows/_flow.py @@ -86,7 +86,8 @@ class Flow(Edge): :class:`~oemof.solph.flows._simple_flow_block.SimpleFlowBlock`. fixed_costs : numeric (iterable or scalar), :math:`c_{fixed}` The fixed costs associated with a flow. - Note: These are only applicable for a multi-period model. + Note: These are only applicable for a multi-period model + and given on a yearly basis. lifetime : int, :math:`l` The lifetime of a flow (usually given in years); once it reaches its lifetime (considering also @@ -200,13 +201,14 @@ def __init__( if fixed_costs is not None: msg = ( "Be aware that the fixed costs attribute is only\n" - "meant to be used for multi-period models.\n" + "meant to be used for multi-period models to depict " + "fixed costs that occur on a yearly basis.\n" "If you wish to set up a multi-period model, explicitly " "set the `periods` attribute of your energy system.\n" "It has been decided to remove the `fixed_costs` " "attribute with v0.2 for regular uses.\n" "If you specify `fixed_costs` for a regular model, " - "it will simply be ignored." + "this will simply be silently ignored." ) warn(msg, debugging.SuspiciousUsageWarning) diff --git a/src/oemof/solph/flows/_investment_flow_block.py b/src/oemof/solph/flows/_investment_flow_block.py index f763d2c7e..a8d795ce7 100644 --- a/src/oemof/solph/flows/_investment_flow_block.py +++ b/src/oemof/solph/flows/_investment_flow_block.py @@ -336,7 +336,7 @@ def _create_constraints(self): & \forall p \in \textrm{PERIODS} - whereby: + where: * (*) is only performed for the first period the condition is True. A decommissioning flag is then set to True @@ -770,7 +770,7 @@ def _objective_expression(self): P_{invest}(0) \cdot c_{invest,var}(0) + c_{invest,fix}(0) \cdot Y_{invest}(0) \\ - Whereby 0 denotes the 0th (investment) period since + Where 0 denotes the 0th (investment) period since in a standard model, there is only this one period. *Multi-period model* @@ -779,8 +779,23 @@ def _objective_expression(self): .. math:: & - P_{invest}(p) \cdot A(c_{invest,var}(p), l, ir) \cdot l - \cdot DF^{-p}\\ + P_{invest}(p) \cdot A(c_{invest,var}(p), l, ir) + \cdot \frac {1}{ANF(d, ir)} \cdot DF^{-p}\\ + &\\ + & + \forall p \in \textrm{PERIODS} + + In case, the remaining lifetime of an asset is greater than 0 and + attribute `use_remaining_value` of the energy system is True, + the difference in value for the investment period compared to the + last period of the optimization horizon is accounted for + as an adder to the investment costs: + + .. math:: + & + P_{invest}(p) \cdot (A(c_{invest,var}(p), l_{r}, ir) - + A(c_{invest,var}(|P|), l_{r}, ir)\\ + & \cdot \frac {1}{ANF(l_{r}, ir)} \cdot DF^{-|P|}\\ &\\ & \forall p \in \textrm{PERIODS} @@ -789,8 +804,28 @@ def _objective_expression(self): .. math:: & - (P_{invest}(p) \cdot A(c_{invest,var}(p), l, ir) \cdot l - + c_{invest,fix}(p) \cdot b_{invest}(p)) \cdot DF^{-p} \\ + (P_{invest}(p) \cdot A(c_{invest,var}(p), l, ir) + \cdot \frac {1}{ANF(d, ir)}\\ + & + + c_{invest,fix}(p) \cdot b_{invest}(p)) \cdot DF^{-p}\\ + &\\ + & + \forall p \in \textrm{PERIODS} + + In case, the remaining lifetime of an asset is greater than 0 and + attribute `use_remaining_value` of the energy system is True, + the difference in value for the investment period compared to the + last period of the optimization horizon is accounted for + as an adder to the investment costs: + + .. math:: + & + (P_{invest}(p) \cdot (A(c_{invest,var}(p), l_{r}, ir) - + A(c_{invest,var}(|P|), l_{r}, ir)\\ + & \cdot \frac {1}{ANF(l_{r}, ir)} \cdot DF^{-|P|}\\ + & + + (c_{invest,fix}(p) - c_{invest,fix}(|P|)) + \cdot b_{invest}(p)) \cdot DF^{-p}\\ &\\ & \forall p \in \textrm{PERIODS} @@ -799,7 +834,7 @@ def _objective_expression(self): .. math:: & - (\sum_{pp=year(p)}^{year(p)+l} + (\sum_{pp=year(p)}^{limit_{end}} P_{invest}(p) \cdot c_{fixed}(pp) \cdot DF^{-pp}) \cdot DF^{-p}\\ &\\ @@ -809,28 +844,49 @@ def _objective_expression(self): * :attr:`fixed_costs` not None for existing capacity .. math:: - \sum_{pp=0}^{l-a} P_{exist} \cdot c_{fixed}(pp) + \sum_{pp=0}^{limit_{exo}} P_{exist} \cdot c_{fixed}(pp) \cdot DF^{-pp} - whereby: - - * :math:`A(c_{invest,var}(p), l, ir)` A is the annuity for - investment expenses :math:`c_{invest,var}(p)` lifetime :math:`l` - and interest rate :math:`ir` - * :math:`DF=(1+dr)` is the discount factor with discount rate - :math:`dr` - - The annuity hereby is: + where: + + * :math:`A(c_{invest,var}(p), l, ir)` A is the annuity for + investment expenses :math:`c_{invest,var}(p)`, lifetime :math:`l` + and interest rate :math:`ir`. + * :math:`l_{r}` is the remaining lifetime at the end of the + optimization horizon (in case it is greater than 0 and + smaller than the actual lifetime). + * :math:`ANF(d, ir)` is the annuity factor for duration :math:`d` + and interest rate :math:`ir`. + * :math:`d=min\{year_{max} - year(p), l\}` defines the + number of years within the optimization horizon that investment + annuities are accounted for. + * :math:`year(p)` denotes the start year of period :math:`p`. + * :math:`year_{max}` denotes the last year of the optimization + horizon, i.e. at the end of the last period. + * :math:`limit_{end}=min\{year_{max}, year(p) + l\}` is used as an + upper bound to ensure fixed costs for endogenous investments + to occur within the optimization horizon. + * :math:`limit_{exo}=min\{year_{max}, l - a\}` is used as an + upper bound to ensure fixed costs for existing capacities to occur + within the optimization horizon. :math:`a` is the initial age + of an asset. + * :math:`DF=(1+dr)` is the discount factor. + + The annuity / annuity factor hereby is: .. math:: - + & A(c_{invest,var}(p), l, ir) = c_{invest,var}(p) \cdot - \frac {(1+i)^l \cdot i} {(1+i)^l - 1} \cdot + \frac {(1+ir)^l \cdot ir} {(1+ir)^l - 1}\\ + &\\ + & + ANF(d, ir)=\frac {(1+ir)^d \cdot ir} {(1+ir)^d - 1} - It is retrieved, using oemof.tools.economics annuity function. The - interest rate is defined as a weighted average costs of capital (wacc) - and assumed constant over time. + They are derived using the reciprocal of the oemof.tools.economics + annuity function with a capex of 1. + The interest rate :math:`ir` for the annuity is defined as weighted + average costs of capital (wacc) and assumed constant over time. """ if not hasattr(self, "INVESTFLOWS"): return 0 @@ -865,7 +921,6 @@ def _objective_expression(self): "social planner point of view and does not reflect " "microeconomic interest requirements." ) - for i, o in self.CONVEX_INVESTFLOWS: lifetime = m.flows[i, o].investment.lifetime interest = m.flows[i, o].investment.interest_rate @@ -881,13 +936,32 @@ def _objective_expression(self): n=lifetime, wacc=interest, ) + duration = min( + m.es.end_year_of_optimization - m.es.periods_years[p], + lifetime, + ) + present_value_factor_remaining = 1 / economics.annuity( + capex=1, n=duration, wacc=interest + ) investment_costs_increment = ( self.invest[i, o, p] * annuity - * lifetime - * ((1 + m.discount_rate) ** (-m.es.periods_years[p])) + * present_value_factor_remaining + ) * (1 + m.discount_rate) ** (-m.es.periods_years[p]) + remaining_value_difference = ( + self._evaluate_remaining_value_difference( + m, + p, + i, + o, + m.es.end_year_of_optimization, + lifetime, + interest, + ) + ) + investment_costs += ( + investment_costs_increment + remaining_value_difference ) - investment_costs += investment_costs_increment period_investment_costs[p] += investment_costs_increment for i, o in self.NON_CONVEX_INVESTFLOWS: @@ -905,37 +979,67 @@ def _objective_expression(self): n=lifetime, wacc=interest, ) + duration = min( + m.es.end_year_of_optimization - m.es.periods_years[p], + lifetime, + ) + present_value_factor_remaining = 1 / economics.annuity( + capex=1, n=duration, wacc=interest + ) investment_costs_increment = ( - self.invest[i, o, p] * annuity * lifetime + self.invest[i, o, p] + * annuity + * present_value_factor_remaining + self.invest_status[i, o, p] * m.flows[i, o].investment.offset[p] - ) * ((1 + m.discount_rate) ** (-m.es.periods_years[p])) - investment_costs += investment_costs_increment + ) * (1 + m.discount_rate) ** (-m.es.periods_years[p]) + remaining_value_difference = ( + self._evaluate_remaining_value_difference( + m, + p, + i, + o, + m.es.end_year_of_optimization, + lifetime, + interest, + nonconvex=True, + ) + ) + investment_costs += ( + investment_costs_increment + remaining_value_difference + ) period_investment_costs[p] += investment_costs_increment for i, o in self.INVESTFLOWS: if m.flows[i, o].investment.fixed_costs[0] is not None: lifetime = m.flows[i, o].investment.lifetime for p in m.PERIODS: + range_limit = min( + m.es.end_year_of_optimization, + m.es.periods_years[p] + lifetime, + ) fixed_costs += sum( self.invest[i, o, p] * m.flows[i, o].investment.fixed_costs[pp] - * ((1 + m.discount_rate) ** (-pp)) + * (1 + m.discount_rate) ** (-pp) for pp in range( m.es.periods_years[p], - m.es.periods_years[p] + lifetime, + range_limit, ) - ) * ((1 + m.discount_rate) ** (-m.es.periods_years[p])) + ) * (1 + m.discount_rate) ** (-m.es.periods_years[p]) for i, o in self.EXISTING_INVESTFLOWS: if m.flows[i, o].investment.fixed_costs[0] is not None: lifetime = m.flows[i, o].investment.lifetime age = m.flows[i, o].investment.age + range_limit = min( + m.es.end_year_of_optimization, lifetime - age + ) fixed_costs += sum( m.flows[i, o].investment.existing * m.flows[i, o].investment.fixed_costs[pp] - * ((1 + m.discount_rate) ** (-pp)) - for pp in range(0, lifetime - age) + * (1 + m.discount_rate) ** (-pp) + for pp in range(range_limit) ) self.investment_costs = Expression(expr=investment_costs) @@ -945,6 +1049,90 @@ def _objective_expression(self): return self.costs + def _evaluate_remaining_value_difference( + self, + m, + p, + i, + o, + end_year_of_optimization, + lifetime, + interest, + nonconvex=False, + ): + """Evaluate and return the remaining value difference of an investment + + The remaining value difference in the net present values if the asset + was to be liquidated at the end of the optimization horizon and the + net present value using the original investment expenses. + + Parameters + ---------- + m : oemof.solph.models.Model + Optimization model + + p : int + Period in which investment occurs + + i : any instance of oemof.solph.components + start node of flow + + o : any instance of oemof.solph.components + end node of flow + + end_year_of_optimization : int + Last year of the optimization horizon + + lifetime : int + lifetime of investment considered + + interest : float + Demanded interest rate for investment + + nonconvex : bool + Indicating whether considered flow is nonconvex. + """ + if m.es.use_remaining_value: + if end_year_of_optimization - m.es.periods_years[p] < lifetime: + remaining_lifetime = lifetime - ( + end_year_of_optimization - m.es.periods_years[p] + ) + remaining_annuity = economics.annuity( + capex=m.flows[i, o].investment.ep_costs[-1], + n=remaining_lifetime, + wacc=interest, + ) + original_annuity = economics.annuity( + capex=m.flows[i, o].investment.ep_costs[p], + n=remaining_lifetime, + wacc=interest, + ) + present_value_factor_remaining = 1 / economics.annuity( + capex=1, n=remaining_lifetime, wacc=interest + ) + convex_investment_costs = ( + self.invest[i, o, p] + * (remaining_annuity - original_annuity) + * present_value_factor_remaining + ) * (1 + m.discount_rate) ** (-end_year_of_optimization) + if nonconvex: + return convex_investment_costs + self.invest_status[ + i, o, p + ] * ( + m.flows[i, o].investment.offset[-1] + - m.flows[i, o].investment.offset[p] + ) * ( + 1 + m.discount_rate + ) ** ( + -end_year_of_optimization + ) + else: + return convex_investment_costs + else: + return 0 + else: + return 0 + def _minimum_investment_constraint(self): """Constraint factory for a minimum investment""" m = self.parent_block() diff --git a/src/oemof/solph/flows/_simple_flow_block.py b/src/oemof/solph/flows/_simple_flow_block.py index 6df02bf70..eb4d55c26 100644 --- a/src/oemof/solph/flows/_simple_flow_block.py +++ b/src/oemof/solph/flows/_simple_flow_block.py @@ -415,9 +415,9 @@ def _objective_expression(self): .. math:: \sum_{(i,o)} \sum_t P(t) \cdot w(t) \cdot c_{var}(i, o, t) - whereby :math:`w(t)` is the objective weighting. + where :math:`w(t)` is the objective weighting. - In a multi-period model, in contrast, the following following parts of + In a multi-period model, in contrast, the following parts of the objective function are created: * `Flow.variable_costs` is not `None`: @@ -427,25 +427,32 @@ def _objective_expression(self): * `Flow.fixed_costs` is not `None` and flow has no lifetime limit .. math:: - \sum_{(i,o)} \sum_p P_{nominal} \cdot c_{fixed}(i, o, p) - \cdot DF^{-p} + \sum_{(i,o)} \displaystyle \sum_{pp=0}^{year_{max}} + P_{nominal} \cdot c_{fixed}(i, o, pp) \cdot DF^{-pp} * `Flow.fixed_costs` is not `None` and flow has a lifetime limit, but not an initial age .. math:: - \sum_{(i,o)} \sum_{p}^{p+n} P_{nominal} \cdot c_{fixed}(i, o, p) - \cdot DF^{-p} + \sum_{(i,o)} \displaystyle \sum_{pp=0}^{limit_{exo}} + P_{nominal} \cdot c_{fixed}(i, o, pp) \cdot DF^{-pp} * `Flow.fixed_costs` is not `None` and flow has a lifetime limit, and an initial age .. math:: - \sum_{(i,o)} \sum_{p}^{p+n-a} P_{nominal} - \cdot c_{fixed}(i, o, p) \cdot DF^{-p} + \sum_{(i,o)} \displaystyle \sum_{pp=0}^{limit_{exo}} P_{nominal} + \cdot c_{fixed}(i, o, pp) \cdot DF^{-pp} Hereby + * :math:`DF(p) = (1 + dr)` is the discount factor for period :math:`p` - and :math:`dr` is the discount rate. + and :math:`dr` is the discount rate. * :math:`n` is the unit lifetime and :math:`a` is the initial age. + * :math:`year_{max}` denotes the last year of the optimization + horizon, i.e. at the end of the last period. + * :math:`limit_{exo}=min\{year_{max}, n - a\}` is used as an + upper bound to ensure fixed costs for existing capacities to occur + within the optimization horizon. :math:`a` is the initial age + of an asset (or 0 if not specified). """ m = self.parent_block() @@ -473,39 +480,45 @@ def _objective_expression(self): * ((1 + m.discount_rate) ** -m.es.periods_years[p]) ) - # Include fixed costs of units operating "forever" + # Fixed costs for units with no lifetime limit if ( m.flows[i, o].fixed_costs[0] is not None and m.flows[i, o].nominal_value is not None and (i, o) not in self.LIFETIME_FLOWS and (i, o) not in self.LIFETIME_AGE_FLOWS ): - for p in m.PERIODS: - fixed_costs += ( - m.flows[i, o].nominal_value - * m.flows[i, o].fixed_costs[p] - * ((1 + m.discount_rate) ** -m.es.periods_years[p]) - ) + fixed_costs += sum( + m.flows[i, o].nominal_value + * m.flows[i, o].fixed_costs[pp] + * ((1 + m.discount_rate) ** (-pp)) + for pp in range(m.es.end_year_of_optimization) + ) # Fixed costs for units with limited lifetime for i, o in self.LIFETIME_FLOWS: if m.flows[i, o].fixed_costs[0] is not None: + range_limit = min( + m.es.end_year_of_optimization, + m.flows[i, o].lifetime, + ) fixed_costs += sum( m.flows[i, o].nominal_value * m.flows[i, o].fixed_costs[pp] * ((1 + m.discount_rate) ** (-pp)) - for pp in range(0, m.flows[i, o].lifetime) + for pp in range(range_limit) ) for i, o in self.LIFETIME_AGE_FLOWS: if m.flows[i, o].fixed_costs[0] is not None: + range_limit = min( + m.es.end_year_of_optimization, + m.flows[i, o].lifetime - m.flows[i, o].age, + ) fixed_costs += sum( m.flows[i, o].nominal_value * m.flows[i, o].fixed_costs[pp] * ((1 + m.discount_rate) ** (-pp)) - for pp in range( - 0, m.flows[i, o].lifetime - m.flows[i, o].age - ) + for pp in range(range_limit) ) self.variable_costs = Expression(expr=variable_costs) diff --git a/tests/lp_files/connect_investment_multi_period.lp b/tests/lp_files/connect_investment_multi_period.lp index cc22c48bc..75e8a280e 100644 --- a/tests/lp_files/connect_investment_multi_period.lp +++ b/tests/lp_files/connect_investment_multi_period.lp @@ -2,21 +2,21 @@ min objective: -+127.95247418638057 InvestmentFlowBlock_invest(Source_Bus1_0) -+125.44360214351036 InvestmentFlowBlock_invest(Source_Bus1_1) -+122.9839236701082 InvestmentFlowBlock_invest(Source_Bus1_2) -+520.1320088877258 InvestmentFlowBlock_invest(Bus1_Sink_0) -+509.93334204678996 InvestmentFlowBlock_invest(Bus1_Sink_1) -+499.9346490654803 InvestmentFlowBlock_invest(Bus1_Sink_2) -+150.83828257744048 GenericInvestmentStorageBlock_invest(storage_0) -+147.8806691935691 GenericInvestmentStorageBlock_invest(storage_1) -+144.9810482289893 GenericInvestmentStorageBlock_invest(storage_2) ++499.99999999999994 InvestmentFlowBlock_invest(Bus1_Sink_0) ++330.02221931773533 InvestmentFlowBlock_invest(Bus1_Sink_1) ++163.37733629590875 InvestmentFlowBlock_invest(Bus1_Sink_2) ++123.0 InvestmentFlowBlock_invest(Source_Bus1_0) ++81.1854659521629 InvestmentFlowBlock_invest(Source_Bus1_1) ++40.19082472879356 InvestmentFlowBlock_invest(Source_Bus1_2) ++144.99999999999997 GenericInvestmentStorageBlock_invest(storage_0) ++95.70644360214325 GenericInvestmentStorageBlock_invest(storage_1) ++47.37942752581354 GenericInvestmentStorageBlock_invest(storage_2) s.t. c_e__equate_InvestmentFlowBlock_invest(Source_Bus1_0)_InvestmentFlowBlock_invest(Bus1_Sink_0)__: -+2 InvestmentFlowBlock_invest(Source_Bus1_0) -1 InvestmentFlowBlock_invest(Bus1_Sink_0) ++2 InvestmentFlowBlock_invest(Source_Bus1_0) = 0 c_e__equate_InvestmentFlowBlock_invest(Source_Bus1_0)_GenericInvestmentStorageBlock_invest(storage_0)__: @@ -66,23 +66,23 @@ c_e_BusBlock_balance(Bus1_2_5)_: -1 flow(Bus1_Sink_2_5) = 0 -c_e_InvestmentFlowBlock_total_rule(Source_Bus1_0)_: --1 InvestmentFlowBlock_invest(Source_Bus1_0) -+1 InvestmentFlowBlock_total(Source_Bus1_0) +c_e_InvestmentFlowBlock_total_rule(Bus1_Sink_0)_: +-1 InvestmentFlowBlock_invest(Bus1_Sink_0) ++1 InvestmentFlowBlock_total(Bus1_Sink_0) = 0 -c_e_InvestmentFlowBlock_total_rule(Source_Bus1_1)_: --1 InvestmentFlowBlock_invest(Source_Bus1_1) --1 InvestmentFlowBlock_total(Source_Bus1_0) -+1 InvestmentFlowBlock_total(Source_Bus1_1) -+1 InvestmentFlowBlock_old(Source_Bus1_1) +c_e_InvestmentFlowBlock_total_rule(Bus1_Sink_1)_: +-1 InvestmentFlowBlock_invest(Bus1_Sink_1) +-1 InvestmentFlowBlock_total(Bus1_Sink_0) ++1 InvestmentFlowBlock_total(Bus1_Sink_1) ++1 InvestmentFlowBlock_old(Bus1_Sink_1) = 0 -c_e_InvestmentFlowBlock_total_rule(Source_Bus1_2)_: --1 InvestmentFlowBlock_invest(Source_Bus1_2) --1 InvestmentFlowBlock_total(Source_Bus1_1) -+1 InvestmentFlowBlock_total(Source_Bus1_2) -+1 InvestmentFlowBlock_old(Source_Bus1_2) +c_e_InvestmentFlowBlock_total_rule(Bus1_Sink_2)_: +-1 InvestmentFlowBlock_invest(Bus1_Sink_2) +-1 InvestmentFlowBlock_total(Bus1_Sink_1) ++1 InvestmentFlowBlock_total(Bus1_Sink_2) ++1 InvestmentFlowBlock_old(Bus1_Sink_2) = 0 c_e_InvestmentFlowBlock_total_rule(Bus1_storage_0)_: @@ -104,23 +104,23 @@ c_e_InvestmentFlowBlock_total_rule(Bus1_storage_2)_: +1 InvestmentFlowBlock_old(Bus1_storage_2) = 0 -c_e_InvestmentFlowBlock_total_rule(Bus1_Sink_0)_: --1 InvestmentFlowBlock_invest(Bus1_Sink_0) -+1 InvestmentFlowBlock_total(Bus1_Sink_0) +c_e_InvestmentFlowBlock_total_rule(Source_Bus1_0)_: +-1 InvestmentFlowBlock_invest(Source_Bus1_0) ++1 InvestmentFlowBlock_total(Source_Bus1_0) = 0 -c_e_InvestmentFlowBlock_total_rule(Bus1_Sink_1)_: --1 InvestmentFlowBlock_invest(Bus1_Sink_1) --1 InvestmentFlowBlock_total(Bus1_Sink_0) -+1 InvestmentFlowBlock_total(Bus1_Sink_1) -+1 InvestmentFlowBlock_old(Bus1_Sink_1) +c_e_InvestmentFlowBlock_total_rule(Source_Bus1_1)_: +-1 InvestmentFlowBlock_invest(Source_Bus1_1) +-1 InvestmentFlowBlock_total(Source_Bus1_0) ++1 InvestmentFlowBlock_total(Source_Bus1_1) ++1 InvestmentFlowBlock_old(Source_Bus1_1) = 0 -c_e_InvestmentFlowBlock_total_rule(Bus1_Sink_2)_: --1 InvestmentFlowBlock_invest(Bus1_Sink_2) --1 InvestmentFlowBlock_total(Bus1_Sink_1) -+1 InvestmentFlowBlock_total(Bus1_Sink_2) -+1 InvestmentFlowBlock_old(Bus1_Sink_2) +c_e_InvestmentFlowBlock_total_rule(Source_Bus1_2)_: +-1 InvestmentFlowBlock_invest(Source_Bus1_2) +-1 InvestmentFlowBlock_total(Source_Bus1_1) ++1 InvestmentFlowBlock_total(Source_Bus1_2) ++1 InvestmentFlowBlock_old(Source_Bus1_2) = 0 c_e_InvestmentFlowBlock_total_rule(storage_Bus1_0)_: @@ -142,16 +142,16 @@ c_e_InvestmentFlowBlock_total_rule(storage_Bus1_2)_: +1 InvestmentFlowBlock_old(storage_Bus1_2) = 0 -c_e_InvestmentFlowBlock_old_rule_end(Source_Bus1_0)_: -+1 InvestmentFlowBlock_old_end(Source_Bus1_0) +c_e_InvestmentFlowBlock_old_rule_end(Bus1_Sink_0)_: ++1 InvestmentFlowBlock_old_end(Bus1_Sink_0) = 0 -c_e_InvestmentFlowBlock_old_rule_end(Source_Bus1_1)_: -+1 InvestmentFlowBlock_old_end(Source_Bus1_1) +c_e_InvestmentFlowBlock_old_rule_end(Bus1_Sink_1)_: ++1 InvestmentFlowBlock_old_end(Bus1_Sink_1) = 0 -c_e_InvestmentFlowBlock_old_rule_end(Source_Bus1_2)_: -+1 InvestmentFlowBlock_old_end(Source_Bus1_2) +c_e_InvestmentFlowBlock_old_rule_end(Bus1_Sink_2)_: ++1 InvestmentFlowBlock_old_end(Bus1_Sink_2) = 0 c_e_InvestmentFlowBlock_old_rule_end(Bus1_storage_0)_: @@ -166,16 +166,16 @@ c_e_InvestmentFlowBlock_old_rule_end(Bus1_storage_2)_: +1 InvestmentFlowBlock_old_end(Bus1_storage_2) = 0 -c_e_InvestmentFlowBlock_old_rule_end(Bus1_Sink_0)_: -+1 InvestmentFlowBlock_old_end(Bus1_Sink_0) +c_e_InvestmentFlowBlock_old_rule_end(Source_Bus1_0)_: ++1 InvestmentFlowBlock_old_end(Source_Bus1_0) = 0 -c_e_InvestmentFlowBlock_old_rule_end(Bus1_Sink_1)_: -+1 InvestmentFlowBlock_old_end(Bus1_Sink_1) +c_e_InvestmentFlowBlock_old_rule_end(Source_Bus1_1)_: ++1 InvestmentFlowBlock_old_end(Source_Bus1_1) = 0 -c_e_InvestmentFlowBlock_old_rule_end(Bus1_Sink_2)_: -+1 InvestmentFlowBlock_old_end(Bus1_Sink_2) +c_e_InvestmentFlowBlock_old_rule_end(Source_Bus1_2)_: ++1 InvestmentFlowBlock_old_end(Source_Bus1_2) = 0 c_e_InvestmentFlowBlock_old_rule_end(storage_Bus1_0)_: @@ -190,16 +190,16 @@ c_e_InvestmentFlowBlock_old_rule_end(storage_Bus1_2)_: +1 InvestmentFlowBlock_old_end(storage_Bus1_2) = 0 -c_e_InvestmentFlowBlock_old_rule_exo(Source_Bus1_0)_: -+1 InvestmentFlowBlock_old_exo(Source_Bus1_0) +c_e_InvestmentFlowBlock_old_rule_exo(Bus1_Sink_0)_: ++1 InvestmentFlowBlock_old_exo(Bus1_Sink_0) = 0 -c_e_InvestmentFlowBlock_old_rule_exo(Source_Bus1_1)_: -+1 InvestmentFlowBlock_old_exo(Source_Bus1_1) +c_e_InvestmentFlowBlock_old_rule_exo(Bus1_Sink_1)_: ++1 InvestmentFlowBlock_old_exo(Bus1_Sink_1) = 0 -c_e_InvestmentFlowBlock_old_rule_exo(Source_Bus1_2)_: -+1 InvestmentFlowBlock_old_exo(Source_Bus1_2) +c_e_InvestmentFlowBlock_old_rule_exo(Bus1_Sink_2)_: ++1 InvestmentFlowBlock_old_exo(Bus1_Sink_2) = 0 c_e_InvestmentFlowBlock_old_rule_exo(Bus1_storage_0)_: @@ -214,16 +214,16 @@ c_e_InvestmentFlowBlock_old_rule_exo(Bus1_storage_2)_: +1 InvestmentFlowBlock_old_exo(Bus1_storage_2) = 0 -c_e_InvestmentFlowBlock_old_rule_exo(Bus1_Sink_0)_: -+1 InvestmentFlowBlock_old_exo(Bus1_Sink_0) +c_e_InvestmentFlowBlock_old_rule_exo(Source_Bus1_0)_: ++1 InvestmentFlowBlock_old_exo(Source_Bus1_0) = 0 -c_e_InvestmentFlowBlock_old_rule_exo(Bus1_Sink_1)_: -+1 InvestmentFlowBlock_old_exo(Bus1_Sink_1) +c_e_InvestmentFlowBlock_old_rule_exo(Source_Bus1_1)_: ++1 InvestmentFlowBlock_old_exo(Source_Bus1_1) = 0 -c_e_InvestmentFlowBlock_old_rule_exo(Bus1_Sink_2)_: -+1 InvestmentFlowBlock_old_exo(Bus1_Sink_2) +c_e_InvestmentFlowBlock_old_rule_exo(Source_Bus1_2)_: ++1 InvestmentFlowBlock_old_exo(Source_Bus1_2) = 0 c_e_InvestmentFlowBlock_old_rule_exo(storage_Bus1_0)_: @@ -238,22 +238,22 @@ c_e_InvestmentFlowBlock_old_rule_exo(storage_Bus1_2)_: +1 InvestmentFlowBlock_old_exo(storage_Bus1_2) = 0 -c_e_InvestmentFlowBlock_old_rule(Source_Bus1_0)_: --1 InvestmentFlowBlock_old_end(Source_Bus1_0) --1 InvestmentFlowBlock_old_exo(Source_Bus1_0) -+1 InvestmentFlowBlock_old(Source_Bus1_0) +c_e_InvestmentFlowBlock_old_rule(Bus1_Sink_0)_: +-1 InvestmentFlowBlock_old_end(Bus1_Sink_0) +-1 InvestmentFlowBlock_old_exo(Bus1_Sink_0) ++1 InvestmentFlowBlock_old(Bus1_Sink_0) = 0 -c_e_InvestmentFlowBlock_old_rule(Source_Bus1_1)_: -+1 InvestmentFlowBlock_old(Source_Bus1_1) --1 InvestmentFlowBlock_old_end(Source_Bus1_1) --1 InvestmentFlowBlock_old_exo(Source_Bus1_1) +c_e_InvestmentFlowBlock_old_rule(Bus1_Sink_1)_: ++1 InvestmentFlowBlock_old(Bus1_Sink_1) +-1 InvestmentFlowBlock_old_end(Bus1_Sink_1) +-1 InvestmentFlowBlock_old_exo(Bus1_Sink_1) = 0 -c_e_InvestmentFlowBlock_old_rule(Source_Bus1_2)_: -+1 InvestmentFlowBlock_old(Source_Bus1_2) --1 InvestmentFlowBlock_old_end(Source_Bus1_2) --1 InvestmentFlowBlock_old_exo(Source_Bus1_2) +c_e_InvestmentFlowBlock_old_rule(Bus1_Sink_2)_: ++1 InvestmentFlowBlock_old(Bus1_Sink_2) +-1 InvestmentFlowBlock_old_end(Bus1_Sink_2) +-1 InvestmentFlowBlock_old_exo(Bus1_Sink_2) = 0 c_e_InvestmentFlowBlock_old_rule(Bus1_storage_0)_: @@ -274,22 +274,22 @@ c_e_InvestmentFlowBlock_old_rule(Bus1_storage_2)_: -1 InvestmentFlowBlock_old_exo(Bus1_storage_2) = 0 -c_e_InvestmentFlowBlock_old_rule(Bus1_Sink_0)_: --1 InvestmentFlowBlock_old_end(Bus1_Sink_0) --1 InvestmentFlowBlock_old_exo(Bus1_Sink_0) -+1 InvestmentFlowBlock_old(Bus1_Sink_0) +c_e_InvestmentFlowBlock_old_rule(Source_Bus1_0)_: +-1 InvestmentFlowBlock_old_end(Source_Bus1_0) +-1 InvestmentFlowBlock_old_exo(Source_Bus1_0) ++1 InvestmentFlowBlock_old(Source_Bus1_0) = 0 -c_e_InvestmentFlowBlock_old_rule(Bus1_Sink_1)_: -+1 InvestmentFlowBlock_old(Bus1_Sink_1) --1 InvestmentFlowBlock_old_end(Bus1_Sink_1) --1 InvestmentFlowBlock_old_exo(Bus1_Sink_1) +c_e_InvestmentFlowBlock_old_rule(Source_Bus1_1)_: ++1 InvestmentFlowBlock_old(Source_Bus1_1) +-1 InvestmentFlowBlock_old_end(Source_Bus1_1) +-1 InvestmentFlowBlock_old_exo(Source_Bus1_1) = 0 -c_e_InvestmentFlowBlock_old_rule(Bus1_Sink_2)_: -+1 InvestmentFlowBlock_old(Bus1_Sink_2) --1 InvestmentFlowBlock_old_end(Bus1_Sink_2) --1 InvestmentFlowBlock_old_exo(Bus1_Sink_2) +c_e_InvestmentFlowBlock_old_rule(Source_Bus1_2)_: ++1 InvestmentFlowBlock_old(Source_Bus1_2) +-1 InvestmentFlowBlock_old_end(Source_Bus1_2) +-1 InvestmentFlowBlock_old_exo(Source_Bus1_2) = 0 c_e_InvestmentFlowBlock_old_rule(storage_Bus1_0)_: @@ -310,34 +310,34 @@ c_e_InvestmentFlowBlock_old_rule(storage_Bus1_2)_: -1 InvestmentFlowBlock_old_exo(storage_Bus1_2) = 0 -c_u_InvestmentFlowBlock_max(Source_Bus1_0_0)_: -+1 flow(Source_Bus1_0_0) --1 InvestmentFlowBlock_total(Source_Bus1_0) +c_u_InvestmentFlowBlock_max(Bus1_Sink_0_0)_: ++1 flow(Bus1_Sink_0_0) +-1 InvestmentFlowBlock_total(Bus1_Sink_0) <= 0 -c_u_InvestmentFlowBlock_max(Source_Bus1_0_1)_: -+1 flow(Source_Bus1_0_1) --1 InvestmentFlowBlock_total(Source_Bus1_0) +c_u_InvestmentFlowBlock_max(Bus1_Sink_0_1)_: ++1 flow(Bus1_Sink_0_1) +-1 InvestmentFlowBlock_total(Bus1_Sink_0) <= 0 -c_u_InvestmentFlowBlock_max(Source_Bus1_1_2)_: -+1 flow(Source_Bus1_1_2) --1 InvestmentFlowBlock_total(Source_Bus1_1) +c_u_InvestmentFlowBlock_max(Bus1_Sink_1_2)_: ++1 flow(Bus1_Sink_1_2) +-1 InvestmentFlowBlock_total(Bus1_Sink_1) <= 0 -c_u_InvestmentFlowBlock_max(Source_Bus1_1_3)_: -+1 flow(Source_Bus1_1_3) --1 InvestmentFlowBlock_total(Source_Bus1_1) +c_u_InvestmentFlowBlock_max(Bus1_Sink_1_3)_: ++1 flow(Bus1_Sink_1_3) +-1 InvestmentFlowBlock_total(Bus1_Sink_1) <= 0 -c_u_InvestmentFlowBlock_max(Source_Bus1_2_4)_: -+1 flow(Source_Bus1_2_4) --1 InvestmentFlowBlock_total(Source_Bus1_2) +c_u_InvestmentFlowBlock_max(Bus1_Sink_2_4)_: ++1 flow(Bus1_Sink_2_4) +-1 InvestmentFlowBlock_total(Bus1_Sink_2) <= 0 -c_u_InvestmentFlowBlock_max(Source_Bus1_2_5)_: -+1 flow(Source_Bus1_2_5) --1 InvestmentFlowBlock_total(Source_Bus1_2) +c_u_InvestmentFlowBlock_max(Bus1_Sink_2_5)_: ++1 flow(Bus1_Sink_2_5) +-1 InvestmentFlowBlock_total(Bus1_Sink_2) <= 0 c_u_InvestmentFlowBlock_max(Bus1_storage_0_0)_: @@ -370,34 +370,34 @@ c_u_InvestmentFlowBlock_max(Bus1_storage_2_5)_: -1 InvestmentFlowBlock_total(Bus1_storage_2) <= 0 -c_u_InvestmentFlowBlock_max(Bus1_Sink_0_0)_: -+1 flow(Bus1_Sink_0_0) --1 InvestmentFlowBlock_total(Bus1_Sink_0) +c_u_InvestmentFlowBlock_max(Source_Bus1_0_0)_: ++1 flow(Source_Bus1_0_0) +-1 InvestmentFlowBlock_total(Source_Bus1_0) <= 0 -c_u_InvestmentFlowBlock_max(Bus1_Sink_0_1)_: -+1 flow(Bus1_Sink_0_1) --1 InvestmentFlowBlock_total(Bus1_Sink_0) +c_u_InvestmentFlowBlock_max(Source_Bus1_0_1)_: ++1 flow(Source_Bus1_0_1) +-1 InvestmentFlowBlock_total(Source_Bus1_0) <= 0 -c_u_InvestmentFlowBlock_max(Bus1_Sink_1_2)_: -+1 flow(Bus1_Sink_1_2) --1 InvestmentFlowBlock_total(Bus1_Sink_1) +c_u_InvestmentFlowBlock_max(Source_Bus1_1_2)_: ++1 flow(Source_Bus1_1_2) +-1 InvestmentFlowBlock_total(Source_Bus1_1) <= 0 -c_u_InvestmentFlowBlock_max(Bus1_Sink_1_3)_: -+1 flow(Bus1_Sink_1_3) --1 InvestmentFlowBlock_total(Bus1_Sink_1) +c_u_InvestmentFlowBlock_max(Source_Bus1_1_3)_: ++1 flow(Source_Bus1_1_3) +-1 InvestmentFlowBlock_total(Source_Bus1_1) <= 0 -c_u_InvestmentFlowBlock_max(Bus1_Sink_2_4)_: -+1 flow(Bus1_Sink_2_4) --1 InvestmentFlowBlock_total(Bus1_Sink_2) +c_u_InvestmentFlowBlock_max(Source_Bus1_2_4)_: ++1 flow(Source_Bus1_2_4) +-1 InvestmentFlowBlock_total(Source_Bus1_2) <= 0 -c_u_InvestmentFlowBlock_max(Bus1_Sink_2_5)_: -+1 flow(Bus1_Sink_2_5) --1 InvestmentFlowBlock_total(Bus1_Sink_2) +c_u_InvestmentFlowBlock_max(Source_Bus1_2_5)_: ++1 flow(Source_Bus1_2_5) +-1 InvestmentFlowBlock_total(Source_Bus1_2) <= 0 c_u_InvestmentFlowBlock_max(storage_Bus1_0_0)_: @@ -591,12 +591,12 @@ c_u_GenericInvestmentStorageBlock_max_storage_content(storage_2_5)_: <= 0 bounds - 0 <= InvestmentFlowBlock_invest(Source_Bus1_0) <= +inf - 0 <= InvestmentFlowBlock_invest(Source_Bus1_1) <= +inf - 0 <= InvestmentFlowBlock_invest(Source_Bus1_2) <= +inf 0 <= InvestmentFlowBlock_invest(Bus1_Sink_0) <= +inf 0 <= InvestmentFlowBlock_invest(Bus1_Sink_1) <= +inf 0 <= InvestmentFlowBlock_invest(Bus1_Sink_2) <= +inf + 0 <= InvestmentFlowBlock_invest(Source_Bus1_0) <= +inf + 0 <= InvestmentFlowBlock_invest(Source_Bus1_1) <= +inf + 0 <= InvestmentFlowBlock_invest(Source_Bus1_2) <= +inf 0 <= GenericInvestmentStorageBlock_invest(storage_0) <= +inf 0 <= GenericInvestmentStorageBlock_invest(storage_1) <= +inf 0 <= GenericInvestmentStorageBlock_invest(storage_2) <= +inf @@ -624,11 +624,11 @@ bounds 0 <= flow(Source_Bus1_2_5) <= +inf 0 <= flow(Bus1_storage_2_5) <= +inf 0 <= flow(Bus1_Sink_2_5) <= +inf - 0 <= InvestmentFlowBlock_total(Source_Bus1_0) <= +inf - 0 <= InvestmentFlowBlock_total(Source_Bus1_1) <= +inf - 0 <= InvestmentFlowBlock_old(Source_Bus1_1) <= +inf - 0 <= InvestmentFlowBlock_total(Source_Bus1_2) <= +inf - 0 <= InvestmentFlowBlock_old(Source_Bus1_2) <= +inf + 0 <= InvestmentFlowBlock_total(Bus1_Sink_0) <= +inf + 0 <= InvestmentFlowBlock_total(Bus1_Sink_1) <= +inf + 0 <= InvestmentFlowBlock_old(Bus1_Sink_1) <= +inf + 0 <= InvestmentFlowBlock_total(Bus1_Sink_2) <= +inf + 0 <= InvestmentFlowBlock_old(Bus1_Sink_2) <= +inf 0 <= InvestmentFlowBlock_total(Bus1_storage_0) <= +inf 0 <= InvestmentFlowBlock_invest(Bus1_storage_0) <= +inf 0 <= InvestmentFlowBlock_total(Bus1_storage_1) <= +inf @@ -637,11 +637,11 @@ bounds 0 <= InvestmentFlowBlock_total(Bus1_storage_2) <= +inf 0 <= InvestmentFlowBlock_invest(Bus1_storage_2) <= +inf 0 <= InvestmentFlowBlock_old(Bus1_storage_2) <= +inf - 0 <= InvestmentFlowBlock_total(Bus1_Sink_0) <= +inf - 0 <= InvestmentFlowBlock_total(Bus1_Sink_1) <= +inf - 0 <= InvestmentFlowBlock_old(Bus1_Sink_1) <= +inf - 0 <= InvestmentFlowBlock_total(Bus1_Sink_2) <= +inf - 0 <= InvestmentFlowBlock_old(Bus1_Sink_2) <= +inf + 0 <= InvestmentFlowBlock_total(Source_Bus1_0) <= +inf + 0 <= InvestmentFlowBlock_total(Source_Bus1_1) <= +inf + 0 <= InvestmentFlowBlock_old(Source_Bus1_1) <= +inf + 0 <= InvestmentFlowBlock_total(Source_Bus1_2) <= +inf + 0 <= InvestmentFlowBlock_old(Source_Bus1_2) <= +inf 0 <= InvestmentFlowBlock_total(storage_Bus1_0) <= +inf 0 <= InvestmentFlowBlock_invest(storage_Bus1_0) <= +inf 0 <= InvestmentFlowBlock_total(storage_Bus1_1) <= +inf @@ -650,33 +650,33 @@ bounds 0 <= InvestmentFlowBlock_total(storage_Bus1_2) <= +inf 0 <= InvestmentFlowBlock_invest(storage_Bus1_2) <= +inf 0 <= InvestmentFlowBlock_old(storage_Bus1_2) <= +inf - 0 <= InvestmentFlowBlock_old_end(Source_Bus1_0) <= +inf - 0 <= InvestmentFlowBlock_old_end(Source_Bus1_1) <= +inf - 0 <= InvestmentFlowBlock_old_end(Source_Bus1_2) <= +inf - 0 <= InvestmentFlowBlock_old_end(Bus1_storage_0) <= +inf - 0 <= InvestmentFlowBlock_old_end(Bus1_storage_1) <= +inf - 0 <= InvestmentFlowBlock_old_end(Bus1_storage_2) <= +inf 0 <= InvestmentFlowBlock_old_end(Bus1_Sink_0) <= +inf 0 <= InvestmentFlowBlock_old_end(Bus1_Sink_1) <= +inf 0 <= InvestmentFlowBlock_old_end(Bus1_Sink_2) <= +inf + 0 <= InvestmentFlowBlock_old_end(Bus1_storage_0) <= +inf + 0 <= InvestmentFlowBlock_old_end(Bus1_storage_1) <= +inf + 0 <= InvestmentFlowBlock_old_end(Bus1_storage_2) <= +inf + 0 <= InvestmentFlowBlock_old_end(Source_Bus1_0) <= +inf + 0 <= InvestmentFlowBlock_old_end(Source_Bus1_1) <= +inf + 0 <= InvestmentFlowBlock_old_end(Source_Bus1_2) <= +inf 0 <= InvestmentFlowBlock_old_end(storage_Bus1_0) <= +inf 0 <= InvestmentFlowBlock_old_end(storage_Bus1_1) <= +inf 0 <= InvestmentFlowBlock_old_end(storage_Bus1_2) <= +inf - 0 <= InvestmentFlowBlock_old_exo(Source_Bus1_0) <= +inf - 0 <= InvestmentFlowBlock_old_exo(Source_Bus1_1) <= +inf - 0 <= InvestmentFlowBlock_old_exo(Source_Bus1_2) <= +inf - 0 <= InvestmentFlowBlock_old_exo(Bus1_storage_0) <= +inf - 0 <= InvestmentFlowBlock_old_exo(Bus1_storage_1) <= +inf - 0 <= InvestmentFlowBlock_old_exo(Bus1_storage_2) <= +inf 0 <= InvestmentFlowBlock_old_exo(Bus1_Sink_0) <= +inf 0 <= InvestmentFlowBlock_old_exo(Bus1_Sink_1) <= +inf 0 <= InvestmentFlowBlock_old_exo(Bus1_Sink_2) <= +inf + 0 <= InvestmentFlowBlock_old_exo(Bus1_storage_0) <= +inf + 0 <= InvestmentFlowBlock_old_exo(Bus1_storage_1) <= +inf + 0 <= InvestmentFlowBlock_old_exo(Bus1_storage_2) <= +inf + 0 <= InvestmentFlowBlock_old_exo(Source_Bus1_0) <= +inf + 0 <= InvestmentFlowBlock_old_exo(Source_Bus1_1) <= +inf + 0 <= InvestmentFlowBlock_old_exo(Source_Bus1_2) <= +inf 0 <= InvestmentFlowBlock_old_exo(storage_Bus1_0) <= +inf 0 <= InvestmentFlowBlock_old_exo(storage_Bus1_1) <= +inf 0 <= InvestmentFlowBlock_old_exo(storage_Bus1_2) <= +inf - 0 <= InvestmentFlowBlock_old(Source_Bus1_0) <= +inf - 0 <= InvestmentFlowBlock_old(Bus1_storage_0) <= +inf 0 <= InvestmentFlowBlock_old(Bus1_Sink_0) <= +inf + 0 <= InvestmentFlowBlock_old(Bus1_storage_0) <= +inf + 0 <= InvestmentFlowBlock_old(Source_Bus1_0) <= +inf 0 <= InvestmentFlowBlock_old(storage_Bus1_0) <= +inf 0 <= GenericInvestmentStorageBlock_total(storage_0) <= +inf 0 <= GenericInvestmentStorageBlock_total(storage_1) <= +inf diff --git a/tests/lp_files/converter_invest_multi_period.lp b/tests/lp_files/converter_invest_multi_period.lp index 38337e8ac..1ac09ba27 100644 --- a/tests/lp_files/converter_invest_multi_period.lp +++ b/tests/lp_files/converter_invest_multi_period.lp @@ -2,9 +2,9 @@ min objective: -+24.462687250116133 InvestmentFlowBlock_invest(powerplant_gas_coal_electricityBus_0) -+23.98302671580013 InvestmentFlowBlock_invest(powerplant_gas_coal_electricityBus_1) -+23.512771290000128 InvestmentFlowBlock_invest(powerplant_gas_coal_electricityBus_2) ++3.5273767282312036 InvestmentFlowBlock_invest(powerplant_gas_coal_electricityBus_0) ++2.328225392441188 InvestmentFlowBlock_invest(powerplant_gas_coal_electricityBus_1) ++1.1525868279411837 InvestmentFlowBlock_invest(powerplant_gas_coal_electricityBus_2) +50 flow(powerplant_gas_coal_electricityBus_0_0) +50 flow(powerplant_gas_coal_electricityBus_0_1) +49.01960784313725 flow(powerplant_gas_coal_electricityBus_1_2) @@ -20,28 +20,28 @@ objective: s.t. -c_e_BusBlock_balance(coalBus_0_0)_: -+1 flow(coalBus_powerplant_gas_coal_0_0) +c_e_BusBlock_balance(electricityBus_0_0)_: ++1 flow(powerplant_gas_coal_electricityBus_0_0) = 0 -c_e_BusBlock_balance(coalBus_0_1)_: -+1 flow(coalBus_powerplant_gas_coal_0_1) +c_e_BusBlock_balance(electricityBus_0_1)_: ++1 flow(powerplant_gas_coal_electricityBus_0_1) = 0 -c_e_BusBlock_balance(coalBus_1_2)_: -+1 flow(coalBus_powerplant_gas_coal_1_2) +c_e_BusBlock_balance(electricityBus_1_2)_: ++1 flow(powerplant_gas_coal_electricityBus_1_2) = 0 -c_e_BusBlock_balance(coalBus_1_3)_: -+1 flow(coalBus_powerplant_gas_coal_1_3) +c_e_BusBlock_balance(electricityBus_1_3)_: ++1 flow(powerplant_gas_coal_electricityBus_1_3) = 0 -c_e_BusBlock_balance(coalBus_2_4)_: -+1 flow(coalBus_powerplant_gas_coal_2_4) +c_e_BusBlock_balance(electricityBus_2_4)_: ++1 flow(powerplant_gas_coal_electricityBus_2_4) = 0 -c_e_BusBlock_balance(coalBus_2_5)_: -+1 flow(coalBus_powerplant_gas_coal_2_5) +c_e_BusBlock_balance(electricityBus_2_5)_: ++1 flow(powerplant_gas_coal_electricityBus_2_5) = 0 c_e_BusBlock_balance(gasBus_0_0)_: @@ -68,30 +68,6 @@ c_e_BusBlock_balance(gasBus_2_5)_: +1 flow(gasBus_powerplant_gas_coal_2_5) = 0 -c_e_BusBlock_balance(electricityBus_0_0)_: -+1 flow(powerplant_gas_coal_electricityBus_0_0) -= 0 - -c_e_BusBlock_balance(electricityBus_0_1)_: -+1 flow(powerplant_gas_coal_electricityBus_0_1) -= 0 - -c_e_BusBlock_balance(electricityBus_1_2)_: -+1 flow(powerplant_gas_coal_electricityBus_1_2) -= 0 - -c_e_BusBlock_balance(electricityBus_1_3)_: -+1 flow(powerplant_gas_coal_electricityBus_1_3) -= 0 - -c_e_BusBlock_balance(electricityBus_2_4)_: -+1 flow(powerplant_gas_coal_electricityBus_2_4) -= 0 - -c_e_BusBlock_balance(electricityBus_2_5)_: -+1 flow(powerplant_gas_coal_electricityBus_2_5) -= 0 - c_e_BusBlock_balance(thermalBus_0_0)_: +1 flow(powerplant_gas_coal_thermalBus_0_0) = 0 @@ -116,9 +92,28 @@ c_e_BusBlock_balance(thermalBus_2_5)_: +1 flow(powerplant_gas_coal_thermalBus_2_5) = 0 -c_e_ConverterBlock_relation(powerplant_gas_coal_coalBus_electricityBus_0_0)_: --0.2 flow(powerplant_gas_coal_electricityBus_0_0) -+0.3 flow(coalBus_powerplant_gas_coal_0_0) +c_e_BusBlock_balance(coalBus_0_0)_: ++1 flow(coalBus_powerplant_gas_coal_0_0) += 0 + +c_e_BusBlock_balance(coalBus_0_1)_: ++1 flow(coalBus_powerplant_gas_coal_0_1) += 0 + +c_e_BusBlock_balance(coalBus_1_2)_: ++1 flow(coalBus_powerplant_gas_coal_1_2) += 0 + +c_e_BusBlock_balance(coalBus_1_3)_: ++1 flow(coalBus_powerplant_gas_coal_1_3) += 0 + +c_e_BusBlock_balance(coalBus_2_4)_: ++1 flow(coalBus_powerplant_gas_coal_2_4) += 0 + +c_e_BusBlock_balance(coalBus_2_5)_: ++1 flow(coalBus_powerplant_gas_coal_2_5) = 0 c_e_ConverterBlock_relation(powerplant_gas_coal_gasBus_electricityBus_0_0)_: @@ -126,9 +121,9 @@ c_e_ConverterBlock_relation(powerplant_gas_coal_gasBus_electricityBus_0_0)_: +0.3 flow(gasBus_powerplant_gas_coal_0_0) = 0 -c_e_ConverterBlock_relation(powerplant_gas_coal_coalBus_thermalBus_0_0)_: --0.2 flow(powerplant_gas_coal_thermalBus_0_0) -+0.5 flow(coalBus_powerplant_gas_coal_0_0) +c_e_ConverterBlock_relation(powerplant_gas_coal_coalBus_electricityBus_0_0)_: +-0.2 flow(powerplant_gas_coal_electricityBus_0_0) ++0.3 flow(coalBus_powerplant_gas_coal_0_0) = 0 c_e_ConverterBlock_relation(powerplant_gas_coal_gasBus_thermalBus_0_0)_: @@ -136,9 +131,9 @@ c_e_ConverterBlock_relation(powerplant_gas_coal_gasBus_thermalBus_0_0)_: +0.5 flow(gasBus_powerplant_gas_coal_0_0) = 0 -c_e_ConverterBlock_relation(powerplant_gas_coal_coalBus_electricityBus_0_1)_: --0.2 flow(powerplant_gas_coal_electricityBus_0_1) -+0.3 flow(coalBus_powerplant_gas_coal_0_1) +c_e_ConverterBlock_relation(powerplant_gas_coal_coalBus_thermalBus_0_0)_: +-0.2 flow(powerplant_gas_coal_thermalBus_0_0) ++0.5 flow(coalBus_powerplant_gas_coal_0_0) = 0 c_e_ConverterBlock_relation(powerplant_gas_coal_gasBus_electricityBus_0_1)_: @@ -146,9 +141,9 @@ c_e_ConverterBlock_relation(powerplant_gas_coal_gasBus_electricityBus_0_1)_: +0.3 flow(gasBus_powerplant_gas_coal_0_1) = 0 -c_e_ConverterBlock_relation(powerplant_gas_coal_coalBus_thermalBus_0_1)_: --0.2 flow(powerplant_gas_coal_thermalBus_0_1) -+0.5 flow(coalBus_powerplant_gas_coal_0_1) +c_e_ConverterBlock_relation(powerplant_gas_coal_coalBus_electricityBus_0_1)_: +-0.2 flow(powerplant_gas_coal_electricityBus_0_1) ++0.3 flow(coalBus_powerplant_gas_coal_0_1) = 0 c_e_ConverterBlock_relation(powerplant_gas_coal_gasBus_thermalBus_0_1)_: @@ -156,9 +151,9 @@ c_e_ConverterBlock_relation(powerplant_gas_coal_gasBus_thermalBus_0_1)_: +0.5 flow(gasBus_powerplant_gas_coal_0_1) = 0 -c_e_ConverterBlock_relation(powerplant_gas_coal_coalBus_electricityBus_1_2)_: --0.2 flow(powerplant_gas_coal_electricityBus_1_2) -+0.3 flow(coalBus_powerplant_gas_coal_1_2) +c_e_ConverterBlock_relation(powerplant_gas_coal_coalBus_thermalBus_0_1)_: +-0.2 flow(powerplant_gas_coal_thermalBus_0_1) ++0.5 flow(coalBus_powerplant_gas_coal_0_1) = 0 c_e_ConverterBlock_relation(powerplant_gas_coal_gasBus_electricityBus_1_2)_: @@ -166,9 +161,9 @@ c_e_ConverterBlock_relation(powerplant_gas_coal_gasBus_electricityBus_1_2)_: +0.3 flow(gasBus_powerplant_gas_coal_1_2) = 0 -c_e_ConverterBlock_relation(powerplant_gas_coal_coalBus_thermalBus_1_2)_: --0.2 flow(powerplant_gas_coal_thermalBus_1_2) -+0.5 flow(coalBus_powerplant_gas_coal_1_2) +c_e_ConverterBlock_relation(powerplant_gas_coal_coalBus_electricityBus_1_2)_: +-0.2 flow(powerplant_gas_coal_electricityBus_1_2) ++0.3 flow(coalBus_powerplant_gas_coal_1_2) = 0 c_e_ConverterBlock_relation(powerplant_gas_coal_gasBus_thermalBus_1_2)_: @@ -176,9 +171,9 @@ c_e_ConverterBlock_relation(powerplant_gas_coal_gasBus_thermalBus_1_2)_: +0.5 flow(gasBus_powerplant_gas_coal_1_2) = 0 -c_e_ConverterBlock_relation(powerplant_gas_coal_coalBus_electricityBus_1_3)_: --0.2 flow(powerplant_gas_coal_electricityBus_1_3) -+0.3 flow(coalBus_powerplant_gas_coal_1_3) +c_e_ConverterBlock_relation(powerplant_gas_coal_coalBus_thermalBus_1_2)_: +-0.2 flow(powerplant_gas_coal_thermalBus_1_2) ++0.5 flow(coalBus_powerplant_gas_coal_1_2) = 0 c_e_ConverterBlock_relation(powerplant_gas_coal_gasBus_electricityBus_1_3)_: @@ -186,9 +181,9 @@ c_e_ConverterBlock_relation(powerplant_gas_coal_gasBus_electricityBus_1_3)_: +0.3 flow(gasBus_powerplant_gas_coal_1_3) = 0 -c_e_ConverterBlock_relation(powerplant_gas_coal_coalBus_thermalBus_1_3)_: --0.2 flow(powerplant_gas_coal_thermalBus_1_3) -+0.5 flow(coalBus_powerplant_gas_coal_1_3) +c_e_ConverterBlock_relation(powerplant_gas_coal_coalBus_electricityBus_1_3)_: +-0.2 flow(powerplant_gas_coal_electricityBus_1_3) ++0.3 flow(coalBus_powerplant_gas_coal_1_3) = 0 c_e_ConverterBlock_relation(powerplant_gas_coal_gasBus_thermalBus_1_3)_: @@ -196,9 +191,9 @@ c_e_ConverterBlock_relation(powerplant_gas_coal_gasBus_thermalBus_1_3)_: +0.5 flow(gasBus_powerplant_gas_coal_1_3) = 0 -c_e_ConverterBlock_relation(powerplant_gas_coal_coalBus_electricityBus_2_4)_: --0.2 flow(powerplant_gas_coal_electricityBus_2_4) -+0.3 flow(coalBus_powerplant_gas_coal_2_4) +c_e_ConverterBlock_relation(powerplant_gas_coal_coalBus_thermalBus_1_3)_: +-0.2 flow(powerplant_gas_coal_thermalBus_1_3) ++0.5 flow(coalBus_powerplant_gas_coal_1_3) = 0 c_e_ConverterBlock_relation(powerplant_gas_coal_gasBus_electricityBus_2_4)_: @@ -206,9 +201,9 @@ c_e_ConverterBlock_relation(powerplant_gas_coal_gasBus_electricityBus_2_4)_: +0.3 flow(gasBus_powerplant_gas_coal_2_4) = 0 -c_e_ConverterBlock_relation(powerplant_gas_coal_coalBus_thermalBus_2_4)_: --0.2 flow(powerplant_gas_coal_thermalBus_2_4) -+0.5 flow(coalBus_powerplant_gas_coal_2_4) +c_e_ConverterBlock_relation(powerplant_gas_coal_coalBus_electricityBus_2_4)_: +-0.2 flow(powerplant_gas_coal_electricityBus_2_4) ++0.3 flow(coalBus_powerplant_gas_coal_2_4) = 0 c_e_ConverterBlock_relation(powerplant_gas_coal_gasBus_thermalBus_2_4)_: @@ -216,9 +211,9 @@ c_e_ConverterBlock_relation(powerplant_gas_coal_gasBus_thermalBus_2_4)_: +0.5 flow(gasBus_powerplant_gas_coal_2_4) = 0 -c_e_ConverterBlock_relation(powerplant_gas_coal_coalBus_electricityBus_2_5)_: --0.2 flow(powerplant_gas_coal_electricityBus_2_5) -+0.3 flow(coalBus_powerplant_gas_coal_2_5) +c_e_ConverterBlock_relation(powerplant_gas_coal_coalBus_thermalBus_2_4)_: +-0.2 flow(powerplant_gas_coal_thermalBus_2_4) ++0.5 flow(coalBus_powerplant_gas_coal_2_4) = 0 c_e_ConverterBlock_relation(powerplant_gas_coal_gasBus_electricityBus_2_5)_: @@ -226,9 +221,9 @@ c_e_ConverterBlock_relation(powerplant_gas_coal_gasBus_electricityBus_2_5)_: +0.3 flow(gasBus_powerplant_gas_coal_2_5) = 0 -c_e_ConverterBlock_relation(powerplant_gas_coal_coalBus_thermalBus_2_5)_: --0.2 flow(powerplant_gas_coal_thermalBus_2_5) -+0.5 flow(coalBus_powerplant_gas_coal_2_5) +c_e_ConverterBlock_relation(powerplant_gas_coal_coalBus_electricityBus_2_5)_: +-0.2 flow(powerplant_gas_coal_electricityBus_2_5) ++0.3 flow(coalBus_powerplant_gas_coal_2_5) = 0 c_e_ConverterBlock_relation(powerplant_gas_coal_gasBus_thermalBus_2_5)_: @@ -236,6 +231,11 @@ c_e_ConverterBlock_relation(powerplant_gas_coal_gasBus_thermalBus_2_5)_: +0.5 flow(gasBus_powerplant_gas_coal_2_5) = 0 +c_e_ConverterBlock_relation(powerplant_gas_coal_coalBus_thermalBus_2_5)_: +-0.2 flow(powerplant_gas_coal_thermalBus_2_5) ++0.5 flow(coalBus_powerplant_gas_coal_2_5) += 0 + c_e_InvestmentFlowBlock_total_rule(powerplant_gas_coal_electricityBus_0)_: -1 InvestmentFlowBlock_invest(powerplant_gas_coal_electricityBus_0) +1 InvestmentFlowBlock_total(powerplant_gas_coal_electricityBus_0) @@ -343,18 +343,18 @@ bounds 0 <= flow(powerplant_gas_coal_thermalBus_1_3) <= +inf 0 <= flow(powerplant_gas_coal_thermalBus_2_4) <= +inf 0 <= flow(powerplant_gas_coal_thermalBus_2_5) <= +inf - 0 <= flow(coalBus_powerplant_gas_coal_0_0) <= +inf - 0 <= flow(coalBus_powerplant_gas_coal_0_1) <= +inf - 0 <= flow(coalBus_powerplant_gas_coal_1_2) <= +inf - 0 <= flow(coalBus_powerplant_gas_coal_1_3) <= +inf - 0 <= flow(coalBus_powerplant_gas_coal_2_4) <= +inf - 0 <= flow(coalBus_powerplant_gas_coal_2_5) <= +inf 0 <= flow(gasBus_powerplant_gas_coal_0_0) <= +inf 0 <= flow(gasBus_powerplant_gas_coal_0_1) <= +inf 0 <= flow(gasBus_powerplant_gas_coal_1_2) <= +inf 0 <= flow(gasBus_powerplant_gas_coal_1_3) <= +inf 0 <= flow(gasBus_powerplant_gas_coal_2_4) <= +inf 0 <= flow(gasBus_powerplant_gas_coal_2_5) <= +inf + 0 <= flow(coalBus_powerplant_gas_coal_0_0) <= +inf + 0 <= flow(coalBus_powerplant_gas_coal_0_1) <= +inf + 0 <= flow(coalBus_powerplant_gas_coal_1_2) <= +inf + 0 <= flow(coalBus_powerplant_gas_coal_1_3) <= +inf + 0 <= flow(coalBus_powerplant_gas_coal_2_4) <= +inf + 0 <= flow(coalBus_powerplant_gas_coal_2_5) <= +inf 0 <= InvestmentFlowBlock_total(powerplant_gas_coal_electricityBus_0) <= +inf 0 <= InvestmentFlowBlock_total(powerplant_gas_coal_electricityBus_1) <= +inf 0 <= InvestmentFlowBlock_old(powerplant_gas_coal_electricityBus_1) <= +inf diff --git a/tests/lp_files/converter_invest_with_existing_multi_period.lp b/tests/lp_files/converter_invest_with_existing_multi_period.lp index 1ef5b303f..e18a16e66 100644 --- a/tests/lp_files/converter_invest_with_existing_multi_period.lp +++ b/tests/lp_files/converter_invest_with_existing_multi_period.lp @@ -2,9 +2,9 @@ min objective: -+20.601980198019806 InvestmentFlowBlock_invest(powerplant_gas_coal_electricityBus_0) -+20.1980198019802 InvestmentFlowBlock_invest(powerplant_gas_coal_electricityBus_1) -+19.801980198019805 InvestmentFlowBlock_invest(powerplant_gas_coal_electricityBus_2) ++20.0 InvestmentFlowBlock_invest(powerplant_gas_coal_electricityBus_0) ++19.6078431372549 InvestmentFlowBlock_invest(powerplant_gas_coal_electricityBus_1) ++9.706853038245011 InvestmentFlowBlock_invest(powerplant_gas_coal_electricityBus_2) +50 flow(powerplant_gas_coal_electricityBus_0_0) +50 flow(powerplant_gas_coal_electricityBus_0_1) +49.01960784313725 flow(powerplant_gas_coal_electricityBus_1_2) @@ -20,28 +20,28 @@ objective: s.t. -c_e_BusBlock_balance(coalBus_0_0)_: -+1 flow(coalBus_powerplant_gas_coal_0_0) +c_e_BusBlock_balance(electricityBus_0_0)_: ++1 flow(powerplant_gas_coal_electricityBus_0_0) = 0 -c_e_BusBlock_balance(coalBus_0_1)_: -+1 flow(coalBus_powerplant_gas_coal_0_1) +c_e_BusBlock_balance(electricityBus_0_1)_: ++1 flow(powerplant_gas_coal_electricityBus_0_1) = 0 -c_e_BusBlock_balance(coalBus_1_2)_: -+1 flow(coalBus_powerplant_gas_coal_1_2) +c_e_BusBlock_balance(electricityBus_1_2)_: ++1 flow(powerplant_gas_coal_electricityBus_1_2) = 0 -c_e_BusBlock_balance(coalBus_1_3)_: -+1 flow(coalBus_powerplant_gas_coal_1_3) +c_e_BusBlock_balance(electricityBus_1_3)_: ++1 flow(powerplant_gas_coal_electricityBus_1_3) = 0 -c_e_BusBlock_balance(coalBus_2_4)_: -+1 flow(coalBus_powerplant_gas_coal_2_4) +c_e_BusBlock_balance(electricityBus_2_4)_: ++1 flow(powerplant_gas_coal_electricityBus_2_4) = 0 -c_e_BusBlock_balance(coalBus_2_5)_: -+1 flow(coalBus_powerplant_gas_coal_2_5) +c_e_BusBlock_balance(electricityBus_2_5)_: ++1 flow(powerplant_gas_coal_electricityBus_2_5) = 0 c_e_BusBlock_balance(gasBus_0_0)_: @@ -68,30 +68,6 @@ c_e_BusBlock_balance(gasBus_2_5)_: +1 flow(gasBus_powerplant_gas_coal_2_5) = 0 -c_e_BusBlock_balance(electricityBus_0_0)_: -+1 flow(powerplant_gas_coal_electricityBus_0_0) -= 0 - -c_e_BusBlock_balance(electricityBus_0_1)_: -+1 flow(powerplant_gas_coal_electricityBus_0_1) -= 0 - -c_e_BusBlock_balance(electricityBus_1_2)_: -+1 flow(powerplant_gas_coal_electricityBus_1_2) -= 0 - -c_e_BusBlock_balance(electricityBus_1_3)_: -+1 flow(powerplant_gas_coal_electricityBus_1_3) -= 0 - -c_e_BusBlock_balance(electricityBus_2_4)_: -+1 flow(powerplant_gas_coal_electricityBus_2_4) -= 0 - -c_e_BusBlock_balance(electricityBus_2_5)_: -+1 flow(powerplant_gas_coal_electricityBus_2_5) -= 0 - c_e_BusBlock_balance(thermalBus_0_0)_: +1 flow(powerplant_gas_coal_thermalBus_0_0) = 0 @@ -116,9 +92,28 @@ c_e_BusBlock_balance(thermalBus_2_5)_: +1 flow(powerplant_gas_coal_thermalBus_2_5) = 0 -c_e_ConverterBlock_relation(powerplant_gas_coal_coalBus_electricityBus_0_0)_: --0.2 flow(powerplant_gas_coal_electricityBus_0_0) -+0.3 flow(coalBus_powerplant_gas_coal_0_0) +c_e_BusBlock_balance(coalBus_0_0)_: ++1 flow(coalBus_powerplant_gas_coal_0_0) += 0 + +c_e_BusBlock_balance(coalBus_0_1)_: ++1 flow(coalBus_powerplant_gas_coal_0_1) += 0 + +c_e_BusBlock_balance(coalBus_1_2)_: ++1 flow(coalBus_powerplant_gas_coal_1_2) += 0 + +c_e_BusBlock_balance(coalBus_1_3)_: ++1 flow(coalBus_powerplant_gas_coal_1_3) += 0 + +c_e_BusBlock_balance(coalBus_2_4)_: ++1 flow(coalBus_powerplant_gas_coal_2_4) += 0 + +c_e_BusBlock_balance(coalBus_2_5)_: ++1 flow(coalBus_powerplant_gas_coal_2_5) = 0 c_e_ConverterBlock_relation(powerplant_gas_coal_gasBus_electricityBus_0_0)_: @@ -126,9 +121,9 @@ c_e_ConverterBlock_relation(powerplant_gas_coal_gasBus_electricityBus_0_0)_: +0.3 flow(gasBus_powerplant_gas_coal_0_0) = 0 -c_e_ConverterBlock_relation(powerplant_gas_coal_coalBus_thermalBus_0_0)_: --0.2 flow(powerplant_gas_coal_thermalBus_0_0) -+0.5 flow(coalBus_powerplant_gas_coal_0_0) +c_e_ConverterBlock_relation(powerplant_gas_coal_coalBus_electricityBus_0_0)_: +-0.2 flow(powerplant_gas_coal_electricityBus_0_0) ++0.3 flow(coalBus_powerplant_gas_coal_0_0) = 0 c_e_ConverterBlock_relation(powerplant_gas_coal_gasBus_thermalBus_0_0)_: @@ -136,9 +131,9 @@ c_e_ConverterBlock_relation(powerplant_gas_coal_gasBus_thermalBus_0_0)_: +0.5 flow(gasBus_powerplant_gas_coal_0_0) = 0 -c_e_ConverterBlock_relation(powerplant_gas_coal_coalBus_electricityBus_0_1)_: --0.2 flow(powerplant_gas_coal_electricityBus_0_1) -+0.3 flow(coalBus_powerplant_gas_coal_0_1) +c_e_ConverterBlock_relation(powerplant_gas_coal_coalBus_thermalBus_0_0)_: +-0.2 flow(powerplant_gas_coal_thermalBus_0_0) ++0.5 flow(coalBus_powerplant_gas_coal_0_0) = 0 c_e_ConverterBlock_relation(powerplant_gas_coal_gasBus_electricityBus_0_1)_: @@ -146,9 +141,9 @@ c_e_ConverterBlock_relation(powerplant_gas_coal_gasBus_electricityBus_0_1)_: +0.3 flow(gasBus_powerplant_gas_coal_0_1) = 0 -c_e_ConverterBlock_relation(powerplant_gas_coal_coalBus_thermalBus_0_1)_: --0.2 flow(powerplant_gas_coal_thermalBus_0_1) -+0.5 flow(coalBus_powerplant_gas_coal_0_1) +c_e_ConverterBlock_relation(powerplant_gas_coal_coalBus_electricityBus_0_1)_: +-0.2 flow(powerplant_gas_coal_electricityBus_0_1) ++0.3 flow(coalBus_powerplant_gas_coal_0_1) = 0 c_e_ConverterBlock_relation(powerplant_gas_coal_gasBus_thermalBus_0_1)_: @@ -156,9 +151,9 @@ c_e_ConverterBlock_relation(powerplant_gas_coal_gasBus_thermalBus_0_1)_: +0.5 flow(gasBus_powerplant_gas_coal_0_1) = 0 -c_e_ConverterBlock_relation(powerplant_gas_coal_coalBus_electricityBus_1_2)_: --0.2 flow(powerplant_gas_coal_electricityBus_1_2) -+0.3 flow(coalBus_powerplant_gas_coal_1_2) +c_e_ConverterBlock_relation(powerplant_gas_coal_coalBus_thermalBus_0_1)_: +-0.2 flow(powerplant_gas_coal_thermalBus_0_1) ++0.5 flow(coalBus_powerplant_gas_coal_0_1) = 0 c_e_ConverterBlock_relation(powerplant_gas_coal_gasBus_electricityBus_1_2)_: @@ -166,9 +161,9 @@ c_e_ConverterBlock_relation(powerplant_gas_coal_gasBus_electricityBus_1_2)_: +0.3 flow(gasBus_powerplant_gas_coal_1_2) = 0 -c_e_ConverterBlock_relation(powerplant_gas_coal_coalBus_thermalBus_1_2)_: --0.2 flow(powerplant_gas_coal_thermalBus_1_2) -+0.5 flow(coalBus_powerplant_gas_coal_1_2) +c_e_ConverterBlock_relation(powerplant_gas_coal_coalBus_electricityBus_1_2)_: +-0.2 flow(powerplant_gas_coal_electricityBus_1_2) ++0.3 flow(coalBus_powerplant_gas_coal_1_2) = 0 c_e_ConverterBlock_relation(powerplant_gas_coal_gasBus_thermalBus_1_2)_: @@ -176,9 +171,9 @@ c_e_ConverterBlock_relation(powerplant_gas_coal_gasBus_thermalBus_1_2)_: +0.5 flow(gasBus_powerplant_gas_coal_1_2) = 0 -c_e_ConverterBlock_relation(powerplant_gas_coal_coalBus_electricityBus_1_3)_: --0.2 flow(powerplant_gas_coal_electricityBus_1_3) -+0.3 flow(coalBus_powerplant_gas_coal_1_3) +c_e_ConverterBlock_relation(powerplant_gas_coal_coalBus_thermalBus_1_2)_: +-0.2 flow(powerplant_gas_coal_thermalBus_1_2) ++0.5 flow(coalBus_powerplant_gas_coal_1_2) = 0 c_e_ConverterBlock_relation(powerplant_gas_coal_gasBus_electricityBus_1_3)_: @@ -186,9 +181,9 @@ c_e_ConverterBlock_relation(powerplant_gas_coal_gasBus_electricityBus_1_3)_: +0.3 flow(gasBus_powerplant_gas_coal_1_3) = 0 -c_e_ConverterBlock_relation(powerplant_gas_coal_coalBus_thermalBus_1_3)_: --0.2 flow(powerplant_gas_coal_thermalBus_1_3) -+0.5 flow(coalBus_powerplant_gas_coal_1_3) +c_e_ConverterBlock_relation(powerplant_gas_coal_coalBus_electricityBus_1_3)_: +-0.2 flow(powerplant_gas_coal_electricityBus_1_3) ++0.3 flow(coalBus_powerplant_gas_coal_1_3) = 0 c_e_ConverterBlock_relation(powerplant_gas_coal_gasBus_thermalBus_1_3)_: @@ -196,9 +191,9 @@ c_e_ConverterBlock_relation(powerplant_gas_coal_gasBus_thermalBus_1_3)_: +0.5 flow(gasBus_powerplant_gas_coal_1_3) = 0 -c_e_ConverterBlock_relation(powerplant_gas_coal_coalBus_electricityBus_2_4)_: --0.2 flow(powerplant_gas_coal_electricityBus_2_4) -+0.3 flow(coalBus_powerplant_gas_coal_2_4) +c_e_ConverterBlock_relation(powerplant_gas_coal_coalBus_thermalBus_1_3)_: +-0.2 flow(powerplant_gas_coal_thermalBus_1_3) ++0.5 flow(coalBus_powerplant_gas_coal_1_3) = 0 c_e_ConverterBlock_relation(powerplant_gas_coal_gasBus_electricityBus_2_4)_: @@ -206,9 +201,9 @@ c_e_ConverterBlock_relation(powerplant_gas_coal_gasBus_electricityBus_2_4)_: +0.3 flow(gasBus_powerplant_gas_coal_2_4) = 0 -c_e_ConverterBlock_relation(powerplant_gas_coal_coalBus_thermalBus_2_4)_: --0.2 flow(powerplant_gas_coal_thermalBus_2_4) -+0.5 flow(coalBus_powerplant_gas_coal_2_4) +c_e_ConverterBlock_relation(powerplant_gas_coal_coalBus_electricityBus_2_4)_: +-0.2 flow(powerplant_gas_coal_electricityBus_2_4) ++0.3 flow(coalBus_powerplant_gas_coal_2_4) = 0 c_e_ConverterBlock_relation(powerplant_gas_coal_gasBus_thermalBus_2_4)_: @@ -216,9 +211,9 @@ c_e_ConverterBlock_relation(powerplant_gas_coal_gasBus_thermalBus_2_4)_: +0.5 flow(gasBus_powerplant_gas_coal_2_4) = 0 -c_e_ConverterBlock_relation(powerplant_gas_coal_coalBus_electricityBus_2_5)_: --0.2 flow(powerplant_gas_coal_electricityBus_2_5) -+0.3 flow(coalBus_powerplant_gas_coal_2_5) +c_e_ConverterBlock_relation(powerplant_gas_coal_coalBus_thermalBus_2_4)_: +-0.2 flow(powerplant_gas_coal_thermalBus_2_4) ++0.5 flow(coalBus_powerplant_gas_coal_2_4) = 0 c_e_ConverterBlock_relation(powerplant_gas_coal_gasBus_electricityBus_2_5)_: @@ -226,9 +221,9 @@ c_e_ConverterBlock_relation(powerplant_gas_coal_gasBus_electricityBus_2_5)_: +0.3 flow(gasBus_powerplant_gas_coal_2_5) = 0 -c_e_ConverterBlock_relation(powerplant_gas_coal_coalBus_thermalBus_2_5)_: --0.2 flow(powerplant_gas_coal_thermalBus_2_5) -+0.5 flow(coalBus_powerplant_gas_coal_2_5) +c_e_ConverterBlock_relation(powerplant_gas_coal_coalBus_electricityBus_2_5)_: +-0.2 flow(powerplant_gas_coal_electricityBus_2_5) ++0.3 flow(coalBus_powerplant_gas_coal_2_5) = 0 c_e_ConverterBlock_relation(powerplant_gas_coal_gasBus_thermalBus_2_5)_: @@ -236,6 +231,11 @@ c_e_ConverterBlock_relation(powerplant_gas_coal_gasBus_thermalBus_2_5)_: +0.5 flow(gasBus_powerplant_gas_coal_2_5) = 0 +c_e_ConverterBlock_relation(powerplant_gas_coal_coalBus_thermalBus_2_5)_: +-0.2 flow(powerplant_gas_coal_thermalBus_2_5) ++0.5 flow(coalBus_powerplant_gas_coal_2_5) += 0 + c_e_InvestmentFlowBlock_total_rule(powerplant_gas_coal_electricityBus_0)_: -1 InvestmentFlowBlock_invest(powerplant_gas_coal_electricityBus_0) +1 InvestmentFlowBlock_total(powerplant_gas_coal_electricityBus_0) @@ -344,18 +344,18 @@ bounds 0 <= flow(powerplant_gas_coal_thermalBus_1_3) <= +inf 0 <= flow(powerplant_gas_coal_thermalBus_2_4) <= +inf 0 <= flow(powerplant_gas_coal_thermalBus_2_5) <= +inf - 0 <= flow(coalBus_powerplant_gas_coal_0_0) <= +inf - 0 <= flow(coalBus_powerplant_gas_coal_0_1) <= +inf - 0 <= flow(coalBus_powerplant_gas_coal_1_2) <= +inf - 0 <= flow(coalBus_powerplant_gas_coal_1_3) <= +inf - 0 <= flow(coalBus_powerplant_gas_coal_2_4) <= +inf - 0 <= flow(coalBus_powerplant_gas_coal_2_5) <= +inf 0 <= flow(gasBus_powerplant_gas_coal_0_0) <= +inf 0 <= flow(gasBus_powerplant_gas_coal_0_1) <= +inf 0 <= flow(gasBus_powerplant_gas_coal_1_2) <= +inf 0 <= flow(gasBus_powerplant_gas_coal_1_3) <= +inf 0 <= flow(gasBus_powerplant_gas_coal_2_4) <= +inf 0 <= flow(gasBus_powerplant_gas_coal_2_5) <= +inf + 0 <= flow(coalBus_powerplant_gas_coal_0_0) <= +inf + 0 <= flow(coalBus_powerplant_gas_coal_0_1) <= +inf + 0 <= flow(coalBus_powerplant_gas_coal_1_2) <= +inf + 0 <= flow(coalBus_powerplant_gas_coal_1_3) <= +inf + 0 <= flow(coalBus_powerplant_gas_coal_2_4) <= +inf + 0 <= flow(coalBus_powerplant_gas_coal_2_5) <= +inf 0 <= InvestmentFlowBlock_total(powerplant_gas_coal_electricityBus_0) <= +inf 0 <= InvestmentFlowBlock_total(powerplant_gas_coal_electricityBus_1) <= +inf 0 <= InvestmentFlowBlock_old(powerplant_gas_coal_electricityBus_1) <= +inf diff --git a/tests/lp_files/dsm_module_DIW_invest_multi_period.lp b/tests/lp_files/dsm_module_DIW_invest_multi_period.lp index a03022363..68ad9b43c 100644 --- a/tests/lp_files/dsm_module_DIW_invest_multi_period.lp +++ b/tests/lp_files/dsm_module_DIW_invest_multi_period.lp @@ -2,7 +2,7 @@ min objective: -+15992.031251718836 ONE_VAR_CONSTANT ++2941.5609381007307 ONE_VAR_CONSTANT +1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_0_0) +1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_1_0) +1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_2_0) @@ -51,9 +51,9 @@ objective: +0.9611687812379853 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_4_5) +0.9611687812379853 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_5_5) +96.11687812379853 SinkDSMDIWInvestmentBlock_dsm_do_shed(demand_dsm_5) -+455.88267648036174 SinkDSMDIWInvestmentBlock_invest(demand_dsm_0) -+440.53147366914004 SinkDSMDIWInvestmentBlock_invest(demand_dsm_1) -+425.7302732994234 SinkDSMDIWInvestmentBlock_invest(demand_dsm_2) ++76.46810240317063 SinkDSMDIWInvestmentBlock_invest(demand_dsm_0) ++49.710949277906536 SinkDSMDIWInvestmentBlock_invest(demand_dsm_1) ++24.239842660236203 SinkDSMDIWInvestmentBlock_invest(demand_dsm_2) s.t. diff --git a/tests/lp_files/dsm_module_DIW_invest_multi_period_remaining_value.lp b/tests/lp_files/dsm_module_DIW_invest_multi_period_remaining_value.lp new file mode 100644 index 000000000..e8f35046c --- /dev/null +++ b/tests/lp_files/dsm_module_DIW_invest_multi_period_remaining_value.lp @@ -0,0 +1,487 @@ +\* Source Pyomo model name=Model *\ + +min +objective: ++2941.5609381007307 ONE_VAR_CONSTANT ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_0_0) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_1_0) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_2_0) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_3_0) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_4_0) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_5_0) ++100 SinkDSMDIWInvestmentBlock_dsm_do_shed(demand_dsm_0) ++1 SinkDSMDIWInvestmentBlock_dsm_up(demand_dsm_0) ++1 SinkDSMDIWInvestmentBlock_dsm_up(demand_dsm_1) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_0_1) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_1_1) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_2_1) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_3_1) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_4_1) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_5_1) ++100 SinkDSMDIWInvestmentBlock_dsm_do_shed(demand_dsm_1) ++0.9803921568627451 SinkDSMDIWInvestmentBlock_dsm_up(demand_dsm_2) ++0.9803921568627451 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_0_2) ++0.9803921568627451 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_1_2) ++0.9803921568627451 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_2_2) ++0.9803921568627451 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_3_2) ++0.9803921568627451 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_4_2) ++0.9803921568627451 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_5_2) ++98.0392156862745 SinkDSMDIWInvestmentBlock_dsm_do_shed(demand_dsm_2) ++0.9803921568627451 SinkDSMDIWInvestmentBlock_dsm_up(demand_dsm_3) ++0.9803921568627451 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_0_3) ++0.9803921568627451 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_1_3) ++0.9803921568627451 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_2_3) ++0.9803921568627451 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_3_3) ++0.9803921568627451 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_4_3) ++0.9803921568627451 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_5_3) ++98.0392156862745 SinkDSMDIWInvestmentBlock_dsm_do_shed(demand_dsm_3) ++0.9611687812379853 SinkDSMDIWInvestmentBlock_dsm_up(demand_dsm_4) ++0.9611687812379853 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_0_4) ++0.9611687812379853 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_1_4) ++0.9611687812379853 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_2_4) ++0.9611687812379853 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_3_4) ++0.9611687812379853 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_4_4) ++0.9611687812379853 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_5_4) ++96.11687812379853 SinkDSMDIWInvestmentBlock_dsm_do_shed(demand_dsm_4) ++0.9611687812379853 SinkDSMDIWInvestmentBlock_dsm_up(demand_dsm_5) ++0.9611687812379853 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_0_5) ++0.9611687812379853 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_1_5) ++0.9611687812379853 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_2_5) ++0.9611687812379853 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_3_5) ++0.9611687812379853 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_4_5) ++0.9611687812379853 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_5_5) ++96.11687812379853 SinkDSMDIWInvestmentBlock_dsm_do_shed(demand_dsm_5) ++57.62165571222974 SinkDSMDIWInvestmentBlock_invest(demand_dsm_0) ++39.12361323621548 SinkDSMDIWInvestmentBlock_invest(demand_dsm_1) ++23.087255832295018 SinkDSMDIWInvestmentBlock_invest(demand_dsm_2) + +s.t. + +c_e_BusBlock_balance(bus_elec_0_0)_: ++1 flow(bus_elec_demand_dsm_0_0) += 0 + +c_e_BusBlock_balance(bus_elec_0_1)_: ++1 flow(bus_elec_demand_dsm_0_1) += 0 + +c_e_BusBlock_balance(bus_elec_1_2)_: ++1 flow(bus_elec_demand_dsm_1_2) += 0 + +c_e_BusBlock_balance(bus_elec_1_3)_: ++1 flow(bus_elec_demand_dsm_1_3) += 0 + +c_e_BusBlock_balance(bus_elec_2_4)_: ++1 flow(bus_elec_demand_dsm_2_4) += 0 + +c_e_BusBlock_balance(bus_elec_2_5)_: ++1 flow(bus_elec_demand_dsm_2_5) += 0 + +c_e_SinkDSMDIWInvestmentBlock_total_dsm_rule(demand_dsm_0)_: +-1 SinkDSMDIWInvestmentBlock_invest(demand_dsm_0) ++1 SinkDSMDIWInvestmentBlock_total(demand_dsm_0) += 50 + +c_e_SinkDSMDIWInvestmentBlock_total_dsm_rule(demand_dsm_1)_: +-1 SinkDSMDIWInvestmentBlock_invest(demand_dsm_1) +-1 SinkDSMDIWInvestmentBlock_total(demand_dsm_0) ++1 SinkDSMDIWInvestmentBlock_total(demand_dsm_1) ++1 SinkDSMDIWInvestmentBlock_old(demand_dsm_1) += 0 + +c_e_SinkDSMDIWInvestmentBlock_total_dsm_rule(demand_dsm_2)_: +-1 SinkDSMDIWInvestmentBlock_invest(demand_dsm_2) +-1 SinkDSMDIWInvestmentBlock_total(demand_dsm_1) ++1 SinkDSMDIWInvestmentBlock_total(demand_dsm_2) ++1 SinkDSMDIWInvestmentBlock_old(demand_dsm_2) += 0 + +c_e_SinkDSMDIWInvestmentBlock_old_dsm_rule_end(demand_dsm_0)_: ++1 SinkDSMDIWInvestmentBlock_old_end(demand_dsm_0) += 0 + +c_e_SinkDSMDIWInvestmentBlock_old_dsm_rule_end(demand_dsm_1)_: ++1 SinkDSMDIWInvestmentBlock_old_end(demand_dsm_1) += 0 + +c_e_SinkDSMDIWInvestmentBlock_old_dsm_rule_end(demand_dsm_2)_: ++1 SinkDSMDIWInvestmentBlock_old_end(demand_dsm_2) += 0 + +c_e_SinkDSMDIWInvestmentBlock_old_dsm_rule_exo(demand_dsm_0)_: ++1 SinkDSMDIWInvestmentBlock_old_exo(demand_dsm_0) += 0 + +c_e_SinkDSMDIWInvestmentBlock_old_dsm_rule_exo(demand_dsm_1)_: ++1 SinkDSMDIWInvestmentBlock_old_exo(demand_dsm_1) += 0 + +c_e_SinkDSMDIWInvestmentBlock_old_dsm_rule_exo(demand_dsm_2)_: ++1 SinkDSMDIWInvestmentBlock_old_exo(demand_dsm_2) += 0 + +c_e_SinkDSMDIWInvestmentBlock_old_dsm_rule(demand_dsm_0)_: +-1 SinkDSMDIWInvestmentBlock_old_end(demand_dsm_0) +-1 SinkDSMDIWInvestmentBlock_old_exo(demand_dsm_0) ++1 SinkDSMDIWInvestmentBlock_old(demand_dsm_0) += 0 + +c_e_SinkDSMDIWInvestmentBlock_old_dsm_rule(demand_dsm_1)_: ++1 SinkDSMDIWInvestmentBlock_old(demand_dsm_1) +-1 SinkDSMDIWInvestmentBlock_old_end(demand_dsm_1) +-1 SinkDSMDIWInvestmentBlock_old_exo(demand_dsm_1) += 0 + +c_e_SinkDSMDIWInvestmentBlock_old_dsm_rule(demand_dsm_2)_: ++1 SinkDSMDIWInvestmentBlock_old(demand_dsm_2) +-1 SinkDSMDIWInvestmentBlock_old_end(demand_dsm_2) +-1 SinkDSMDIWInvestmentBlock_old_exo(demand_dsm_2) += 0 + +c_e_SinkDSMDIWInvestmentBlock_input_output_relation(demand_dsm_0_0)_: ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_0_0) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_1_0) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shed(demand_dsm_0) +-1 SinkDSMDIWInvestmentBlock_dsm_up(demand_dsm_0) ++1 flow(bus_elec_demand_dsm_0_0) += 1 + +c_e_SinkDSMDIWInvestmentBlock_input_output_relation(demand_dsm_0_1)_: +-1 SinkDSMDIWInvestmentBlock_dsm_up(demand_dsm_1) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_0_1) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_1_1) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_2_1) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shed(demand_dsm_1) ++1 flow(bus_elec_demand_dsm_0_1) += 1 + +c_e_SinkDSMDIWInvestmentBlock_input_output_relation(demand_dsm_1_2)_: +-1 SinkDSMDIWInvestmentBlock_dsm_up(demand_dsm_2) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_1_2) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_2_2) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_3_2) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shed(demand_dsm_2) ++1 flow(bus_elec_demand_dsm_1_2) += 2 + +c_e_SinkDSMDIWInvestmentBlock_input_output_relation(demand_dsm_1_3)_: +-1 SinkDSMDIWInvestmentBlock_dsm_up(demand_dsm_3) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_2_3) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_3_3) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_4_3) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shed(demand_dsm_3) ++1 flow(bus_elec_demand_dsm_1_3) += 2 + +c_e_SinkDSMDIWInvestmentBlock_input_output_relation(demand_dsm_2_4)_: +-1 SinkDSMDIWInvestmentBlock_dsm_up(demand_dsm_4) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_3_4) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_4_4) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_5_4) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shed(demand_dsm_4) ++1 flow(bus_elec_demand_dsm_2_4) += 3 + +c_e_SinkDSMDIWInvestmentBlock_input_output_relation(demand_dsm_2_5)_: +-1 SinkDSMDIWInvestmentBlock_dsm_up(demand_dsm_5) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_4_5) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_5_5) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shed(demand_dsm_5) ++1 flow(bus_elec_demand_dsm_2_5) += 3 + +c_e_SinkDSMDIWInvestmentBlock_dsm_updo_constraint(demand_dsm_0)_: +-1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_0_0) ++1 SinkDSMDIWInvestmentBlock_dsm_up(demand_dsm_0) +-1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_0_1) += 0 + +c_e_SinkDSMDIWInvestmentBlock_dsm_updo_constraint(demand_dsm_1)_: +-1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_1_0) ++1 SinkDSMDIWInvestmentBlock_dsm_up(demand_dsm_1) +-1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_1_1) +-1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_1_2) += 0 + +c_e_SinkDSMDIWInvestmentBlock_dsm_updo_constraint(demand_dsm_2)_: +-1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_2_1) ++1 SinkDSMDIWInvestmentBlock_dsm_up(demand_dsm_2) +-1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_2_2) +-1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_2_3) += 0 + +c_e_SinkDSMDIWInvestmentBlock_dsm_updo_constraint(demand_dsm_3)_: +-1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_3_2) ++1 SinkDSMDIWInvestmentBlock_dsm_up(demand_dsm_3) +-1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_3_3) +-1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_3_4) += 0 + +c_e_SinkDSMDIWInvestmentBlock_dsm_updo_constraint(demand_dsm_4)_: +-1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_4_3) ++1 SinkDSMDIWInvestmentBlock_dsm_up(demand_dsm_4) +-1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_4_4) +-1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_4_5) += 0 + +c_e_SinkDSMDIWInvestmentBlock_dsm_updo_constraint(demand_dsm_5)_: +-1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_5_4) ++1 SinkDSMDIWInvestmentBlock_dsm_up(demand_dsm_5) +-1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_5_5) += 0 + +c_u_SinkDSMDIWInvestmentBlock_dsm_up_constraint(demand_dsm_0_0)_: ++1 SinkDSMDIWInvestmentBlock_dsm_up(demand_dsm_0) +-0.5 SinkDSMDIWInvestmentBlock_total(demand_dsm_0) +<= 0 + +c_u_SinkDSMDIWInvestmentBlock_dsm_up_constraint(demand_dsm_0_1)_: ++1 SinkDSMDIWInvestmentBlock_dsm_up(demand_dsm_1) +-0.5 SinkDSMDIWInvestmentBlock_total(demand_dsm_0) +<= 0 + +c_u_SinkDSMDIWInvestmentBlock_dsm_up_constraint(demand_dsm_1_2)_: ++1 SinkDSMDIWInvestmentBlock_dsm_up(demand_dsm_2) +-0.5 SinkDSMDIWInvestmentBlock_total(demand_dsm_1) +<= 0 + +c_u_SinkDSMDIWInvestmentBlock_dsm_up_constraint(demand_dsm_1_3)_: ++1 SinkDSMDIWInvestmentBlock_dsm_up(demand_dsm_3) +-0.5 SinkDSMDIWInvestmentBlock_total(demand_dsm_1) +<= 0 + +c_u_SinkDSMDIWInvestmentBlock_dsm_up_constraint(demand_dsm_2_4)_: ++1 SinkDSMDIWInvestmentBlock_dsm_up(demand_dsm_4) +-0.5 SinkDSMDIWInvestmentBlock_total(demand_dsm_2) +<= 0 + +c_u_SinkDSMDIWInvestmentBlock_dsm_up_constraint(demand_dsm_2_5)_: ++1 SinkDSMDIWInvestmentBlock_dsm_up(demand_dsm_5) +-0.5 SinkDSMDIWInvestmentBlock_total(demand_dsm_2) +<= 0 + +c_u_SinkDSMDIWInvestmentBlock_dsm_do_constraint(demand_dsm_0_0)_: ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_0_0) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_1_0) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shed(demand_dsm_0) +-0.5 SinkDSMDIWInvestmentBlock_total(demand_dsm_0) +<= 0 + +c_u_SinkDSMDIWInvestmentBlock_dsm_do_constraint(demand_dsm_0_1)_: ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_0_1) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_1_1) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_2_1) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shed(demand_dsm_1) +-0.5 SinkDSMDIWInvestmentBlock_total(demand_dsm_0) +<= 0 + +c_u_SinkDSMDIWInvestmentBlock_dsm_do_constraint(demand_dsm_1_2)_: ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_1_2) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_2_2) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_3_2) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shed(demand_dsm_2) +-0.5 SinkDSMDIWInvestmentBlock_total(demand_dsm_1) +<= 0 + +c_u_SinkDSMDIWInvestmentBlock_dsm_do_constraint(demand_dsm_1_3)_: ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_2_3) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_3_3) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_4_3) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shed(demand_dsm_3) +-0.5 SinkDSMDIWInvestmentBlock_total(demand_dsm_1) +<= 0 + +c_u_SinkDSMDIWInvestmentBlock_dsm_do_constraint(demand_dsm_2_4)_: ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_3_4) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_4_4) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_5_4) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shed(demand_dsm_4) +-0.5 SinkDSMDIWInvestmentBlock_total(demand_dsm_2) +<= 0 + +c_u_SinkDSMDIWInvestmentBlock_dsm_do_constraint(demand_dsm_2_5)_: ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_4_5) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_5_5) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shed(demand_dsm_5) +-0.5 SinkDSMDIWInvestmentBlock_total(demand_dsm_2) +<= 0 + +c_u_SinkDSMDIWInvestmentBlock_C2_constraint(demand_dsm_0_0)_: ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_0_0) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_1_0) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shed(demand_dsm_0) ++1 SinkDSMDIWInvestmentBlock_dsm_up(demand_dsm_0) +-0.5 SinkDSMDIWInvestmentBlock_total(demand_dsm_0) +<= 0 + +c_u_SinkDSMDIWInvestmentBlock_C2_constraint(demand_dsm_0_1)_: ++1 SinkDSMDIWInvestmentBlock_dsm_up(demand_dsm_1) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_0_1) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_1_1) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_2_1) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shed(demand_dsm_1) +-0.5 SinkDSMDIWInvestmentBlock_total(demand_dsm_0) +<= 0 + +c_u_SinkDSMDIWInvestmentBlock_C2_constraint(demand_dsm_1_2)_: ++1 SinkDSMDIWInvestmentBlock_dsm_up(demand_dsm_2) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_1_2) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_2_2) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_3_2) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shed(demand_dsm_2) +-0.5 SinkDSMDIWInvestmentBlock_total(demand_dsm_1) +<= 0 + +c_u_SinkDSMDIWInvestmentBlock_C2_constraint(demand_dsm_1_3)_: ++1 SinkDSMDIWInvestmentBlock_dsm_up(demand_dsm_3) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_2_3) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_3_3) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_4_3) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shed(demand_dsm_3) +-0.5 SinkDSMDIWInvestmentBlock_total(demand_dsm_1) +<= 0 + +c_u_SinkDSMDIWInvestmentBlock_C2_constraint(demand_dsm_2_4)_: ++1 SinkDSMDIWInvestmentBlock_dsm_up(demand_dsm_4) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_3_4) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_4_4) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_5_4) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shed(demand_dsm_4) +-0.5 SinkDSMDIWInvestmentBlock_total(demand_dsm_2) +<= 0 + +c_u_SinkDSMDIWInvestmentBlock_C2_constraint(demand_dsm_2_5)_: ++1 SinkDSMDIWInvestmentBlock_dsm_up(demand_dsm_5) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_4_5) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_5_5) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shed(demand_dsm_5) +-0.5 SinkDSMDIWInvestmentBlock_total(demand_dsm_2) +<= 0 + +c_u_SinkDSMDIWInvestmentBlock_shed_limit_constraint(demand_dsm_0_0)_: ++1 SinkDSMDIWInvestmentBlock_dsm_do_shed(demand_dsm_0) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shed(demand_dsm_1) +-1.0 SinkDSMDIWInvestmentBlock_total(demand_dsm_0) +<= 0 + +c_u_SinkDSMDIWInvestmentBlock_shed_limit_constraint(demand_dsm_0_1)_: ++1 SinkDSMDIWInvestmentBlock_dsm_do_shed(demand_dsm_1) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shed(demand_dsm_2) +-1.0 SinkDSMDIWInvestmentBlock_total(demand_dsm_0) +<= 0 + +c_u_SinkDSMDIWInvestmentBlock_shed_limit_constraint(demand_dsm_1_2)_: ++1 SinkDSMDIWInvestmentBlock_dsm_do_shed(demand_dsm_2) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shed(demand_dsm_3) +-1.0 SinkDSMDIWInvestmentBlock_total(demand_dsm_1) +<= 0 + +c_u_SinkDSMDIWInvestmentBlock_shed_limit_constraint(demand_dsm_1_3)_: ++1 SinkDSMDIWInvestmentBlock_dsm_do_shed(demand_dsm_3) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shed(demand_dsm_4) +-1.0 SinkDSMDIWInvestmentBlock_total(demand_dsm_1) +<= 0 + +c_u_SinkDSMDIWInvestmentBlock_shed_limit_constraint(demand_dsm_2_4)_: ++1 SinkDSMDIWInvestmentBlock_dsm_do_shed(demand_dsm_4) ++1 SinkDSMDIWInvestmentBlock_dsm_do_shed(demand_dsm_5) +-1.0 SinkDSMDIWInvestmentBlock_total(demand_dsm_2) +<= 0 + +c_u_SinkDSMDIWInvestmentBlock_shed_limit_constraint(demand_dsm_2_5)_: ++1 SinkDSMDIWInvestmentBlock_dsm_do_shed(demand_dsm_5) +-1.0 SinkDSMDIWInvestmentBlock_total(demand_dsm_2) +<= 0 + +c_u_SinkDSMDIWInvestmentBlock_overall_dsm_maximum(demand_dsm_0)_: ++1 SinkDSMDIWInvestmentBlock_total(demand_dsm_0) +<= 1000 + +c_u_SinkDSMDIWInvestmentBlock_overall_dsm_maximum(demand_dsm_1)_: ++1 SinkDSMDIWInvestmentBlock_total(demand_dsm_1) +<= 1000 + +c_u_SinkDSMDIWInvestmentBlock_overall_dsm_maximum(demand_dsm_2)_: ++1 SinkDSMDIWInvestmentBlock_total(demand_dsm_2) +<= 1000 + +c_l_SinkDSMDIWInvestmentBlock_overall_minimum(demand_dsm)_: ++1 SinkDSMDIWInvestmentBlock_total(demand_dsm_2) +>= 5 + +bounds + 1 <= ONE_VAR_CONSTANT <= 1 + 0 <= SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_0_0) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_1_0) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_2_0) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_3_0) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_4_0) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_5_0) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_dsm_do_shed(demand_dsm_0) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_dsm_up(demand_dsm_0) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_dsm_up(demand_dsm_1) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_0_1) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_1_1) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_2_1) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_3_1) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_4_1) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_5_1) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_dsm_do_shed(demand_dsm_1) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_dsm_up(demand_dsm_2) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_0_2) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_1_2) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_2_2) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_3_2) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_4_2) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_5_2) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_dsm_do_shed(demand_dsm_2) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_dsm_up(demand_dsm_3) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_0_3) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_1_3) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_2_3) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_3_3) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_4_3) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_5_3) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_dsm_do_shed(demand_dsm_3) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_dsm_up(demand_dsm_4) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_0_4) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_1_4) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_2_4) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_3_4) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_4_4) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_5_4) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_dsm_do_shed(demand_dsm_4) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_dsm_up(demand_dsm_5) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_0_5) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_1_5) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_2_5) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_3_5) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_4_5) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_5_5) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_dsm_do_shed(demand_dsm_5) <= +inf + 33 <= SinkDSMDIWInvestmentBlock_invest(demand_dsm_0) <= 100 + 33 <= SinkDSMDIWInvestmentBlock_invest(demand_dsm_1) <= 100 + 33 <= SinkDSMDIWInvestmentBlock_invest(demand_dsm_2) <= 100 + 0 <= flow(bus_elec_demand_dsm_0_0) <= +inf + 0 <= flow(bus_elec_demand_dsm_0_1) <= +inf + 0 <= flow(bus_elec_demand_dsm_1_2) <= +inf + 0 <= flow(bus_elec_demand_dsm_1_3) <= +inf + 0 <= flow(bus_elec_demand_dsm_2_4) <= +inf + 0 <= flow(bus_elec_demand_dsm_2_5) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_total(demand_dsm_0) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_total(demand_dsm_1) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_old(demand_dsm_1) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_total(demand_dsm_2) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_old(demand_dsm_2) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_old_end(demand_dsm_0) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_old_end(demand_dsm_1) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_old_end(demand_dsm_2) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_old_exo(demand_dsm_0) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_old_exo(demand_dsm_1) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_old_exo(demand_dsm_2) <= +inf + 0 <= SinkDSMDIWInvestmentBlock_old(demand_dsm_0) <= +inf +end diff --git a/tests/lp_files/dsm_module_DLR_invest_multi_period.lp b/tests/lp_files/dsm_module_DLR_invest_multi_period.lp index ff00f7ab2..3fb7aa6fd 100644 --- a/tests/lp_files/dsm_module_DLR_invest_multi_period.lp +++ b/tests/lp_files/dsm_module_DLR_invest_multi_period.lp @@ -2,7 +2,7 @@ min objective: -+15992.031251718836 ONE_VAR_CONSTANT ++2941.5609381007307 ONE_VAR_CONSTANT +1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_1_0) +1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_1_0) +1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_2_0) @@ -57,9 +57,9 @@ objective: +0.9611687812379853 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_2_5) +0.9611687812379853 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_2_5) +96.11687812379853 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_5) -+455.88267648036174 SinkDSMDLRInvestmentBlock_invest(demand_dsm_0) -+440.53147366914004 SinkDSMDLRInvestmentBlock_invest(demand_dsm_1) -+425.7302732994234 SinkDSMDLRInvestmentBlock_invest(demand_dsm_2) ++76.46810240317063 SinkDSMDLRInvestmentBlock_invest(demand_dsm_0) ++49.710949277906536 SinkDSMDLRInvestmentBlock_invest(demand_dsm_1) ++24.239842660236203 SinkDSMDLRInvestmentBlock_invest(demand_dsm_2) s.t. @@ -623,13 +623,13 @@ c_u_SinkDSMDLRInvestmentBlock_dr_storage_limit_inc(demand_dsm_2_5)_: c_u_SinkDSMDLRInvestmentBlock_dr_yearly_limit_shed(demand_dsm_0)_: +1 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_0) +1 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_1) --50 SinkDSMDLRInvestmentBlock_total(demand_dsm_0) +-50.0 SinkDSMDLRInvestmentBlock_total(demand_dsm_0) <= 0 c_u_SinkDSMDLRInvestmentBlock_dr_yearly_limit_shed(demand_dsm_1)_: +1 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_2) +1 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_3) --50 SinkDSMDLRInvestmentBlock_total(demand_dsm_1) +-50.0 SinkDSMDLRInvestmentBlock_total(demand_dsm_1) <= 0 c_u_SinkDSMDLRInvestmentBlock_dr_yearly_limit_shed(demand_dsm_2)_: diff --git a/tests/lp_files/dsm_module_DLR_invest_multi_period_remaining_value.lp b/tests/lp_files/dsm_module_DLR_invest_multi_period_remaining_value.lp new file mode 100644 index 000000000..d543924d8 --- /dev/null +++ b/tests/lp_files/dsm_module_DLR_invest_multi_period_remaining_value.lp @@ -0,0 +1,824 @@ +\* Source Pyomo model name=Model *\ + +min +objective: ++2941.5609381007307 ONE_VAR_CONSTANT ++1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_1_0) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_1_0) ++1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_2_0) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_2_0) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_1_0) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_1_0) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_2_0) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_2_0) ++100 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_0) ++1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_1_1) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_1_1) ++1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_2_1) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_2_1) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_1_1) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_1_1) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_2_1) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_2_1) ++100 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_1) ++0.9803921568627451 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_1_2) ++0.9803921568627451 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_1_2) ++0.9803921568627451 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_2_2) ++0.9803921568627451 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_2_2) ++0.9803921568627451 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_1_2) ++0.9803921568627451 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_1_2) ++0.9803921568627451 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_2_2) ++0.9803921568627451 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_2_2) ++98.0392156862745 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_2) ++0.9803921568627451 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_1_3) ++0.9803921568627451 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_1_3) ++0.9803921568627451 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_2_3) ++0.9803921568627451 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_2_3) ++0.9803921568627451 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_1_3) ++0.9803921568627451 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_1_3) ++0.9803921568627451 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_2_3) ++0.9803921568627451 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_2_3) ++98.0392156862745 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_3) ++0.9611687812379853 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_1_4) ++0.9611687812379853 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_1_4) ++0.9611687812379853 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_2_4) ++0.9611687812379853 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_2_4) ++0.9611687812379853 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_1_4) ++0.9611687812379853 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_1_4) ++0.9611687812379853 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_2_4) ++0.9611687812379853 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_2_4) ++96.11687812379853 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_4) ++0.9611687812379853 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_1_5) ++0.9611687812379853 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_1_5) ++0.9611687812379853 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_2_5) ++0.9611687812379853 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_2_5) ++0.9611687812379853 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_1_5) ++0.9611687812379853 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_1_5) ++0.9611687812379853 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_2_5) ++0.9611687812379853 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_2_5) ++96.11687812379853 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_5) ++57.62165571222974 SinkDSMDLRInvestmentBlock_invest(demand_dsm_0) ++39.12361323621548 SinkDSMDLRInvestmentBlock_invest(demand_dsm_1) ++23.087255832295018 SinkDSMDLRInvestmentBlock_invest(demand_dsm_2) + +s.t. + +c_e_BusBlock_balance(bus_elec_0_0)_: ++1 flow(bus_elec_demand_dsm_0_0) += 0 + +c_e_BusBlock_balance(bus_elec_0_1)_: ++1 flow(bus_elec_demand_dsm_0_1) += 0 + +c_e_BusBlock_balance(bus_elec_1_2)_: ++1 flow(bus_elec_demand_dsm_1_2) += 0 + +c_e_BusBlock_balance(bus_elec_1_3)_: ++1 flow(bus_elec_demand_dsm_1_3) += 0 + +c_e_BusBlock_balance(bus_elec_2_4)_: ++1 flow(bus_elec_demand_dsm_2_4) += 0 + +c_e_BusBlock_balance(bus_elec_2_5)_: ++1 flow(bus_elec_demand_dsm_2_5) += 0 + +c_e_SinkDSMDLRInvestmentBlock_total_dsm_rule(demand_dsm_0)_: +-1 SinkDSMDLRInvestmentBlock_invest(demand_dsm_0) ++1 SinkDSMDLRInvestmentBlock_total(demand_dsm_0) += 50 + +c_e_SinkDSMDLRInvestmentBlock_total_dsm_rule(demand_dsm_1)_: +-1 SinkDSMDLRInvestmentBlock_invest(demand_dsm_1) +-1 SinkDSMDLRInvestmentBlock_total(demand_dsm_0) ++1 SinkDSMDLRInvestmentBlock_total(demand_dsm_1) ++1 SinkDSMDLRInvestmentBlock_old(demand_dsm_1) += 0 + +c_e_SinkDSMDLRInvestmentBlock_total_dsm_rule(demand_dsm_2)_: +-1 SinkDSMDLRInvestmentBlock_invest(demand_dsm_2) +-1 SinkDSMDLRInvestmentBlock_total(demand_dsm_1) ++1 SinkDSMDLRInvestmentBlock_total(demand_dsm_2) ++1 SinkDSMDLRInvestmentBlock_old(demand_dsm_2) += 0 + +c_e_SinkDSMDLRInvestmentBlock_old_dsm_rule_end(demand_dsm_0)_: ++1 SinkDSMDLRInvestmentBlock_old_end(demand_dsm_0) += 0 + +c_e_SinkDSMDLRInvestmentBlock_old_dsm_rule_end(demand_dsm_1)_: ++1 SinkDSMDLRInvestmentBlock_old_end(demand_dsm_1) += 0 + +c_e_SinkDSMDLRInvestmentBlock_old_dsm_rule_end(demand_dsm_2)_: ++1 SinkDSMDLRInvestmentBlock_old_end(demand_dsm_2) += 0 + +c_e_SinkDSMDLRInvestmentBlock_old_dsm_rule_exo(demand_dsm_0)_: ++1 SinkDSMDLRInvestmentBlock_old_exo(demand_dsm_0) += 0 + +c_e_SinkDSMDLRInvestmentBlock_old_dsm_rule_exo(demand_dsm_1)_: ++1 SinkDSMDLRInvestmentBlock_old_exo(demand_dsm_1) += 0 + +c_e_SinkDSMDLRInvestmentBlock_old_dsm_rule_exo(demand_dsm_2)_: ++1 SinkDSMDLRInvestmentBlock_old_exo(demand_dsm_2) += 0 + +c_e_SinkDSMDLRInvestmentBlock_old_dsm_rule(demand_dsm_0)_: +-1 SinkDSMDLRInvestmentBlock_old_end(demand_dsm_0) +-1 SinkDSMDLRInvestmentBlock_old_exo(demand_dsm_0) ++1 SinkDSMDLRInvestmentBlock_old(demand_dsm_0) += 0 + +c_e_SinkDSMDLRInvestmentBlock_old_dsm_rule(demand_dsm_1)_: ++1 SinkDSMDLRInvestmentBlock_old(demand_dsm_1) +-1 SinkDSMDLRInvestmentBlock_old_end(demand_dsm_1) +-1 SinkDSMDLRInvestmentBlock_old_exo(demand_dsm_1) += 0 + +c_e_SinkDSMDLRInvestmentBlock_old_dsm_rule(demand_dsm_2)_: ++1 SinkDSMDLRInvestmentBlock_old(demand_dsm_2) +-1 SinkDSMDLRInvestmentBlock_old_end(demand_dsm_2) +-1 SinkDSMDLRInvestmentBlock_old_exo(demand_dsm_2) += 0 + +c_e_SinkDSMDLRInvestmentBlock_input_output_relation(demand_dsm_0_0)_: +-1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_1_0) +-1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_1_0) +-1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_2_0) +-1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_2_0) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_1_0) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_1_0) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_2_0) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_2_0) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_0) ++1 flow(bus_elec_demand_dsm_0_0) += 1 + +c_e_SinkDSMDLRInvestmentBlock_input_output_relation(demand_dsm_0_1)_: +-1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_1_1) +-1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_1_1) +-1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_2_1) +-1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_2_1) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_1_1) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_1_1) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_2_1) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_2_1) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_1) ++1 flow(bus_elec_demand_dsm_0_1) += 1 + +c_e_SinkDSMDLRInvestmentBlock_input_output_relation(demand_dsm_1_2)_: +-1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_1_2) +-1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_1_2) +-1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_2_2) +-1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_2_2) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_1_2) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_1_2) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_2_2) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_2_2) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_2) ++1 flow(bus_elec_demand_dsm_1_2) += 2 + +c_e_SinkDSMDLRInvestmentBlock_input_output_relation(demand_dsm_1_3)_: +-1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_1_3) +-1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_1_3) +-1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_2_3) +-1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_2_3) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_1_3) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_1_3) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_2_3) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_2_3) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_3) ++1 flow(bus_elec_demand_dsm_1_3) += 2 + +c_e_SinkDSMDLRInvestmentBlock_input_output_relation(demand_dsm_2_4)_: +-1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_1_4) +-1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_1_4) +-1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_2_4) +-1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_2_4) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_1_4) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_1_4) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_2_4) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_2_4) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_4) ++1 flow(bus_elec_demand_dsm_2_4) += 3 + +c_e_SinkDSMDLRInvestmentBlock_input_output_relation(demand_dsm_2_5)_: +-1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_1_5) +-1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_1_5) +-1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_2_5) +-1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_2_5) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_1_5) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_1_5) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_2_5) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_2_5) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_5) ++1 flow(bus_elec_demand_dsm_2_5) += 3 + +c_e_SinkDSMDLRInvestmentBlock_capacity_balance_red(demand_dsm_1_0)_: ++1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_1_0) += 0 + +c_e_SinkDSMDLRInvestmentBlock_capacity_balance_red(demand_dsm_1_1)_: +-1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_1_0) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_1_1) += 0 + +c_e_SinkDSMDLRInvestmentBlock_capacity_balance_red(demand_dsm_1_2)_: +-1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_1_1) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_1_2) += 0 + +c_e_SinkDSMDLRInvestmentBlock_capacity_balance_red(demand_dsm_1_3)_: +-1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_1_2) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_1_3) += 0 + +c_e_SinkDSMDLRInvestmentBlock_capacity_balance_red(demand_dsm_1_4)_: +-1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_1_3) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_1_4) += 0 + +c_e_SinkDSMDLRInvestmentBlock_capacity_balance_red(demand_dsm_1_5)_: +-1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_1_4) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_1_5) += 0 + +c_e_SinkDSMDLRInvestmentBlock_capacity_balance_red(demand_dsm_2_0)_: ++1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_2_0) += 0 + +c_e_SinkDSMDLRInvestmentBlock_capacity_balance_red(demand_dsm_2_2)_: +-1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_2_0) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_2_2) += 0 + +c_e_SinkDSMDLRInvestmentBlock_capacity_balance_red(demand_dsm_2_3)_: +-1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_2_1) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_2_3) += 0 + +c_e_SinkDSMDLRInvestmentBlock_capacity_balance_red(demand_dsm_2_4)_: +-1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_2_2) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_2_4) += 0 + +c_e_SinkDSMDLRInvestmentBlock_capacity_balance_red(demand_dsm_2_5)_: +-1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_2_3) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_2_5) += 0 + +c_e_SinkDSMDLRInvestmentBlock_capacity_balance_inc(demand_dsm_1_0)_: ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_1_0) += 0 + +c_e_SinkDSMDLRInvestmentBlock_capacity_balance_inc(demand_dsm_1_1)_: +-1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_1_0) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_1_1) += 0 + +c_e_SinkDSMDLRInvestmentBlock_capacity_balance_inc(demand_dsm_1_2)_: +-1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_1_1) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_1_2) += 0 + +c_e_SinkDSMDLRInvestmentBlock_capacity_balance_inc(demand_dsm_1_3)_: +-1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_1_2) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_1_3) += 0 + +c_e_SinkDSMDLRInvestmentBlock_capacity_balance_inc(demand_dsm_1_4)_: +-1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_1_3) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_1_4) += 0 + +c_e_SinkDSMDLRInvestmentBlock_capacity_balance_inc(demand_dsm_1_5)_: +-1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_1_4) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_1_5) += 0 + +c_e_SinkDSMDLRInvestmentBlock_capacity_balance_inc(demand_dsm_2_0)_: ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_2_0) += 0 + +c_e_SinkDSMDLRInvestmentBlock_capacity_balance_inc(demand_dsm_2_2)_: +-1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_2_0) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_2_2) += 0 + +c_e_SinkDSMDLRInvestmentBlock_capacity_balance_inc(demand_dsm_2_3)_: +-1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_2_1) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_2_3) += 0 + +c_e_SinkDSMDLRInvestmentBlock_capacity_balance_inc(demand_dsm_2_4)_: +-1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_2_2) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_2_4) += 0 + +c_e_SinkDSMDLRInvestmentBlock_capacity_balance_inc(demand_dsm_2_5)_: +-1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_2_3) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_2_5) += 0 + +c_e_SinkDSMDLRInvestmentBlock_no_comp_red(demand_dsm_1_5)_: ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_1_5) += 0 + +c_e_SinkDSMDLRInvestmentBlock_no_comp_red(demand_dsm_2_4)_: ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_2_4) += 0 + +c_e_SinkDSMDLRInvestmentBlock_no_comp_red(demand_dsm_2_5)_: ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_2_5) += 0 + +c_e_SinkDSMDLRInvestmentBlock_no_comp_inc(demand_dsm_1_5)_: ++1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_1_5) += 0 + +c_e_SinkDSMDLRInvestmentBlock_no_comp_inc(demand_dsm_2_4)_: ++1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_2_4) += 0 + +c_e_SinkDSMDLRInvestmentBlock_no_comp_inc(demand_dsm_2_5)_: ++1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_2_5) += 0 + +c_u_SinkDSMDLRInvestmentBlock_availability_red(demand_dsm_0_0)_: ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_1_0) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_1_0) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_2_0) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_2_0) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_0) +-0.5 SinkDSMDLRInvestmentBlock_total(demand_dsm_0) +<= 0 + +c_u_SinkDSMDLRInvestmentBlock_availability_red(demand_dsm_0_1)_: ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_1_1) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_1_1) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_2_1) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_2_1) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_1) +-0.5 SinkDSMDLRInvestmentBlock_total(demand_dsm_0) +<= 0 + +c_u_SinkDSMDLRInvestmentBlock_availability_red(demand_dsm_1_2)_: ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_1_2) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_1_2) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_2_2) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_2_2) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_2) +-0.5 SinkDSMDLRInvestmentBlock_total(demand_dsm_1) +<= 0 + +c_u_SinkDSMDLRInvestmentBlock_availability_red(demand_dsm_1_3)_: ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_1_3) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_1_3) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_2_3) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_2_3) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_3) +-0.5 SinkDSMDLRInvestmentBlock_total(demand_dsm_1) +<= 0 + +c_u_SinkDSMDLRInvestmentBlock_availability_red(demand_dsm_2_4)_: ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_1_4) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_1_4) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_2_4) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_2_4) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_4) +-0.5 SinkDSMDLRInvestmentBlock_total(demand_dsm_2) +<= 0 + +c_u_SinkDSMDLRInvestmentBlock_availability_red(demand_dsm_2_5)_: ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_1_5) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_1_5) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_2_5) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_2_5) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_5) +-0.5 SinkDSMDLRInvestmentBlock_total(demand_dsm_2) +<= 0 + +c_u_SinkDSMDLRInvestmentBlock_availability_inc(demand_dsm_0_0)_: ++1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_1_0) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_1_0) ++1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_2_0) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_2_0) +-0.5 SinkDSMDLRInvestmentBlock_total(demand_dsm_0) +<= 0 + +c_u_SinkDSMDLRInvestmentBlock_availability_inc(demand_dsm_0_1)_: ++1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_1_1) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_1_1) ++1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_2_1) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_2_1) +-0.5 SinkDSMDLRInvestmentBlock_total(demand_dsm_0) +<= 0 + +c_u_SinkDSMDLRInvestmentBlock_availability_inc(demand_dsm_1_2)_: ++1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_1_2) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_1_2) ++1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_2_2) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_2_2) +-0.5 SinkDSMDLRInvestmentBlock_total(demand_dsm_1) +<= 0 + +c_u_SinkDSMDLRInvestmentBlock_availability_inc(demand_dsm_1_3)_: ++1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_1_3) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_1_3) ++1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_2_3) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_2_3) +-0.5 SinkDSMDLRInvestmentBlock_total(demand_dsm_1) +<= 0 + +c_u_SinkDSMDLRInvestmentBlock_availability_inc(demand_dsm_2_4)_: ++1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_1_4) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_1_4) ++1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_2_4) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_2_4) +-0.5 SinkDSMDLRInvestmentBlock_total(demand_dsm_2) +<= 0 + +c_u_SinkDSMDLRInvestmentBlock_availability_inc(demand_dsm_2_5)_: ++1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_1_5) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_1_5) ++1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_2_5) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_2_5) +-0.5 SinkDSMDLRInvestmentBlock_total(demand_dsm_2) +<= 0 + +c_e_SinkDSMDLRInvestmentBlock_dr_storage_red(demand_dsm_0)_: +-1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_1_0) +-1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_2_0) ++1 SinkDSMDLRInvestmentBlock_dsm_do_level(demand_dsm_0) += 0 + +c_e_SinkDSMDLRInvestmentBlock_dr_storage_red(demand_dsm_1)_: +-1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_1_1) +-1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_2_1) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_1_1) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_2_1) ++1 SinkDSMDLRInvestmentBlock_dsm_do_level(demand_dsm_0) +-1 SinkDSMDLRInvestmentBlock_dsm_do_level(demand_dsm_1) += 0 + +c_e_SinkDSMDLRInvestmentBlock_dr_storage_red(demand_dsm_2)_: +-1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_1_2) +-1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_2_2) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_1_2) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_2_2) ++1 SinkDSMDLRInvestmentBlock_dsm_do_level(demand_dsm_1) +-1 SinkDSMDLRInvestmentBlock_dsm_do_level(demand_dsm_2) += 0 + +c_e_SinkDSMDLRInvestmentBlock_dr_storage_red(demand_dsm_3)_: +-1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_1_3) +-1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_2_3) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_1_3) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_2_3) ++1 SinkDSMDLRInvestmentBlock_dsm_do_level(demand_dsm_2) +-1 SinkDSMDLRInvestmentBlock_dsm_do_level(demand_dsm_3) += 0 + +c_e_SinkDSMDLRInvestmentBlock_dr_storage_red(demand_dsm_4)_: +-1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_1_4) +-1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_2_4) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_1_4) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_2_4) ++1 SinkDSMDLRInvestmentBlock_dsm_do_level(demand_dsm_3) +-1 SinkDSMDLRInvestmentBlock_dsm_do_level(demand_dsm_4) += 0 + +c_e_SinkDSMDLRInvestmentBlock_dr_storage_red(demand_dsm_5)_: +-1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_1_5) +-1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_2_5) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_1_5) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_2_5) ++1 SinkDSMDLRInvestmentBlock_dsm_do_level(demand_dsm_4) +-1 SinkDSMDLRInvestmentBlock_dsm_do_level(demand_dsm_5) += 0 + +c_e_SinkDSMDLRInvestmentBlock_dr_storage_inc(demand_dsm_0)_: +-1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_1_0) +-1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_2_0) ++1 SinkDSMDLRInvestmentBlock_dsm_up_level(demand_dsm_0) += 0 + +c_e_SinkDSMDLRInvestmentBlock_dr_storage_inc(demand_dsm_1)_: ++1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_1_1) ++1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_2_1) +-1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_1_1) +-1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_2_1) ++1 SinkDSMDLRInvestmentBlock_dsm_up_level(demand_dsm_0) +-1 SinkDSMDLRInvestmentBlock_dsm_up_level(demand_dsm_1) += 0 + +c_e_SinkDSMDLRInvestmentBlock_dr_storage_inc(demand_dsm_2)_: ++1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_1_2) ++1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_2_2) +-1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_1_2) +-1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_2_2) ++1 SinkDSMDLRInvestmentBlock_dsm_up_level(demand_dsm_1) +-1 SinkDSMDLRInvestmentBlock_dsm_up_level(demand_dsm_2) += 0 + +c_e_SinkDSMDLRInvestmentBlock_dr_storage_inc(demand_dsm_3)_: ++1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_1_3) ++1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_2_3) +-1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_1_3) +-1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_2_3) ++1 SinkDSMDLRInvestmentBlock_dsm_up_level(demand_dsm_2) +-1 SinkDSMDLRInvestmentBlock_dsm_up_level(demand_dsm_3) += 0 + +c_e_SinkDSMDLRInvestmentBlock_dr_storage_inc(demand_dsm_4)_: ++1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_1_4) ++1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_2_4) +-1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_1_4) +-1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_2_4) ++1 SinkDSMDLRInvestmentBlock_dsm_up_level(demand_dsm_3) +-1 SinkDSMDLRInvestmentBlock_dsm_up_level(demand_dsm_4) += 0 + +c_e_SinkDSMDLRInvestmentBlock_dr_storage_inc(demand_dsm_5)_: ++1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_1_5) ++1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_2_5) +-1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_1_5) +-1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_2_5) ++1 SinkDSMDLRInvestmentBlock_dsm_up_level(demand_dsm_4) +-1 SinkDSMDLRInvestmentBlock_dsm_up_level(demand_dsm_5) += 0 + +c_u_SinkDSMDLRInvestmentBlock_dr_storage_limit_red(demand_dsm_0_0)_: +-0.5 SinkDSMDLRInvestmentBlock_total(demand_dsm_0) ++1 SinkDSMDLRInvestmentBlock_dsm_do_level(demand_dsm_0) +<= 0 + +c_u_SinkDSMDLRInvestmentBlock_dr_storage_limit_red(demand_dsm_0_1)_: +-0.5 SinkDSMDLRInvestmentBlock_total(demand_dsm_0) ++1 SinkDSMDLRInvestmentBlock_dsm_do_level(demand_dsm_1) +<= 0 + +c_u_SinkDSMDLRInvestmentBlock_dr_storage_limit_red(demand_dsm_1_2)_: +-0.5 SinkDSMDLRInvestmentBlock_total(demand_dsm_1) ++1 SinkDSMDLRInvestmentBlock_dsm_do_level(demand_dsm_2) +<= 0 + +c_u_SinkDSMDLRInvestmentBlock_dr_storage_limit_red(demand_dsm_1_3)_: +-0.5 SinkDSMDLRInvestmentBlock_total(demand_dsm_1) ++1 SinkDSMDLRInvestmentBlock_dsm_do_level(demand_dsm_3) +<= 0 + +c_u_SinkDSMDLRInvestmentBlock_dr_storage_limit_red(demand_dsm_2_4)_: +-0.5 SinkDSMDLRInvestmentBlock_total(demand_dsm_2) ++1 SinkDSMDLRInvestmentBlock_dsm_do_level(demand_dsm_4) +<= 0 + +c_u_SinkDSMDLRInvestmentBlock_dr_storage_limit_red(demand_dsm_2_5)_: +-0.5 SinkDSMDLRInvestmentBlock_total(demand_dsm_2) ++1 SinkDSMDLRInvestmentBlock_dsm_do_level(demand_dsm_5) +<= 0 + +c_u_SinkDSMDLRInvestmentBlock_dr_storage_limit_inc(demand_dsm_0_0)_: +-0.5 SinkDSMDLRInvestmentBlock_total(demand_dsm_0) ++1 SinkDSMDLRInvestmentBlock_dsm_up_level(demand_dsm_0) +<= 0 + +c_u_SinkDSMDLRInvestmentBlock_dr_storage_limit_inc(demand_dsm_0_1)_: +-0.5 SinkDSMDLRInvestmentBlock_total(demand_dsm_0) ++1 SinkDSMDLRInvestmentBlock_dsm_up_level(demand_dsm_1) +<= 0 + +c_u_SinkDSMDLRInvestmentBlock_dr_storage_limit_inc(demand_dsm_1_2)_: +-0.5 SinkDSMDLRInvestmentBlock_total(demand_dsm_1) ++1 SinkDSMDLRInvestmentBlock_dsm_up_level(demand_dsm_2) +<= 0 + +c_u_SinkDSMDLRInvestmentBlock_dr_storage_limit_inc(demand_dsm_1_3)_: +-0.5 SinkDSMDLRInvestmentBlock_total(demand_dsm_1) ++1 SinkDSMDLRInvestmentBlock_dsm_up_level(demand_dsm_3) +<= 0 + +c_u_SinkDSMDLRInvestmentBlock_dr_storage_limit_inc(demand_dsm_2_4)_: +-0.5 SinkDSMDLRInvestmentBlock_total(demand_dsm_2) ++1 SinkDSMDLRInvestmentBlock_dsm_up_level(demand_dsm_4) +<= 0 + +c_u_SinkDSMDLRInvestmentBlock_dr_storage_limit_inc(demand_dsm_2_5)_: +-0.5 SinkDSMDLRInvestmentBlock_total(demand_dsm_2) ++1 SinkDSMDLRInvestmentBlock_dsm_up_level(demand_dsm_5) +<= 0 + +c_u_SinkDSMDLRInvestmentBlock_dr_yearly_limit_shed(demand_dsm_0)_: ++1 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_0) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_1) +-50.0 SinkDSMDLRInvestmentBlock_total(demand_dsm_0) +<= 0 + +c_u_SinkDSMDLRInvestmentBlock_dr_yearly_limit_shed(demand_dsm_1)_: ++1 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_2) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_3) +-50.0 SinkDSMDLRInvestmentBlock_total(demand_dsm_1) +<= 0 + +c_u_SinkDSMDLRInvestmentBlock_dr_yearly_limit_shed(demand_dsm_2)_: ++1 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_4) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_5) +-50.0 SinkDSMDLRInvestmentBlock_total(demand_dsm_2) +<= 0 + +c_u_SinkDSMDLRInvestmentBlock_dr_logical_constraint(demand_dsm_0_0)_: ++1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_1_0) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_1_0) ++1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_2_0) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_2_0) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_1_0) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_1_0) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_2_0) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_2_0) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_0) +-0.5 SinkDSMDLRInvestmentBlock_total(demand_dsm_0) +<= 0 + +c_u_SinkDSMDLRInvestmentBlock_dr_logical_constraint(demand_dsm_0_1)_: ++1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_1_1) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_1_1) ++1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_2_1) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_2_1) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_1_1) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_1_1) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_2_1) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_2_1) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_1) +-0.5 SinkDSMDLRInvestmentBlock_total(demand_dsm_0) +<= 0 + +c_u_SinkDSMDLRInvestmentBlock_dr_logical_constraint(demand_dsm_1_2)_: ++1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_1_2) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_1_2) ++1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_2_2) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_2_2) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_1_2) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_1_2) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_2_2) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_2_2) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_2) +-0.5 SinkDSMDLRInvestmentBlock_total(demand_dsm_1) +<= 0 + +c_u_SinkDSMDLRInvestmentBlock_dr_logical_constraint(demand_dsm_1_3)_: ++1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_1_3) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_1_3) ++1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_2_3) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_2_3) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_1_3) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_1_3) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_2_3) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_2_3) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_3) +-0.5 SinkDSMDLRInvestmentBlock_total(demand_dsm_1) +<= 0 + +c_u_SinkDSMDLRInvestmentBlock_dr_logical_constraint(demand_dsm_2_4)_: ++1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_1_4) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_1_4) ++1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_2_4) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_2_4) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_1_4) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_1_4) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_2_4) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_2_4) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_4) +-0.5 SinkDSMDLRInvestmentBlock_total(demand_dsm_2) +<= 0 + +c_u_SinkDSMDLRInvestmentBlock_dr_logical_constraint(demand_dsm_2_5)_: ++1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_1_5) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_1_5) ++1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_2_5) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_2_5) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_1_5) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_1_5) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_2_5) ++1 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_2_5) ++1 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_5) +-0.5 SinkDSMDLRInvestmentBlock_total(demand_dsm_2) +<= 0 + +c_u_SinkDSMDLRInvestmentBlock_overall_dsm_maximum(demand_dsm_0)_: ++1 SinkDSMDLRInvestmentBlock_total(demand_dsm_0) +<= 1000 + +c_u_SinkDSMDLRInvestmentBlock_overall_dsm_maximum(demand_dsm_1)_: ++1 SinkDSMDLRInvestmentBlock_total(demand_dsm_1) +<= 1000 + +c_u_SinkDSMDLRInvestmentBlock_overall_dsm_maximum(demand_dsm_2)_: ++1 SinkDSMDLRInvestmentBlock_total(demand_dsm_2) +<= 1000 + +c_l_SinkDSMDLRInvestmentBlock_overall_minimum(demand_dsm)_: ++1 SinkDSMDLRInvestmentBlock_total(demand_dsm_2) +>= 5 + +bounds + 1 <= ONE_VAR_CONSTANT <= 1 + 0 <= SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_1_0) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_1_0) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_2_0) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_2_0) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_1_0) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_1_0) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_2_0) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_2_0) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_0) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_1_1) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_1_1) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_2_1) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_2_1) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_1_1) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_1_1) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_2_1) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_2_1) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_1) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_1_2) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_1_2) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_2_2) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_2_2) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_1_2) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_1_2) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_2_2) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_2_2) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_2) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_1_3) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_1_3) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_2_3) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_2_3) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_1_3) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_1_3) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_2_3) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_2_3) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_3) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_1_4) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_1_4) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_2_4) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_2_4) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_1_4) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_1_4) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_2_4) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_2_4) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_4) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_1_5) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_1_5) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_2_5) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_2_5) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_1_5) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_1_5) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_2_5) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_2_5) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_5) <= +inf + 33 <= SinkDSMDLRInvestmentBlock_invest(demand_dsm_0) <= 100 + 33 <= SinkDSMDLRInvestmentBlock_invest(demand_dsm_1) <= 100 + 33 <= SinkDSMDLRInvestmentBlock_invest(demand_dsm_2) <= 100 + 0 <= flow(bus_elec_demand_dsm_0_0) <= +inf + 0 <= flow(bus_elec_demand_dsm_0_1) <= +inf + 0 <= flow(bus_elec_demand_dsm_1_2) <= +inf + 0 <= flow(bus_elec_demand_dsm_1_3) <= +inf + 0 <= flow(bus_elec_demand_dsm_2_4) <= +inf + 0 <= flow(bus_elec_demand_dsm_2_5) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_total(demand_dsm_0) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_total(demand_dsm_1) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_old(demand_dsm_1) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_total(demand_dsm_2) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_old(demand_dsm_2) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_old_end(demand_dsm_0) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_old_end(demand_dsm_1) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_old_end(demand_dsm_2) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_old_exo(demand_dsm_0) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_old_exo(demand_dsm_1) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_old_exo(demand_dsm_2) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_old(demand_dsm_0) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_dsm_do_level(demand_dsm_0) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_dsm_do_level(demand_dsm_1) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_dsm_do_level(demand_dsm_2) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_dsm_do_level(demand_dsm_3) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_dsm_do_level(demand_dsm_4) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_dsm_do_level(demand_dsm_5) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_dsm_up_level(demand_dsm_0) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_dsm_up_level(demand_dsm_1) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_dsm_up_level(demand_dsm_2) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_dsm_up_level(demand_dsm_3) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_dsm_up_level(demand_dsm_4) <= +inf + 0 <= SinkDSMDLRInvestmentBlock_dsm_up_level(demand_dsm_5) <= +inf +end diff --git a/tests/lp_files/dsm_module_oemof_invest_multi_period.lp b/tests/lp_files/dsm_module_oemof_invest_multi_period.lp index 016b262d0..b92f80115 100644 --- a/tests/lp_files/dsm_module_oemof_invest_multi_period.lp +++ b/tests/lp_files/dsm_module_oemof_invest_multi_period.lp @@ -2,7 +2,7 @@ min objective: -+15992.031251718836 ONE_VAR_CONSTANT ++2941.5609381007307 ONE_VAR_CONSTANT +1 SinkDSMOemofInvestmentBlock_dsm_do_shift(demand_dsm_0) +100 SinkDSMOemofInvestmentBlock_dsm_do_shed(demand_dsm_0) +1 SinkDSMOemofInvestmentBlock_dsm_up(demand_dsm_0) @@ -21,9 +21,9 @@ objective: +0.9611687812379853 SinkDSMOemofInvestmentBlock_dsm_up(demand_dsm_5) +0.9611687812379853 SinkDSMOemofInvestmentBlock_dsm_do_shift(demand_dsm_5) +96.11687812379853 SinkDSMOemofInvestmentBlock_dsm_do_shed(demand_dsm_5) -+455.88267648036174 SinkDSMOemofInvestmentBlock_invest(demand_dsm_0) -+440.53147366914004 SinkDSMOemofInvestmentBlock_invest(demand_dsm_1) -+425.7302732994234 SinkDSMOemofInvestmentBlock_invest(demand_dsm_2) ++76.46810240317063 SinkDSMOemofInvestmentBlock_invest(demand_dsm_0) ++49.710949277906536 SinkDSMOemofInvestmentBlock_invest(demand_dsm_1) ++24.239842660236203 SinkDSMOemofInvestmentBlock_invest(demand_dsm_2) s.t. diff --git a/tests/lp_files/dsm_module_oemof_invest_multi_period_remaining_value.lp b/tests/lp_files/dsm_module_oemof_invest_multi_period_remaining_value.lp new file mode 100644 index 000000000..0baff5cc8 --- /dev/null +++ b/tests/lp_files/dsm_module_oemof_invest_multi_period_remaining_value.lp @@ -0,0 +1,301 @@ +\* Source Pyomo model name=Model *\ + +min +objective: ++2941.5609381007307 ONE_VAR_CONSTANT ++1 SinkDSMOemofInvestmentBlock_dsm_do_shift(demand_dsm_0) ++100 SinkDSMOemofInvestmentBlock_dsm_do_shed(demand_dsm_0) ++1 SinkDSMOemofInvestmentBlock_dsm_up(demand_dsm_0) ++1 SinkDSMOemofInvestmentBlock_dsm_up(demand_dsm_1) ++1 SinkDSMOemofInvestmentBlock_dsm_do_shift(demand_dsm_1) ++100 SinkDSMOemofInvestmentBlock_dsm_do_shed(demand_dsm_1) ++0.9803921568627451 SinkDSMOemofInvestmentBlock_dsm_up(demand_dsm_2) ++0.9803921568627451 SinkDSMOemofInvestmentBlock_dsm_do_shift(demand_dsm_2) ++98.0392156862745 SinkDSMOemofInvestmentBlock_dsm_do_shed(demand_dsm_2) ++0.9803921568627451 SinkDSMOemofInvestmentBlock_dsm_up(demand_dsm_3) ++0.9803921568627451 SinkDSMOemofInvestmentBlock_dsm_do_shift(demand_dsm_3) ++98.0392156862745 SinkDSMOemofInvestmentBlock_dsm_do_shed(demand_dsm_3) ++0.9611687812379853 SinkDSMOemofInvestmentBlock_dsm_up(demand_dsm_4) ++0.9611687812379853 SinkDSMOemofInvestmentBlock_dsm_do_shift(demand_dsm_4) ++96.11687812379853 SinkDSMOemofInvestmentBlock_dsm_do_shed(demand_dsm_4) ++0.9611687812379853 SinkDSMOemofInvestmentBlock_dsm_up(demand_dsm_5) ++0.9611687812379853 SinkDSMOemofInvestmentBlock_dsm_do_shift(demand_dsm_5) ++96.11687812379853 SinkDSMOemofInvestmentBlock_dsm_do_shed(demand_dsm_5) ++57.62165571222974 SinkDSMOemofInvestmentBlock_invest(demand_dsm_0) ++39.12361323621548 SinkDSMOemofInvestmentBlock_invest(demand_dsm_1) ++23.087255832295018 SinkDSMOemofInvestmentBlock_invest(demand_dsm_2) + +s.t. + +c_e_BusBlock_balance(bus_elec_0_0)_: ++1 flow(bus_elec_demand_dsm_0_0) += 0 + +c_e_BusBlock_balance(bus_elec_0_1)_: ++1 flow(bus_elec_demand_dsm_0_1) += 0 + +c_e_BusBlock_balance(bus_elec_1_2)_: ++1 flow(bus_elec_demand_dsm_1_2) += 0 + +c_e_BusBlock_balance(bus_elec_1_3)_: ++1 flow(bus_elec_demand_dsm_1_3) += 0 + +c_e_BusBlock_balance(bus_elec_2_4)_: ++1 flow(bus_elec_demand_dsm_2_4) += 0 + +c_e_BusBlock_balance(bus_elec_2_5)_: ++1 flow(bus_elec_demand_dsm_2_5) += 0 + +c_e_SinkDSMOemofInvestmentBlock_total_dsm_rule(demand_dsm_0)_: +-1 SinkDSMOemofInvestmentBlock_invest(demand_dsm_0) ++1 SinkDSMOemofInvestmentBlock_total(demand_dsm_0) += 50 + +c_e_SinkDSMOemofInvestmentBlock_total_dsm_rule(demand_dsm_1)_: +-1 SinkDSMOemofInvestmentBlock_invest(demand_dsm_1) +-1 SinkDSMOemofInvestmentBlock_total(demand_dsm_0) ++1 SinkDSMOemofInvestmentBlock_total(demand_dsm_1) ++1 SinkDSMOemofInvestmentBlock_old(demand_dsm_1) += 0 + +c_e_SinkDSMOemofInvestmentBlock_total_dsm_rule(demand_dsm_2)_: +-1 SinkDSMOemofInvestmentBlock_invest(demand_dsm_2) +-1 SinkDSMOemofInvestmentBlock_total(demand_dsm_1) ++1 SinkDSMOemofInvestmentBlock_total(demand_dsm_2) ++1 SinkDSMOemofInvestmentBlock_old(demand_dsm_2) += 0 + +c_e_SinkDSMOemofInvestmentBlock_old_dsm_rule_end(demand_dsm_0)_: ++1 SinkDSMOemofInvestmentBlock_old_end(demand_dsm_0) += 0 + +c_e_SinkDSMOemofInvestmentBlock_old_dsm_rule_end(demand_dsm_1)_: ++1 SinkDSMOemofInvestmentBlock_old_end(demand_dsm_1) += 0 + +c_e_SinkDSMOemofInvestmentBlock_old_dsm_rule_end(demand_dsm_2)_: ++1 SinkDSMOemofInvestmentBlock_old_end(demand_dsm_2) += 0 + +c_e_SinkDSMOemofInvestmentBlock_old_dsm_rule_exo(demand_dsm_0)_: ++1 SinkDSMOemofInvestmentBlock_old_exo(demand_dsm_0) += 0 + +c_e_SinkDSMOemofInvestmentBlock_old_dsm_rule_exo(demand_dsm_1)_: ++1 SinkDSMOemofInvestmentBlock_old_exo(demand_dsm_1) += 0 + +c_e_SinkDSMOemofInvestmentBlock_old_dsm_rule_exo(demand_dsm_2)_: ++1 SinkDSMOemofInvestmentBlock_old_exo(demand_dsm_2) += 0 + +c_e_SinkDSMOemofInvestmentBlock_old_dsm_rule(demand_dsm_0)_: +-1 SinkDSMOemofInvestmentBlock_old_end(demand_dsm_0) +-1 SinkDSMOemofInvestmentBlock_old_exo(demand_dsm_0) ++1 SinkDSMOemofInvestmentBlock_old(demand_dsm_0) += 0 + +c_e_SinkDSMOemofInvestmentBlock_old_dsm_rule(demand_dsm_1)_: ++1 SinkDSMOemofInvestmentBlock_old(demand_dsm_1) +-1 SinkDSMOemofInvestmentBlock_old_end(demand_dsm_1) +-1 SinkDSMOemofInvestmentBlock_old_exo(demand_dsm_1) += 0 + +c_e_SinkDSMOemofInvestmentBlock_old_dsm_rule(demand_dsm_2)_: ++1 SinkDSMOemofInvestmentBlock_old(demand_dsm_2) +-1 SinkDSMOemofInvestmentBlock_old_end(demand_dsm_2) +-1 SinkDSMOemofInvestmentBlock_old_exo(demand_dsm_2) += 0 + +c_e_SinkDSMOemofInvestmentBlock_input_output_relation(demand_dsm_0_0)_: ++1 SinkDSMOemofInvestmentBlock_dsm_do_shift(demand_dsm_0) ++1 SinkDSMOemofInvestmentBlock_dsm_do_shed(demand_dsm_0) +-1 SinkDSMOemofInvestmentBlock_dsm_up(demand_dsm_0) ++1 flow(bus_elec_demand_dsm_0_0) += 1 + +c_e_SinkDSMOemofInvestmentBlock_input_output_relation(demand_dsm_0_1)_: +-1 SinkDSMOemofInvestmentBlock_dsm_up(demand_dsm_1) ++1 SinkDSMOemofInvestmentBlock_dsm_do_shift(demand_dsm_1) ++1 SinkDSMOemofInvestmentBlock_dsm_do_shed(demand_dsm_1) ++1 flow(bus_elec_demand_dsm_0_1) += 1 + +c_e_SinkDSMOemofInvestmentBlock_input_output_relation(demand_dsm_1_2)_: +-1 SinkDSMOemofInvestmentBlock_dsm_up(demand_dsm_2) ++1 SinkDSMOemofInvestmentBlock_dsm_do_shift(demand_dsm_2) ++1 SinkDSMOemofInvestmentBlock_dsm_do_shed(demand_dsm_2) ++1 flow(bus_elec_demand_dsm_1_2) += 2 + +c_e_SinkDSMOemofInvestmentBlock_input_output_relation(demand_dsm_1_3)_: +-1 SinkDSMOemofInvestmentBlock_dsm_up(demand_dsm_3) ++1 SinkDSMOemofInvestmentBlock_dsm_do_shift(demand_dsm_3) ++1 SinkDSMOemofInvestmentBlock_dsm_do_shed(demand_dsm_3) ++1 flow(bus_elec_demand_dsm_1_3) += 2 + +c_e_SinkDSMOemofInvestmentBlock_input_output_relation(demand_dsm_2_4)_: +-1 SinkDSMOemofInvestmentBlock_dsm_up(demand_dsm_4) ++1 SinkDSMOemofInvestmentBlock_dsm_do_shift(demand_dsm_4) ++1 SinkDSMOemofInvestmentBlock_dsm_do_shed(demand_dsm_4) ++1 flow(bus_elec_demand_dsm_2_4) += 3 + +c_e_SinkDSMOemofInvestmentBlock_input_output_relation(demand_dsm_2_5)_: +-1 SinkDSMOemofInvestmentBlock_dsm_up(demand_dsm_5) ++1 SinkDSMOemofInvestmentBlock_dsm_do_shift(demand_dsm_5) ++1 SinkDSMOemofInvestmentBlock_dsm_do_shed(demand_dsm_5) ++1 flow(bus_elec_demand_dsm_2_5) += 3 + +c_u_SinkDSMOemofInvestmentBlock_dsm_up_constraint(demand_dsm_0_0)_: ++1 SinkDSMOemofInvestmentBlock_dsm_up(demand_dsm_0) +-0.5 SinkDSMOemofInvestmentBlock_total(demand_dsm_0) +<= 0 + +c_u_SinkDSMOemofInvestmentBlock_dsm_up_constraint(demand_dsm_0_1)_: ++1 SinkDSMOemofInvestmentBlock_dsm_up(demand_dsm_1) +-0.4 SinkDSMOemofInvestmentBlock_total(demand_dsm_0) +<= 0 + +c_u_SinkDSMOemofInvestmentBlock_dsm_up_constraint(demand_dsm_1_2)_: ++1 SinkDSMOemofInvestmentBlock_dsm_up(demand_dsm_2) +-0.5 SinkDSMOemofInvestmentBlock_total(demand_dsm_1) +<= 0 + +c_u_SinkDSMOemofInvestmentBlock_dsm_up_constraint(demand_dsm_1_3)_: ++1 SinkDSMOemofInvestmentBlock_dsm_up(demand_dsm_3) +-0.3 SinkDSMOemofInvestmentBlock_total(demand_dsm_1) +<= 0 + +c_u_SinkDSMOemofInvestmentBlock_dsm_up_constraint(demand_dsm_2_4)_: ++1 SinkDSMOemofInvestmentBlock_dsm_up(demand_dsm_4) +-0.3 SinkDSMOemofInvestmentBlock_total(demand_dsm_2) +<= 0 + +c_u_SinkDSMOemofInvestmentBlock_dsm_up_constraint(demand_dsm_2_5)_: ++1 SinkDSMOemofInvestmentBlock_dsm_up(demand_dsm_5) +-0.3 SinkDSMOemofInvestmentBlock_total(demand_dsm_2) +<= 0 + +c_u_SinkDSMOemofInvestmentBlock_dsm_down_constraint(demand_dsm_0_0)_: ++1 SinkDSMOemofInvestmentBlock_dsm_do_shift(demand_dsm_0) ++1 SinkDSMOemofInvestmentBlock_dsm_do_shed(demand_dsm_0) +-0.5 SinkDSMOemofInvestmentBlock_total(demand_dsm_0) +<= 0 + +c_u_SinkDSMOemofInvestmentBlock_dsm_down_constraint(demand_dsm_0_1)_: ++1 SinkDSMOemofInvestmentBlock_dsm_do_shift(demand_dsm_1) ++1 SinkDSMOemofInvestmentBlock_dsm_do_shed(demand_dsm_1) +-0.4 SinkDSMOemofInvestmentBlock_total(demand_dsm_0) +<= 0 + +c_u_SinkDSMOemofInvestmentBlock_dsm_down_constraint(demand_dsm_1_2)_: ++1 SinkDSMOemofInvestmentBlock_dsm_do_shift(demand_dsm_2) ++1 SinkDSMOemofInvestmentBlock_dsm_do_shed(demand_dsm_2) +-0.5 SinkDSMOemofInvestmentBlock_total(demand_dsm_1) +<= 0 + +c_u_SinkDSMOemofInvestmentBlock_dsm_down_constraint(demand_dsm_1_3)_: ++1 SinkDSMOemofInvestmentBlock_dsm_do_shift(demand_dsm_3) ++1 SinkDSMOemofInvestmentBlock_dsm_do_shed(demand_dsm_3) +-0.3 SinkDSMOemofInvestmentBlock_total(demand_dsm_1) +<= 0 + +c_u_SinkDSMOemofInvestmentBlock_dsm_down_constraint(demand_dsm_2_4)_: ++1 SinkDSMOemofInvestmentBlock_dsm_do_shift(demand_dsm_4) ++1 SinkDSMOemofInvestmentBlock_dsm_do_shed(demand_dsm_4) +-0.3 SinkDSMOemofInvestmentBlock_total(demand_dsm_2) +<= 0 + +c_u_SinkDSMOemofInvestmentBlock_dsm_down_constraint(demand_dsm_2_5)_: ++1 SinkDSMOemofInvestmentBlock_dsm_do_shift(demand_dsm_5) ++1 SinkDSMOemofInvestmentBlock_dsm_do_shed(demand_dsm_5) +-0.3 SinkDSMOemofInvestmentBlock_total(demand_dsm_2) +<= 0 + +c_e_SinkDSMOemofInvestmentBlock_dsm_sum_constraint(demand_dsm_0)_: +-1 SinkDSMOemofInvestmentBlock_dsm_do_shift(demand_dsm_0) ++1 SinkDSMOemofInvestmentBlock_dsm_up(demand_dsm_0) ++1 SinkDSMOemofInvestmentBlock_dsm_up(demand_dsm_1) +-1 SinkDSMOemofInvestmentBlock_dsm_do_shift(demand_dsm_1) += 0 + +c_e_SinkDSMOemofInvestmentBlock_dsm_sum_constraint(demand_dsm_2)_: ++1 SinkDSMOemofInvestmentBlock_dsm_up(demand_dsm_2) +-1 SinkDSMOemofInvestmentBlock_dsm_do_shift(demand_dsm_2) ++1 SinkDSMOemofInvestmentBlock_dsm_up(demand_dsm_3) +-1 SinkDSMOemofInvestmentBlock_dsm_do_shift(demand_dsm_3) += 0 + +c_e_SinkDSMOemofInvestmentBlock_dsm_sum_constraint(demand_dsm_4)_: ++1 SinkDSMOemofInvestmentBlock_dsm_up(demand_dsm_4) +-1 SinkDSMOemofInvestmentBlock_dsm_do_shift(demand_dsm_4) ++1 SinkDSMOemofInvestmentBlock_dsm_up(demand_dsm_5) +-1 SinkDSMOemofInvestmentBlock_dsm_do_shift(demand_dsm_5) += 0 + +c_u_SinkDSMOemofInvestmentBlock_overall_dsm_maximum(demand_dsm_0)_: ++1 SinkDSMOemofInvestmentBlock_total(demand_dsm_0) +<= 1000 + +c_u_SinkDSMOemofInvestmentBlock_overall_dsm_maximum(demand_dsm_1)_: ++1 SinkDSMOemofInvestmentBlock_total(demand_dsm_1) +<= 1000 + +c_u_SinkDSMOemofInvestmentBlock_overall_dsm_maximum(demand_dsm_2)_: ++1 SinkDSMOemofInvestmentBlock_total(demand_dsm_2) +<= 1000 + +c_l_SinkDSMOemofInvestmentBlock_overall_minimum(demand_dsm)_: ++1 SinkDSMOemofInvestmentBlock_total(demand_dsm_2) +>= 5 + +bounds + 1 <= ONE_VAR_CONSTANT <= 1 + 0 <= SinkDSMOemofInvestmentBlock_dsm_do_shift(demand_dsm_0) <= +inf + 0 <= SinkDSMOemofInvestmentBlock_dsm_do_shed(demand_dsm_0) <= +inf + 0 <= SinkDSMOemofInvestmentBlock_dsm_up(demand_dsm_0) <= +inf + 0 <= SinkDSMOemofInvestmentBlock_dsm_up(demand_dsm_1) <= +inf + 0 <= SinkDSMOemofInvestmentBlock_dsm_do_shift(demand_dsm_1) <= +inf + 0 <= SinkDSMOemofInvestmentBlock_dsm_do_shed(demand_dsm_1) <= +inf + 0 <= SinkDSMOemofInvestmentBlock_dsm_up(demand_dsm_2) <= +inf + 0 <= SinkDSMOemofInvestmentBlock_dsm_do_shift(demand_dsm_2) <= +inf + 0 <= SinkDSMOemofInvestmentBlock_dsm_do_shed(demand_dsm_2) <= +inf + 0 <= SinkDSMOemofInvestmentBlock_dsm_up(demand_dsm_3) <= +inf + 0 <= SinkDSMOemofInvestmentBlock_dsm_do_shift(demand_dsm_3) <= +inf + 0 <= SinkDSMOemofInvestmentBlock_dsm_do_shed(demand_dsm_3) <= +inf + 0 <= SinkDSMOemofInvestmentBlock_dsm_up(demand_dsm_4) <= +inf + 0 <= SinkDSMOemofInvestmentBlock_dsm_do_shift(demand_dsm_4) <= +inf + 0 <= SinkDSMOemofInvestmentBlock_dsm_do_shed(demand_dsm_4) <= +inf + 0 <= SinkDSMOemofInvestmentBlock_dsm_up(demand_dsm_5) <= +inf + 0 <= SinkDSMOemofInvestmentBlock_dsm_do_shift(demand_dsm_5) <= +inf + 0 <= SinkDSMOemofInvestmentBlock_dsm_do_shed(demand_dsm_5) <= +inf + 33 <= SinkDSMOemofInvestmentBlock_invest(demand_dsm_0) <= 100 + 33 <= SinkDSMOemofInvestmentBlock_invest(demand_dsm_1) <= 100 + 33 <= SinkDSMOemofInvestmentBlock_invest(demand_dsm_2) <= 100 + 0 <= flow(bus_elec_demand_dsm_0_0) <= +inf + 0 <= flow(bus_elec_demand_dsm_0_1) <= +inf + 0 <= flow(bus_elec_demand_dsm_1_2) <= +inf + 0 <= flow(bus_elec_demand_dsm_1_3) <= +inf + 0 <= flow(bus_elec_demand_dsm_2_4) <= +inf + 0 <= flow(bus_elec_demand_dsm_2_5) <= +inf + 0 <= SinkDSMOemofInvestmentBlock_total(demand_dsm_0) <= +inf + 0 <= SinkDSMOemofInvestmentBlock_total(demand_dsm_1) <= +inf + 0 <= SinkDSMOemofInvestmentBlock_old(demand_dsm_1) <= +inf + 0 <= SinkDSMOemofInvestmentBlock_total(demand_dsm_2) <= +inf + 0 <= SinkDSMOemofInvestmentBlock_old(demand_dsm_2) <= +inf + 0 <= SinkDSMOemofInvestmentBlock_old_end(demand_dsm_0) <= +inf + 0 <= SinkDSMOemofInvestmentBlock_old_end(demand_dsm_1) <= +inf + 0 <= SinkDSMOemofInvestmentBlock_old_end(demand_dsm_2) <= +inf + 0 <= SinkDSMOemofInvestmentBlock_old_exo(demand_dsm_0) <= +inf + 0 <= SinkDSMOemofInvestmentBlock_old_exo(demand_dsm_1) <= +inf + 0 <= SinkDSMOemofInvestmentBlock_old_exo(demand_dsm_2) <= +inf + 0 <= SinkDSMOemofInvestmentBlock_old(demand_dsm_0) <= +inf +end diff --git a/tests/lp_files/fixed_costs_sources.lp b/tests/lp_files/fixed_costs_sources.lp index 7a025ff5e..004e64ad8 100644 --- a/tests/lp_files/fixed_costs_sources.lp +++ b/tests/lp_files/fixed_costs_sources.lp @@ -2,7 +2,7 @@ min objective: -+648.0124531935758 ONE_VAR_CONSTANT ++235.90542099192615 ONE_VAR_CONSTANT +25 flow(pv_forever_electricityBus_0_0) +25 flow(pv_forever_electricityBus_0_1) +24.509803921568626 flow(pv_forever_electricityBus_1_2) diff --git a/tests/lp_files/fixed_source_invest_sink_multi_period.lp b/tests/lp_files/fixed_source_invest_sink_multi_period.lp index bbfaa46fb..af511ec32 100644 --- a/tests/lp_files/fixed_source_invest_sink_multi_period.lp +++ b/tests/lp_files/fixed_source_invest_sink_multi_period.lp @@ -2,9 +2,9 @@ min objective: -+611.5671812529034 InvestmentFlowBlock_invest(electricityBus_excess_0) -+599.5756678950033 InvestmentFlowBlock_invest(electricityBus_excess_1) -+587.8192822500032 InvestmentFlowBlock_invest(electricityBus_excess_2) ++88.1844182057801 InvestmentFlowBlock_invest(electricityBus_excess_0) ++58.20563481102971 InvestmentFlowBlock_invest(electricityBus_excess_1) ++28.814670698529593 InvestmentFlowBlock_invest(electricityBus_excess_2) +25 flow(electricityBus_excess_0_0) +25 flow(electricityBus_excess_0_1) +24.509803921568626 flow(electricityBus_excess_1_2) diff --git a/tests/lp_files/flow_invest_with_offset_multi_period.lp b/tests/lp_files/flow_invest_with_offset_multi_period.lp index 1954c450c..5e4510206 100644 --- a/tests/lp_files/flow_invest_with_offset_multi_period.lp +++ b/tests/lp_files/flow_invest_with_offset_multi_period.lp @@ -2,11 +2,11 @@ min objective: -+611.5671812529034 InvestmentFlowBlock_invest(source_nonconvex_invest_electricityBus_0) ++88.1844182057801 InvestmentFlowBlock_invest(source_nonconvex_invest_electricityBus_0) +34 InvestmentFlowBlock_invest_status(source_nonconvex_invest_electricityBus_0) -+599.5756678950033 InvestmentFlowBlock_invest(source_nonconvex_invest_electricityBus_1) ++58.20563481102971 InvestmentFlowBlock_invest(source_nonconvex_invest_electricityBus_1) +33.33333333333333 InvestmentFlowBlock_invest_status(source_nonconvex_invest_electricityBus_1) -+587.8192822500032 InvestmentFlowBlock_invest(source_nonconvex_invest_electricityBus_2) ++28.814670698529593 InvestmentFlowBlock_invest(source_nonconvex_invest_electricityBus_2) +32.6797385620915 InvestmentFlowBlock_invest_status(source_nonconvex_invest_electricityBus_2) +25 flow(source_nonconvex_invest_electricityBus_0_0) +25 flow(source_nonconvex_invest_electricityBus_0_1) diff --git a/tests/lp_files/flow_invest_with_offset_multi_period_remaining_value.lp b/tests/lp_files/flow_invest_with_offset_multi_period_remaining_value.lp new file mode 100644 index 000000000..5e4510206 --- /dev/null +++ b/tests/lp_files/flow_invest_with_offset_multi_period_remaining_value.lp @@ -0,0 +1,206 @@ +\* Source Pyomo model name=Model *\ + +min +objective: ++88.1844182057801 InvestmentFlowBlock_invest(source_nonconvex_invest_electricityBus_0) ++34 InvestmentFlowBlock_invest_status(source_nonconvex_invest_electricityBus_0) ++58.20563481102971 InvestmentFlowBlock_invest(source_nonconvex_invest_electricityBus_1) ++33.33333333333333 InvestmentFlowBlock_invest_status(source_nonconvex_invest_electricityBus_1) ++28.814670698529593 InvestmentFlowBlock_invest(source_nonconvex_invest_electricityBus_2) ++32.6797385620915 InvestmentFlowBlock_invest_status(source_nonconvex_invest_electricityBus_2) ++25 flow(source_nonconvex_invest_electricityBus_0_0) ++25 flow(source_nonconvex_invest_electricityBus_0_1) ++24.509803921568626 flow(source_nonconvex_invest_electricityBus_1_2) ++24.509803921568626 flow(source_nonconvex_invest_electricityBus_1_3) ++24.029219530949632 flow(source_nonconvex_invest_electricityBus_2_4) ++24.029219530949632 flow(source_nonconvex_invest_electricityBus_2_5) + +s.t. + +c_e_BusBlock_balance(electricityBus_0_0)_: ++1 flow(source_nonconvex_invest_electricityBus_0_0) += 0 + +c_e_BusBlock_balance(electricityBus_0_1)_: ++1 flow(source_nonconvex_invest_electricityBus_0_1) += 0 + +c_e_BusBlock_balance(electricityBus_1_2)_: ++1 flow(source_nonconvex_invest_electricityBus_1_2) += 0 + +c_e_BusBlock_balance(electricityBus_1_3)_: ++1 flow(source_nonconvex_invest_electricityBus_1_3) += 0 + +c_e_BusBlock_balance(electricityBus_2_4)_: ++1 flow(source_nonconvex_invest_electricityBus_2_4) += 0 + +c_e_BusBlock_balance(electricityBus_2_5)_: ++1 flow(source_nonconvex_invest_electricityBus_2_5) += 0 + +c_u_InvestmentFlowBlock_minimum_rule(source_nonconvex_invest_electricityBus_0)_: +-1 InvestmentFlowBlock_invest(source_nonconvex_invest_electricityBus_0) ++15 InvestmentFlowBlock_invest_status(source_nonconvex_invest_electricityBus_0) +<= 0 + +c_u_InvestmentFlowBlock_minimum_rule(source_nonconvex_invest_electricityBus_1)_: +-1 InvestmentFlowBlock_invest(source_nonconvex_invest_electricityBus_1) ++15 InvestmentFlowBlock_invest_status(source_nonconvex_invest_electricityBus_1) +<= 0 + +c_u_InvestmentFlowBlock_minimum_rule(source_nonconvex_invest_electricityBus_2)_: +-1 InvestmentFlowBlock_invest(source_nonconvex_invest_electricityBus_2) ++15 InvestmentFlowBlock_invest_status(source_nonconvex_invest_electricityBus_2) +<= 0 + +c_u_InvestmentFlowBlock_maximum_rule(source_nonconvex_invest_electricityBus_0)_: ++1 InvestmentFlowBlock_invest(source_nonconvex_invest_electricityBus_0) +-20 InvestmentFlowBlock_invest_status(source_nonconvex_invest_electricityBus_0) +<= 0 + +c_u_InvestmentFlowBlock_maximum_rule(source_nonconvex_invest_electricityBus_1)_: ++1 InvestmentFlowBlock_invest(source_nonconvex_invest_electricityBus_1) +-20 InvestmentFlowBlock_invest_status(source_nonconvex_invest_electricityBus_1) +<= 0 + +c_u_InvestmentFlowBlock_maximum_rule(source_nonconvex_invest_electricityBus_2)_: ++1 InvestmentFlowBlock_invest(source_nonconvex_invest_electricityBus_2) +-20 InvestmentFlowBlock_invest_status(source_nonconvex_invest_electricityBus_2) +<= 0 + +c_e_InvestmentFlowBlock_total_rule(source_nonconvex_invest_electricityBus_0)_: +-1 InvestmentFlowBlock_invest(source_nonconvex_invest_electricityBus_0) ++1 InvestmentFlowBlock_total(source_nonconvex_invest_electricityBus_0) += 0 + +c_e_InvestmentFlowBlock_total_rule(source_nonconvex_invest_electricityBus_1)_: +-1 InvestmentFlowBlock_invest(source_nonconvex_invest_electricityBus_1) +-1 InvestmentFlowBlock_total(source_nonconvex_invest_electricityBus_0) ++1 InvestmentFlowBlock_total(source_nonconvex_invest_electricityBus_1) ++1 InvestmentFlowBlock_old(source_nonconvex_invest_electricityBus_1) += 0 + +c_e_InvestmentFlowBlock_total_rule(source_nonconvex_invest_electricityBus_2)_: +-1 InvestmentFlowBlock_invest(source_nonconvex_invest_electricityBus_2) +-1 InvestmentFlowBlock_total(source_nonconvex_invest_electricityBus_1) ++1 InvestmentFlowBlock_total(source_nonconvex_invest_electricityBus_2) ++1 InvestmentFlowBlock_old(source_nonconvex_invest_electricityBus_2) += 0 + +c_e_InvestmentFlowBlock_old_rule_end(source_nonconvex_invest_electricityBus_0)_: ++1 InvestmentFlowBlock_old_end(source_nonconvex_invest_electricityBus_0) += 0 + +c_e_InvestmentFlowBlock_old_rule_end(source_nonconvex_invest_electricityBus_1)_: ++1 InvestmentFlowBlock_old_end(source_nonconvex_invest_electricityBus_1) += 0 + +c_e_InvestmentFlowBlock_old_rule_end(source_nonconvex_invest_electricityBus_2)_: ++1 InvestmentFlowBlock_old_end(source_nonconvex_invest_electricityBus_2) += 0 + +c_e_InvestmentFlowBlock_old_rule_exo(source_nonconvex_invest_electricityBus_0)_: ++1 InvestmentFlowBlock_old_exo(source_nonconvex_invest_electricityBus_0) += 0 + +c_e_InvestmentFlowBlock_old_rule_exo(source_nonconvex_invest_electricityBus_1)_: ++1 InvestmentFlowBlock_old_exo(source_nonconvex_invest_electricityBus_1) += 0 + +c_e_InvestmentFlowBlock_old_rule_exo(source_nonconvex_invest_electricityBus_2)_: ++1 InvestmentFlowBlock_old_exo(source_nonconvex_invest_electricityBus_2) += 0 + +c_e_InvestmentFlowBlock_old_rule(source_nonconvex_invest_electricityBus_0)_: +-1 InvestmentFlowBlock_old_end(source_nonconvex_invest_electricityBus_0) +-1 InvestmentFlowBlock_old_exo(source_nonconvex_invest_electricityBus_0) ++1 InvestmentFlowBlock_old(source_nonconvex_invest_electricityBus_0) += 0 + +c_e_InvestmentFlowBlock_old_rule(source_nonconvex_invest_electricityBus_1)_: ++1 InvestmentFlowBlock_old(source_nonconvex_invest_electricityBus_1) +-1 InvestmentFlowBlock_old_end(source_nonconvex_invest_electricityBus_1) +-1 InvestmentFlowBlock_old_exo(source_nonconvex_invest_electricityBus_1) += 0 + +c_e_InvestmentFlowBlock_old_rule(source_nonconvex_invest_electricityBus_2)_: ++1 InvestmentFlowBlock_old(source_nonconvex_invest_electricityBus_2) +-1 InvestmentFlowBlock_old_end(source_nonconvex_invest_electricityBus_2) +-1 InvestmentFlowBlock_old_exo(source_nonconvex_invest_electricityBus_2) += 0 + +c_u_InvestmentFlowBlock_max(source_nonconvex_invest_electricityBus_0_0)_: ++1 flow(source_nonconvex_invest_electricityBus_0_0) +-0.8 InvestmentFlowBlock_total(source_nonconvex_invest_electricityBus_0) +<= 0 + +c_u_InvestmentFlowBlock_max(source_nonconvex_invest_electricityBus_0_1)_: ++1 flow(source_nonconvex_invest_electricityBus_0_1) +-0.8 InvestmentFlowBlock_total(source_nonconvex_invest_electricityBus_0) +<= 0 + +c_u_InvestmentFlowBlock_max(source_nonconvex_invest_electricityBus_1_2)_: ++1 flow(source_nonconvex_invest_electricityBus_1_2) +-0.8 InvestmentFlowBlock_total(source_nonconvex_invest_electricityBus_1) +<= 0 + +c_u_InvestmentFlowBlock_max(source_nonconvex_invest_electricityBus_1_3)_: ++1 flow(source_nonconvex_invest_electricityBus_1_3) +-0.8 InvestmentFlowBlock_total(source_nonconvex_invest_electricityBus_1) +<= 0 + +c_u_InvestmentFlowBlock_max(source_nonconvex_invest_electricityBus_2_4)_: ++1 flow(source_nonconvex_invest_electricityBus_2_4) +-0.8 InvestmentFlowBlock_total(source_nonconvex_invest_electricityBus_2) +<= 0 + +c_u_InvestmentFlowBlock_max(source_nonconvex_invest_electricityBus_2_5)_: ++1 flow(source_nonconvex_invest_electricityBus_2_5) +-0.8 InvestmentFlowBlock_total(source_nonconvex_invest_electricityBus_2) +<= 0 + +c_u_InvestmentFlowBlock_full_load_time_max(source_nonconvex_invest_electricityBus)_: ++1 flow(source_nonconvex_invest_electricityBus_0_0) ++1 flow(source_nonconvex_invest_electricityBus_0_1) ++1 flow(source_nonconvex_invest_electricityBus_1_2) ++1 flow(source_nonconvex_invest_electricityBus_1_3) ++1 flow(source_nonconvex_invest_electricityBus_2_4) ++1 flow(source_nonconvex_invest_electricityBus_2_5) +-2.3 InvestmentFlowBlock_total(source_nonconvex_invest_electricityBus_0) +-2.3 InvestmentFlowBlock_total(source_nonconvex_invest_electricityBus_1) +-2.3 InvestmentFlowBlock_total(source_nonconvex_invest_electricityBus_2) +<= 0.0 + +bounds + 0 <= InvestmentFlowBlock_invest(source_nonconvex_invest_electricityBus_0) <= 20 + 0 <= InvestmentFlowBlock_invest_status(source_nonconvex_invest_electricityBus_0) <= 1 + 0 <= InvestmentFlowBlock_invest(source_nonconvex_invest_electricityBus_1) <= 20 + 0 <= InvestmentFlowBlock_invest_status(source_nonconvex_invest_electricityBus_1) <= 1 + 0 <= InvestmentFlowBlock_invest(source_nonconvex_invest_electricityBus_2) <= 20 + 0 <= InvestmentFlowBlock_invest_status(source_nonconvex_invest_electricityBus_2) <= 1 + 0 <= flow(source_nonconvex_invest_electricityBus_0_0) <= +inf + 0 <= flow(source_nonconvex_invest_electricityBus_0_1) <= +inf + 0 <= flow(source_nonconvex_invest_electricityBus_1_2) <= +inf + 0 <= flow(source_nonconvex_invest_electricityBus_1_3) <= +inf + 0 <= flow(source_nonconvex_invest_electricityBus_2_4) <= +inf + 0 <= flow(source_nonconvex_invest_electricityBus_2_5) <= +inf + 0 <= InvestmentFlowBlock_total(source_nonconvex_invest_electricityBus_0) <= +inf + 0 <= InvestmentFlowBlock_total(source_nonconvex_invest_electricityBus_1) <= +inf + 0 <= InvestmentFlowBlock_old(source_nonconvex_invest_electricityBus_1) <= +inf + 0 <= InvestmentFlowBlock_total(source_nonconvex_invest_electricityBus_2) <= +inf + 0 <= InvestmentFlowBlock_old(source_nonconvex_invest_electricityBus_2) <= +inf + 0 <= InvestmentFlowBlock_old_end(source_nonconvex_invest_electricityBus_0) <= +inf + 0 <= InvestmentFlowBlock_old_end(source_nonconvex_invest_electricityBus_1) <= +inf + 0 <= InvestmentFlowBlock_old_end(source_nonconvex_invest_electricityBus_2) <= +inf + 0 <= InvestmentFlowBlock_old_exo(source_nonconvex_invest_electricityBus_0) <= +inf + 0 <= InvestmentFlowBlock_old_exo(source_nonconvex_invest_electricityBus_1) <= +inf + 0 <= InvestmentFlowBlock_old_exo(source_nonconvex_invest_electricityBus_2) <= +inf + 0 <= InvestmentFlowBlock_old(source_nonconvex_invest_electricityBus_0) <= +inf +binary + InvestmentFlowBlock_invest_status(source_nonconvex_invest_electricityBus_0) + InvestmentFlowBlock_invest_status(source_nonconvex_invest_electricityBus_1) + InvestmentFlowBlock_invest_status(source_nonconvex_invest_electricityBus_2) +end diff --git a/tests/lp_files/flow_invest_with_offset_no_minimum_multi_period.lp b/tests/lp_files/flow_invest_with_offset_no_minimum_multi_period.lp index 462f594da..6ff9b91de 100644 --- a/tests/lp_files/flow_invest_with_offset_no_minimum_multi_period.lp +++ b/tests/lp_files/flow_invest_with_offset_no_minimum_multi_period.lp @@ -2,11 +2,11 @@ min objective: -+611.5671812529034 InvestmentFlowBlock_invest(source_nonconvex_invest_electricityBus_0) ++88.1844182057801 InvestmentFlowBlock_invest(source_nonconvex_invest_electricityBus_0) +34 InvestmentFlowBlock_invest_status(source_nonconvex_invest_electricityBus_0) -+599.5756678950033 InvestmentFlowBlock_invest(source_nonconvex_invest_electricityBus_1) ++58.20563481102971 InvestmentFlowBlock_invest(source_nonconvex_invest_electricityBus_1) +33.33333333333333 InvestmentFlowBlock_invest_status(source_nonconvex_invest_electricityBus_1) -+587.8192822500032 InvestmentFlowBlock_invest(source_nonconvex_invest_electricityBus_2) ++28.814670698529593 InvestmentFlowBlock_invest(source_nonconvex_invest_electricityBus_2) +32.6797385620915 InvestmentFlowBlock_invest_status(source_nonconvex_invest_electricityBus_2) +25 flow(source_nonconvex_invest_electricityBus_0_0) +25 flow(source_nonconvex_invest_electricityBus_0_1) diff --git a/tests/lp_files/flow_invest_without_offset_multi_period.lp b/tests/lp_files/flow_invest_without_offset_multi_period.lp index 4ce5cd340..40b7e34a1 100644 --- a/tests/lp_files/flow_invest_without_offset_multi_period.lp +++ b/tests/lp_files/flow_invest_without_offset_multi_period.lp @@ -2,9 +2,9 @@ min objective: -+611.5671812529034 InvestmentFlowBlock_invest(electricityBus_sink_nonconvex_invest_0) -+599.5756678950033 InvestmentFlowBlock_invest(electricityBus_sink_nonconvex_invest_1) -+587.8192822500032 InvestmentFlowBlock_invest(electricityBus_sink_nonconvex_invest_2) ++88.1844182057801 InvestmentFlowBlock_invest(electricityBus_sink_nonconvex_invest_0) ++58.20563481102971 InvestmentFlowBlock_invest(electricityBus_sink_nonconvex_invest_1) ++28.814670698529593 InvestmentFlowBlock_invest(electricityBus_sink_nonconvex_invest_2) +25 flow(electricityBus_sink_nonconvex_invest_0_0) +25 flow(electricityBus_sink_nonconvex_invest_0_1) +24.509803921568626 flow(electricityBus_sink_nonconvex_invest_1_2) diff --git a/tests/lp_files/flow_invest_without_offset_multi_period_remaining_value.lp b/tests/lp_files/flow_invest_without_offset_multi_period_remaining_value.lp new file mode 100644 index 000000000..40b7e34a1 --- /dev/null +++ b/tests/lp_files/flow_invest_without_offset_multi_period_remaining_value.lp @@ -0,0 +1,203 @@ +\* Source Pyomo model name=Model *\ + +min +objective: ++88.1844182057801 InvestmentFlowBlock_invest(electricityBus_sink_nonconvex_invest_0) ++58.20563481102971 InvestmentFlowBlock_invest(electricityBus_sink_nonconvex_invest_1) ++28.814670698529593 InvestmentFlowBlock_invest(electricityBus_sink_nonconvex_invest_2) ++25 flow(electricityBus_sink_nonconvex_invest_0_0) ++25 flow(electricityBus_sink_nonconvex_invest_0_1) ++24.509803921568626 flow(electricityBus_sink_nonconvex_invest_1_2) ++24.509803921568626 flow(electricityBus_sink_nonconvex_invest_1_3) ++24.029219530949632 flow(electricityBus_sink_nonconvex_invest_2_4) ++24.029219530949632 flow(electricityBus_sink_nonconvex_invest_2_5) + +s.t. + +c_e_BusBlock_balance(electricityBus_0_0)_: ++1 flow(electricityBus_sink_nonconvex_invest_0_0) += 0 + +c_e_BusBlock_balance(electricityBus_0_1)_: ++1 flow(electricityBus_sink_nonconvex_invest_0_1) += 0 + +c_e_BusBlock_balance(electricityBus_1_2)_: ++1 flow(electricityBus_sink_nonconvex_invest_1_2) += 0 + +c_e_BusBlock_balance(electricityBus_1_3)_: ++1 flow(electricityBus_sink_nonconvex_invest_1_3) += 0 + +c_e_BusBlock_balance(electricityBus_2_4)_: ++1 flow(electricityBus_sink_nonconvex_invest_2_4) += 0 + +c_e_BusBlock_balance(electricityBus_2_5)_: ++1 flow(electricityBus_sink_nonconvex_invest_2_5) += 0 + +c_u_InvestmentFlowBlock_minimum_rule(electricityBus_sink_nonconvex_invest_0)_: +-1 InvestmentFlowBlock_invest(electricityBus_sink_nonconvex_invest_0) ++15 InvestmentFlowBlock_invest_status(electricityBus_sink_nonconvex_invest_0) +<= 0 + +c_u_InvestmentFlowBlock_minimum_rule(electricityBus_sink_nonconvex_invest_1)_: +-1 InvestmentFlowBlock_invest(electricityBus_sink_nonconvex_invest_1) ++15 InvestmentFlowBlock_invest_status(electricityBus_sink_nonconvex_invest_1) +<= 0 + +c_u_InvestmentFlowBlock_minimum_rule(electricityBus_sink_nonconvex_invest_2)_: +-1 InvestmentFlowBlock_invest(electricityBus_sink_nonconvex_invest_2) ++15 InvestmentFlowBlock_invest_status(electricityBus_sink_nonconvex_invest_2) +<= 0 + +c_u_InvestmentFlowBlock_maximum_rule(electricityBus_sink_nonconvex_invest_0)_: ++1 InvestmentFlowBlock_invest(electricityBus_sink_nonconvex_invest_0) +-172 InvestmentFlowBlock_invest_status(electricityBus_sink_nonconvex_invest_0) +<= 0 + +c_u_InvestmentFlowBlock_maximum_rule(electricityBus_sink_nonconvex_invest_1)_: ++1 InvestmentFlowBlock_invest(electricityBus_sink_nonconvex_invest_1) +-172 InvestmentFlowBlock_invest_status(electricityBus_sink_nonconvex_invest_1) +<= 0 + +c_u_InvestmentFlowBlock_maximum_rule(electricityBus_sink_nonconvex_invest_2)_: ++1 InvestmentFlowBlock_invest(electricityBus_sink_nonconvex_invest_2) +-172 InvestmentFlowBlock_invest_status(electricityBus_sink_nonconvex_invest_2) +<= 0 + +c_e_InvestmentFlowBlock_total_rule(electricityBus_sink_nonconvex_invest_0)_: +-1 InvestmentFlowBlock_invest(electricityBus_sink_nonconvex_invest_0) ++1 InvestmentFlowBlock_total(electricityBus_sink_nonconvex_invest_0) += 0 + +c_e_InvestmentFlowBlock_total_rule(electricityBus_sink_nonconvex_invest_1)_: +-1 InvestmentFlowBlock_invest(electricityBus_sink_nonconvex_invest_1) +-1 InvestmentFlowBlock_total(electricityBus_sink_nonconvex_invest_0) ++1 InvestmentFlowBlock_total(electricityBus_sink_nonconvex_invest_1) ++1 InvestmentFlowBlock_old(electricityBus_sink_nonconvex_invest_1) += 0 + +c_e_InvestmentFlowBlock_total_rule(electricityBus_sink_nonconvex_invest_2)_: +-1 InvestmentFlowBlock_invest(electricityBus_sink_nonconvex_invest_2) +-1 InvestmentFlowBlock_total(electricityBus_sink_nonconvex_invest_1) ++1 InvestmentFlowBlock_total(electricityBus_sink_nonconvex_invest_2) ++1 InvestmentFlowBlock_old(electricityBus_sink_nonconvex_invest_2) += 0 + +c_e_InvestmentFlowBlock_old_rule_end(electricityBus_sink_nonconvex_invest_0)_: ++1 InvestmentFlowBlock_old_end(electricityBus_sink_nonconvex_invest_0) += 0 + +c_e_InvestmentFlowBlock_old_rule_end(electricityBus_sink_nonconvex_invest_1)_: ++1 InvestmentFlowBlock_old_end(electricityBus_sink_nonconvex_invest_1) += 0 + +c_e_InvestmentFlowBlock_old_rule_end(electricityBus_sink_nonconvex_invest_2)_: ++1 InvestmentFlowBlock_old_end(electricityBus_sink_nonconvex_invest_2) += 0 + +c_e_InvestmentFlowBlock_old_rule_exo(electricityBus_sink_nonconvex_invest_0)_: ++1 InvestmentFlowBlock_old_exo(electricityBus_sink_nonconvex_invest_0) += 0 + +c_e_InvestmentFlowBlock_old_rule_exo(electricityBus_sink_nonconvex_invest_1)_: ++1 InvestmentFlowBlock_old_exo(electricityBus_sink_nonconvex_invest_1) += 0 + +c_e_InvestmentFlowBlock_old_rule_exo(electricityBus_sink_nonconvex_invest_2)_: ++1 InvestmentFlowBlock_old_exo(electricityBus_sink_nonconvex_invest_2) += 0 + +c_e_InvestmentFlowBlock_old_rule(electricityBus_sink_nonconvex_invest_0)_: +-1 InvestmentFlowBlock_old_end(electricityBus_sink_nonconvex_invest_0) +-1 InvestmentFlowBlock_old_exo(electricityBus_sink_nonconvex_invest_0) ++1 InvestmentFlowBlock_old(electricityBus_sink_nonconvex_invest_0) += 0 + +c_e_InvestmentFlowBlock_old_rule(electricityBus_sink_nonconvex_invest_1)_: ++1 InvestmentFlowBlock_old(electricityBus_sink_nonconvex_invest_1) +-1 InvestmentFlowBlock_old_end(electricityBus_sink_nonconvex_invest_1) +-1 InvestmentFlowBlock_old_exo(electricityBus_sink_nonconvex_invest_1) += 0 + +c_e_InvestmentFlowBlock_old_rule(electricityBus_sink_nonconvex_invest_2)_: ++1 InvestmentFlowBlock_old(electricityBus_sink_nonconvex_invest_2) +-1 InvestmentFlowBlock_old_end(electricityBus_sink_nonconvex_invest_2) +-1 InvestmentFlowBlock_old_exo(electricityBus_sink_nonconvex_invest_2) += 0 + +c_u_InvestmentFlowBlock_max(electricityBus_sink_nonconvex_invest_0_0)_: ++1 flow(electricityBus_sink_nonconvex_invest_0_0) +-0.8 InvestmentFlowBlock_total(electricityBus_sink_nonconvex_invest_0) +<= 0 + +c_u_InvestmentFlowBlock_max(electricityBus_sink_nonconvex_invest_0_1)_: ++1 flow(electricityBus_sink_nonconvex_invest_0_1) +-0.8 InvestmentFlowBlock_total(electricityBus_sink_nonconvex_invest_0) +<= 0 + +c_u_InvestmentFlowBlock_max(electricityBus_sink_nonconvex_invest_1_2)_: ++1 flow(electricityBus_sink_nonconvex_invest_1_2) +-0.8 InvestmentFlowBlock_total(electricityBus_sink_nonconvex_invest_1) +<= 0 + +c_u_InvestmentFlowBlock_max(electricityBus_sink_nonconvex_invest_1_3)_: ++1 flow(electricityBus_sink_nonconvex_invest_1_3) +-0.8 InvestmentFlowBlock_total(electricityBus_sink_nonconvex_invest_1) +<= 0 + +c_u_InvestmentFlowBlock_max(electricityBus_sink_nonconvex_invest_2_4)_: ++1 flow(electricityBus_sink_nonconvex_invest_2_4) +-0.8 InvestmentFlowBlock_total(electricityBus_sink_nonconvex_invest_2) +<= 0 + +c_u_InvestmentFlowBlock_max(electricityBus_sink_nonconvex_invest_2_5)_: ++1 flow(electricityBus_sink_nonconvex_invest_2_5) +-0.8 InvestmentFlowBlock_total(electricityBus_sink_nonconvex_invest_2) +<= 0 + +c_u_InvestmentFlowBlock_full_load_time_max(electricityBus_sink_nonconvex_invest)_: ++1 flow(electricityBus_sink_nonconvex_invest_0_0) ++1 flow(electricityBus_sink_nonconvex_invest_0_1) ++1 flow(electricityBus_sink_nonconvex_invest_1_2) ++1 flow(electricityBus_sink_nonconvex_invest_1_3) ++1 flow(electricityBus_sink_nonconvex_invest_2_4) ++1 flow(electricityBus_sink_nonconvex_invest_2_5) +-2.3 InvestmentFlowBlock_total(electricityBus_sink_nonconvex_invest_0) +-2.3 InvestmentFlowBlock_total(electricityBus_sink_nonconvex_invest_1) +-2.3 InvestmentFlowBlock_total(electricityBus_sink_nonconvex_invest_2) +<= 0.0 + +bounds + 0 <= InvestmentFlowBlock_invest(electricityBus_sink_nonconvex_invest_0) <= 172 + 0 <= InvestmentFlowBlock_invest(electricityBus_sink_nonconvex_invest_1) <= 172 + 0 <= InvestmentFlowBlock_invest(electricityBus_sink_nonconvex_invest_2) <= 172 + 0 <= flow(electricityBus_sink_nonconvex_invest_0_0) <= +inf + 0 <= flow(electricityBus_sink_nonconvex_invest_0_1) <= +inf + 0 <= flow(electricityBus_sink_nonconvex_invest_1_2) <= +inf + 0 <= flow(electricityBus_sink_nonconvex_invest_1_3) <= +inf + 0 <= flow(electricityBus_sink_nonconvex_invest_2_4) <= +inf + 0 <= flow(electricityBus_sink_nonconvex_invest_2_5) <= +inf + 0 <= InvestmentFlowBlock_invest_status(electricityBus_sink_nonconvex_invest_0) <= 1 + 0 <= InvestmentFlowBlock_invest_status(electricityBus_sink_nonconvex_invest_1) <= 1 + 0 <= InvestmentFlowBlock_invest_status(electricityBus_sink_nonconvex_invest_2) <= 1 + 0 <= InvestmentFlowBlock_total(electricityBus_sink_nonconvex_invest_0) <= +inf + 0 <= InvestmentFlowBlock_total(electricityBus_sink_nonconvex_invest_1) <= +inf + 0 <= InvestmentFlowBlock_old(electricityBus_sink_nonconvex_invest_1) <= +inf + 0 <= InvestmentFlowBlock_total(electricityBus_sink_nonconvex_invest_2) <= +inf + 0 <= InvestmentFlowBlock_old(electricityBus_sink_nonconvex_invest_2) <= +inf + 0 <= InvestmentFlowBlock_old_end(electricityBus_sink_nonconvex_invest_0) <= +inf + 0 <= InvestmentFlowBlock_old_end(electricityBus_sink_nonconvex_invest_1) <= +inf + 0 <= InvestmentFlowBlock_old_end(electricityBus_sink_nonconvex_invest_2) <= +inf + 0 <= InvestmentFlowBlock_old_exo(electricityBus_sink_nonconvex_invest_0) <= +inf + 0 <= InvestmentFlowBlock_old_exo(electricityBus_sink_nonconvex_invest_1) <= +inf + 0 <= InvestmentFlowBlock_old_exo(electricityBus_sink_nonconvex_invest_2) <= +inf + 0 <= InvestmentFlowBlock_old(electricityBus_sink_nonconvex_invest_0) <= +inf +binary + InvestmentFlowBlock_invest_status(electricityBus_sink_nonconvex_invest_0) + InvestmentFlowBlock_invest_status(electricityBus_sink_nonconvex_invest_1) + InvestmentFlowBlock_invest_status(electricityBus_sink_nonconvex_invest_2) +end diff --git a/tests/lp_files/invest_source_fixed_sink_multi_period.lp b/tests/lp_files/invest_source_fixed_sink_multi_period.lp index b0f28add1..b549928ee 100644 --- a/tests/lp_files/invest_source_fixed_sink_multi_period.lp +++ b/tests/lp_files/invest_source_fixed_sink_multi_period.lp @@ -2,9 +2,9 @@ min objective: -+157.5028481334886 InvestmentFlowBlock_invest(pv_electricityBus_0) -+154.4145569936163 InvestmentFlowBlock_invest(pv_electricityBus_1) -+151.38682058197674 InvestmentFlowBlock_invest(pv_electricityBus_2) ++18.16879316506207 InvestmentFlowBlock_invest(pv_electricityBus_0) ++11.99221088531737 InvestmentFlowBlock_invest(pv_electricityBus_1) ++5.93673806203831 InvestmentFlowBlock_invest(pv_electricityBus_2) +13 flow(pv_electricityBus_0_0) +13 flow(pv_electricityBus_0_1) +12.745098039215685 flow(pv_electricityBus_1_2) diff --git a/tests/lp_files/linear_converter_chp_invest_multi_period.lp b/tests/lp_files/linear_converter_chp_invest_multi_period.lp index 5b4da4858..9a52152a5 100644 --- a/tests/lp_files/linear_converter_chp_invest_multi_period.lp +++ b/tests/lp_files/linear_converter_chp_invest_multi_period.lp @@ -2,9 +2,9 @@ min objective: -+31.82320970369655 InvestmentFlowBlock_invest(gasBus_chp_powerplant_gas_0) -+31.199225199702497 InvestmentFlowBlock_invest(gasBus_chp_powerplant_gas_1) -+30.587475685982838 InvestmentFlowBlock_invest(gasBus_chp_powerplant_gas_2) ++1.8354884429290608 InvestmentFlowBlock_invest(gasBus_chp_powerplant_gas_0) ++1.2115039389350062 InvestmentFlowBlock_invest(gasBus_chp_powerplant_gas_1) ++0.5997544252153503 InvestmentFlowBlock_invest(gasBus_chp_powerplant_gas_2) +50 flow(gasBus_chp_powerplant_gas_0_0) +50 flow(gasBus_chp_powerplant_gas_0_1) +49.01960784313725 flow(gasBus_chp_powerplant_gas_1_2) @@ -14,6 +14,30 @@ objective: s.t. +c_e_BusBlock_balance(heatBus_0_0)_: ++1 flow(chp_powerplant_gas_heatBus_0_0) += 0 + +c_e_BusBlock_balance(heatBus_0_1)_: ++1 flow(chp_powerplant_gas_heatBus_0_1) += 0 + +c_e_BusBlock_balance(heatBus_1_2)_: ++1 flow(chp_powerplant_gas_heatBus_1_2) += 0 + +c_e_BusBlock_balance(heatBus_1_3)_: ++1 flow(chp_powerplant_gas_heatBus_1_3) += 0 + +c_e_BusBlock_balance(heatBus_2_4)_: ++1 flow(chp_powerplant_gas_heatBus_2_4) += 0 + +c_e_BusBlock_balance(heatBus_2_5)_: ++1 flow(chp_powerplant_gas_heatBus_2_5) += 0 + c_e_BusBlock_balance(gasBus_0_0)_: +1 flow(gasBus_chp_powerplant_gas_0_0) = 0 @@ -62,30 +86,6 @@ c_e_BusBlock_balance(electricityBus_2_5)_: +1 flow(chp_powerplant_gas_electricityBus_2_5) = 0 -c_e_BusBlock_balance(heatBus_0_0)_: -+1 flow(chp_powerplant_gas_heatBus_0_0) -= 0 - -c_e_BusBlock_balance(heatBus_0_1)_: -+1 flow(chp_powerplant_gas_heatBus_0_1) -= 0 - -c_e_BusBlock_balance(heatBus_1_2)_: -+1 flow(chp_powerplant_gas_heatBus_1_2) -= 0 - -c_e_BusBlock_balance(heatBus_1_3)_: -+1 flow(chp_powerplant_gas_heatBus_1_3) -= 0 - -c_e_BusBlock_balance(heatBus_2_4)_: -+1 flow(chp_powerplant_gas_heatBus_2_4) -= 0 - -c_e_BusBlock_balance(heatBus_2_5)_: -+1 flow(chp_powerplant_gas_heatBus_2_5) -= 0 - c_e_ConverterBlock_relation(chp_powerplant_gas_gasBus_electricityBus_0_0)_: +0.4 flow(gasBus_chp_powerplant_gas_0_0) -1 flow(chp_powerplant_gas_electricityBus_0_0) @@ -247,18 +247,18 @@ bounds 0 <= flow(gasBus_chp_powerplant_gas_1_3) <= +inf 0 <= flow(gasBus_chp_powerplant_gas_2_4) <= +inf 0 <= flow(gasBus_chp_powerplant_gas_2_5) <= +inf - 0 <= flow(chp_powerplant_gas_electricityBus_0_0) <= +inf - 0 <= flow(chp_powerplant_gas_electricityBus_0_1) <= +inf - 0 <= flow(chp_powerplant_gas_electricityBus_1_2) <= +inf - 0 <= flow(chp_powerplant_gas_electricityBus_1_3) <= +inf - 0 <= flow(chp_powerplant_gas_electricityBus_2_4) <= +inf - 0 <= flow(chp_powerplant_gas_electricityBus_2_5) <= +inf 0 <= flow(chp_powerplant_gas_heatBus_0_0) <= +inf 0 <= flow(chp_powerplant_gas_heatBus_0_1) <= +inf 0 <= flow(chp_powerplant_gas_heatBus_1_2) <= +inf 0 <= flow(chp_powerplant_gas_heatBus_1_3) <= +inf 0 <= flow(chp_powerplant_gas_heatBus_2_4) <= +inf 0 <= flow(chp_powerplant_gas_heatBus_2_5) <= +inf + 0 <= flow(chp_powerplant_gas_electricityBus_0_0) <= +inf + 0 <= flow(chp_powerplant_gas_electricityBus_0_1) <= +inf + 0 <= flow(chp_powerplant_gas_electricityBus_1_2) <= +inf + 0 <= flow(chp_powerplant_gas_electricityBus_1_3) <= +inf + 0 <= flow(chp_powerplant_gas_electricityBus_2_4) <= +inf + 0 <= flow(chp_powerplant_gas_electricityBus_2_5) <= +inf 0 <= InvestmentFlowBlock_total(gasBus_chp_powerplant_gas_0) <= +inf 0 <= InvestmentFlowBlock_total(gasBus_chp_powerplant_gas_1) <= +inf 0 <= InvestmentFlowBlock_old(gasBus_chp_powerplant_gas_1) <= +inf diff --git a/tests/lp_files/linear_converter_invest_multi_period.lp b/tests/lp_files/linear_converter_invest_multi_period.lp index 61139ae3d..325b7b0a1 100644 --- a/tests/lp_files/linear_converter_invest_multi_period.lp +++ b/tests/lp_files/linear_converter_invest_multi_period.lp @@ -2,9 +2,9 @@ min objective: -+29.24459823787798 InvestmentFlowBlock_invest(powerplant_gas_electricity_0) -+28.671174743017627 InvestmentFlowBlock_invest(powerplant_gas_electricity_1) -+28.10899484609571 InvestmentFlowBlock_invest(powerplant_gas_electricity_2) ++2.1084501918380276 InvestmentFlowBlock_invest(powerplant_gas_electricity_0) ++1.3916708232625816 InvestmentFlowBlock_invest(powerplant_gas_electricity_1) ++0.6889459521101896 InvestmentFlowBlock_invest(powerplant_gas_electricity_2) +50 flow(powerplant_gas_electricity_0_0) +50 flow(powerplant_gas_electricity_0_1) +49.01960784313725 flow(powerplant_gas_electricity_1_2) @@ -14,30 +14,6 @@ objective: s.t. -c_e_BusBlock_balance(gas_0_0)_: -+1 flow(gas_powerplant_gas_0_0) -= 0 - -c_e_BusBlock_balance(gas_0_1)_: -+1 flow(gas_powerplant_gas_0_1) -= 0 - -c_e_BusBlock_balance(gas_1_2)_: -+1 flow(gas_powerplant_gas_1_2) -= 0 - -c_e_BusBlock_balance(gas_1_3)_: -+1 flow(gas_powerplant_gas_1_3) -= 0 - -c_e_BusBlock_balance(gas_2_4)_: -+1 flow(gas_powerplant_gas_2_4) -= 0 - -c_e_BusBlock_balance(gas_2_5)_: -+1 flow(gas_powerplant_gas_2_5) -= 0 - c_e_BusBlock_balance(electricity_0_0)_: +1 flow(powerplant_gas_electricity_0_0) = 0 @@ -62,6 +38,30 @@ c_e_BusBlock_balance(electricity_2_5)_: +1 flow(powerplant_gas_electricity_2_5) = 0 +c_e_BusBlock_balance(gas_0_0)_: ++1 flow(gas_powerplant_gas_0_0) += 0 + +c_e_BusBlock_balance(gas_0_1)_: ++1 flow(gas_powerplant_gas_0_1) += 0 + +c_e_BusBlock_balance(gas_1_2)_: ++1 flow(gas_powerplant_gas_1_2) += 0 + +c_e_BusBlock_balance(gas_1_3)_: ++1 flow(gas_powerplant_gas_1_3) += 0 + +c_e_BusBlock_balance(gas_2_4)_: ++1 flow(gas_powerplant_gas_2_4) += 0 + +c_e_BusBlock_balance(gas_2_5)_: ++1 flow(gas_powerplant_gas_2_5) += 0 + c_e_ConverterBlock_relation(powerplant_gas_gas_electricity_0_0)_: -1 flow(powerplant_gas_electricity_0_0) +0.58 flow(gas_powerplant_gas_0_0) diff --git a/tests/lp_files/linear_converter_invest_multi_period_old.lp b/tests/lp_files/linear_converter_invest_multi_period_old.lp index dc0921e45..5ddc28a1f 100644 --- a/tests/lp_files/linear_converter_invest_multi_period_old.lp +++ b/tests/lp_files/linear_converter_invest_multi_period_old.lp @@ -2,9 +2,9 @@ min objective: -+20.601980198019806 InvestmentFlowBlock_invest(powerplant_gas_electricity_0) -+20.1980198019802 InvestmentFlowBlock_invest(powerplant_gas_electricity_1) -+19.801980198019805 InvestmentFlowBlock_invest(powerplant_gas_electricity_2) ++20.0 InvestmentFlowBlock_invest(powerplant_gas_electricity_0) ++19.6078431372549 InvestmentFlowBlock_invest(powerplant_gas_electricity_1) ++9.706853038245011 InvestmentFlowBlock_invest(powerplant_gas_electricity_2) +50 flow(powerplant_gas_electricity_0_0) +50 flow(powerplant_gas_electricity_0_1) +49.01960784313725 flow(powerplant_gas_electricity_1_2) @@ -14,30 +14,6 @@ objective: s.t. -c_e_BusBlock_balance(gas_0_0)_: -+1 flow(gas_powerplant_gas_0_0) -= 0 - -c_e_BusBlock_balance(gas_0_1)_: -+1 flow(gas_powerplant_gas_0_1) -= 0 - -c_e_BusBlock_balance(gas_1_2)_: -+1 flow(gas_powerplant_gas_1_2) -= 0 - -c_e_BusBlock_balance(gas_1_3)_: -+1 flow(gas_powerplant_gas_1_3) -= 0 - -c_e_BusBlock_balance(gas_2_4)_: -+1 flow(gas_powerplant_gas_2_4) -= 0 - -c_e_BusBlock_balance(gas_2_5)_: -+1 flow(gas_powerplant_gas_2_5) -= 0 - c_e_BusBlock_balance(electricity_0_0)_: +1 flow(powerplant_gas_electricity_0_0) = 0 @@ -62,6 +38,30 @@ c_e_BusBlock_balance(electricity_2_5)_: +1 flow(powerplant_gas_electricity_2_5) = 0 +c_e_BusBlock_balance(gas_0_0)_: ++1 flow(gas_powerplant_gas_0_0) += 0 + +c_e_BusBlock_balance(gas_0_1)_: ++1 flow(gas_powerplant_gas_0_1) += 0 + +c_e_BusBlock_balance(gas_1_2)_: ++1 flow(gas_powerplant_gas_1_2) += 0 + +c_e_BusBlock_balance(gas_1_3)_: ++1 flow(gas_powerplant_gas_1_3) += 0 + +c_e_BusBlock_balance(gas_2_4)_: ++1 flow(gas_powerplant_gas_2_4) += 0 + +c_e_BusBlock_balance(gas_2_5)_: ++1 flow(gas_powerplant_gas_2_5) += 0 + c_e_ConverterBlock_relation(powerplant_gas_gas_electricity_0_0)_: -1 flow(powerplant_gas_electricity_0_0) +0.58 flow(gas_powerplant_gas_0_0) diff --git a/tests/lp_files/linear_converter_invest_multi_period_remaining_value.lp b/tests/lp_files/linear_converter_invest_multi_period_remaining_value.lp new file mode 100644 index 000000000..87890c538 --- /dev/null +++ b/tests/lp_files/linear_converter_invest_multi_period_remaining_value.lp @@ -0,0 +1,230 @@ +\* Source Pyomo model name=Model *\ + +min +objective: ++0.22380552274393728 InvestmentFlowBlock_invest(powerplant_gas_electricity_0) ++0.37976494755240464 InvestmentFlowBlock_invest(powerplant_gas_electricity_1) ++0.6200513568991706 InvestmentFlowBlock_invest(powerplant_gas_electricity_2) ++50 flow(powerplant_gas_electricity_0_0) ++50 flow(powerplant_gas_electricity_0_1) ++49.01960784313725 flow(powerplant_gas_electricity_1_2) ++49.01960784313725 flow(powerplant_gas_electricity_1_3) ++48.058439061899264 flow(powerplant_gas_electricity_2_4) ++48.058439061899264 flow(powerplant_gas_electricity_2_5) + +s.t. + +c_e_BusBlock_balance(gas_0_0)_: ++1 flow(gas_powerplant_gas_0_0) += 0 + +c_e_BusBlock_balance(gas_0_1)_: ++1 flow(gas_powerplant_gas_0_1) += 0 + +c_e_BusBlock_balance(gas_1_2)_: ++1 flow(gas_powerplant_gas_1_2) += 0 + +c_e_BusBlock_balance(gas_1_3)_: ++1 flow(gas_powerplant_gas_1_3) += 0 + +c_e_BusBlock_balance(gas_2_4)_: ++1 flow(gas_powerplant_gas_2_4) += 0 + +c_e_BusBlock_balance(gas_2_5)_: ++1 flow(gas_powerplant_gas_2_5) += 0 + +c_e_BusBlock_balance(electricity_0_0)_: ++1 flow(powerplant_gas_electricity_0_0) += 0 + +c_e_BusBlock_balance(electricity_0_1)_: ++1 flow(powerplant_gas_electricity_0_1) += 0 + +c_e_BusBlock_balance(electricity_1_2)_: ++1 flow(powerplant_gas_electricity_1_2) += 0 + +c_e_BusBlock_balance(electricity_1_3)_: ++1 flow(powerplant_gas_electricity_1_3) += 0 + +c_e_BusBlock_balance(electricity_2_4)_: ++1 flow(powerplant_gas_electricity_2_4) += 0 + +c_e_BusBlock_balance(electricity_2_5)_: ++1 flow(powerplant_gas_electricity_2_5) += 0 + +c_e_ConverterBlock_relation(powerplant_gas_gas_electricity_0_0)_: +-1 flow(powerplant_gas_electricity_0_0) ++0.58 flow(gas_powerplant_gas_0_0) += 0 + +c_e_ConverterBlock_relation(powerplant_gas_gas_electricity_0_1)_: +-1 flow(powerplant_gas_electricity_0_1) ++0.58 flow(gas_powerplant_gas_0_1) += 0 + +c_e_ConverterBlock_relation(powerplant_gas_gas_electricity_1_2)_: +-1 flow(powerplant_gas_electricity_1_2) ++0.58 flow(gas_powerplant_gas_1_2) += 0 + +c_e_ConverterBlock_relation(powerplant_gas_gas_electricity_1_3)_: +-1 flow(powerplant_gas_electricity_1_3) ++0.58 flow(gas_powerplant_gas_1_3) += 0 + +c_e_ConverterBlock_relation(powerplant_gas_gas_electricity_2_4)_: +-1 flow(powerplant_gas_electricity_2_4) ++0.58 flow(gas_powerplant_gas_2_4) += 0 + +c_e_ConverterBlock_relation(powerplant_gas_gas_electricity_2_5)_: +-1 flow(powerplant_gas_electricity_2_5) ++0.58 flow(gas_powerplant_gas_2_5) += 0 + +c_e_InvestmentFlowBlock_total_rule(powerplant_gas_electricity_0)_: +-1 InvestmentFlowBlock_invest(powerplant_gas_electricity_0) ++1 InvestmentFlowBlock_total(powerplant_gas_electricity_0) += 50 + +c_e_InvestmentFlowBlock_total_rule(powerplant_gas_electricity_1)_: +-1 InvestmentFlowBlock_invest(powerplant_gas_electricity_1) +-1 InvestmentFlowBlock_total(powerplant_gas_electricity_0) ++1 InvestmentFlowBlock_total(powerplant_gas_electricity_1) ++1 InvestmentFlowBlock_old(powerplant_gas_electricity_1) += 0 + +c_e_InvestmentFlowBlock_total_rule(powerplant_gas_electricity_2)_: +-1 InvestmentFlowBlock_invest(powerplant_gas_electricity_2) +-1 InvestmentFlowBlock_total(powerplant_gas_electricity_1) ++1 InvestmentFlowBlock_total(powerplant_gas_electricity_2) ++1 InvestmentFlowBlock_old(powerplant_gas_electricity_2) += 0 + +c_e_InvestmentFlowBlock_old_rule_end(powerplant_gas_electricity_0)_: ++1 InvestmentFlowBlock_old_end(powerplant_gas_electricity_0) += 0 + +c_e_InvestmentFlowBlock_old_rule_end(powerplant_gas_electricity_1)_: ++1 InvestmentFlowBlock_old_end(powerplant_gas_electricity_1) += 0 + +c_e_InvestmentFlowBlock_old_rule_end(powerplant_gas_electricity_2)_: ++1 InvestmentFlowBlock_old_end(powerplant_gas_electricity_2) += 0 + +c_e_InvestmentFlowBlock_old_rule_exo(powerplant_gas_electricity_0)_: ++1 InvestmentFlowBlock_old_exo(powerplant_gas_electricity_0) += 0 + +c_e_InvestmentFlowBlock_old_rule_exo(powerplant_gas_electricity_1)_: ++1 InvestmentFlowBlock_old_exo(powerplant_gas_electricity_1) += 0 + +c_e_InvestmentFlowBlock_old_rule_exo(powerplant_gas_electricity_2)_: ++1 InvestmentFlowBlock_old_exo(powerplant_gas_electricity_2) += 0 + +c_e_InvestmentFlowBlock_old_rule(powerplant_gas_electricity_0)_: +-1 InvestmentFlowBlock_old_end(powerplant_gas_electricity_0) +-1 InvestmentFlowBlock_old_exo(powerplant_gas_electricity_0) ++1 InvestmentFlowBlock_old(powerplant_gas_electricity_0) += 0 + +c_e_InvestmentFlowBlock_old_rule(powerplant_gas_electricity_1)_: ++1 InvestmentFlowBlock_old(powerplant_gas_electricity_1) +-1 InvestmentFlowBlock_old_end(powerplant_gas_electricity_1) +-1 InvestmentFlowBlock_old_exo(powerplant_gas_electricity_1) += 0 + +c_e_InvestmentFlowBlock_old_rule(powerplant_gas_electricity_2)_: ++1 InvestmentFlowBlock_old(powerplant_gas_electricity_2) +-1 InvestmentFlowBlock_old_end(powerplant_gas_electricity_2) +-1 InvestmentFlowBlock_old_exo(powerplant_gas_electricity_2) += 0 + +c_u_InvestmentFlowBlock_max(powerplant_gas_electricity_0_0)_: ++1 flow(powerplant_gas_electricity_0_0) +-1 InvestmentFlowBlock_total(powerplant_gas_electricity_0) +<= 0 + +c_u_InvestmentFlowBlock_max(powerplant_gas_electricity_0_1)_: ++1 flow(powerplant_gas_electricity_0_1) +-1 InvestmentFlowBlock_total(powerplant_gas_electricity_0) +<= 0 + +c_u_InvestmentFlowBlock_max(powerplant_gas_electricity_1_2)_: ++1 flow(powerplant_gas_electricity_1_2) +-1 InvestmentFlowBlock_total(powerplant_gas_electricity_1) +<= 0 + +c_u_InvestmentFlowBlock_max(powerplant_gas_electricity_1_3)_: ++1 flow(powerplant_gas_electricity_1_3) +-1 InvestmentFlowBlock_total(powerplant_gas_electricity_1) +<= 0 + +c_u_InvestmentFlowBlock_max(powerplant_gas_electricity_2_4)_: ++1 flow(powerplant_gas_electricity_2_4) +-1 InvestmentFlowBlock_total(powerplant_gas_electricity_2) +<= 0 + +c_u_InvestmentFlowBlock_max(powerplant_gas_electricity_2_5)_: ++1 flow(powerplant_gas_electricity_2_5) +-1 InvestmentFlowBlock_total(powerplant_gas_electricity_2) +<= 0 + +c_u_InvestmentFlowBlock_overall_maximum(powerplant_gas_electricity_0)_: ++1 InvestmentFlowBlock_total(powerplant_gas_electricity_0) +<= 10000 + +c_u_InvestmentFlowBlock_overall_maximum(powerplant_gas_electricity_1)_: ++1 InvestmentFlowBlock_total(powerplant_gas_electricity_1) +<= 10000 + +c_u_InvestmentFlowBlock_overall_maximum(powerplant_gas_electricity_2)_: ++1 InvestmentFlowBlock_total(powerplant_gas_electricity_2) +<= 10000 + +c_l_InvestmentFlowBlock_overall_minimum(powerplant_gas_electricity)_: ++1 InvestmentFlowBlock_total(powerplant_gas_electricity_2) +>= 200 + +bounds + 0 <= InvestmentFlowBlock_invest(powerplant_gas_electricity_0) <= 1000 + 0 <= InvestmentFlowBlock_invest(powerplant_gas_electricity_1) <= 1000 + 0 <= InvestmentFlowBlock_invest(powerplant_gas_electricity_2) <= 1000 + 0 <= flow(powerplant_gas_electricity_0_0) <= +inf + 0 <= flow(powerplant_gas_electricity_0_1) <= +inf + 0 <= flow(powerplant_gas_electricity_1_2) <= +inf + 0 <= flow(powerplant_gas_electricity_1_3) <= +inf + 0 <= flow(powerplant_gas_electricity_2_4) <= +inf + 0 <= flow(powerplant_gas_electricity_2_5) <= +inf + 0 <= flow(gas_powerplant_gas_0_0) <= +inf + 0 <= flow(gas_powerplant_gas_0_1) <= +inf + 0 <= flow(gas_powerplant_gas_1_2) <= +inf + 0 <= flow(gas_powerplant_gas_1_3) <= +inf + 0 <= flow(gas_powerplant_gas_2_4) <= +inf + 0 <= flow(gas_powerplant_gas_2_5) <= +inf + 0 <= InvestmentFlowBlock_total(powerplant_gas_electricity_0) <= +inf + 0 <= InvestmentFlowBlock_total(powerplant_gas_electricity_1) <= +inf + 0 <= InvestmentFlowBlock_old(powerplant_gas_electricity_1) <= +inf + 0 <= InvestmentFlowBlock_total(powerplant_gas_electricity_2) <= +inf + 0 <= InvestmentFlowBlock_old(powerplant_gas_electricity_2) <= +inf + 0 <= InvestmentFlowBlock_old_end(powerplant_gas_electricity_0) <= +inf + 0 <= InvestmentFlowBlock_old_end(powerplant_gas_electricity_1) <= +inf + 0 <= InvestmentFlowBlock_old_end(powerplant_gas_electricity_2) <= +inf + 0 <= InvestmentFlowBlock_old_exo(powerplant_gas_electricity_0) <= +inf + 0 <= InvestmentFlowBlock_old_exo(powerplant_gas_electricity_1) <= +inf + 0 <= InvestmentFlowBlock_old_exo(powerplant_gas_electricity_2) <= +inf + 0 <= InvestmentFlowBlock_old(powerplant_gas_electricity_0) <= +inf +end diff --git a/tests/lp_files/multi_period_period_length.lp b/tests/lp_files/multi_period_period_length.lp index 66c20689e..8f7edb5d0 100644 --- a/tests/lp_files/multi_period_period_length.lp +++ b/tests/lp_files/multi_period_period_length.lp @@ -1,32 +1,32 @@ \* Source Pyomo model name=Model *\ -min +min objective: +15992.031251718836 ONE_VAR_CONSTANT -+12.231343625058066 InvestmentFlowBlock_invest(storage_electricity_0) -+8.231343625058066 InvestmentFlowBlock_invest(storage_electricity_1) -+6.116009561015236 InvestmentFlowBlock_invest(storage_electricity_2) -+5.017258045399043 InvestmentFlowBlock_invest(storage_electricity_3) -+4.544285192584936 InvestmentFlowBlock_invest(storage_electricity_4) -+3.7278966318848936 InvestmentFlowBlock_invest(storage_electricity_5) -+2.769882109365063 InvestmentFlowBlock_invest(storage_electricity_6) -+1.864051255691565 InvestmentFlowBlock_invest(storage_electricity_7) -+12.231343625058066 InvestmentFlowBlock_invest(electricity_storage_0) -+8.231343625058066 InvestmentFlowBlock_invest(electricity_storage_1) -+6.116009561015236 InvestmentFlowBlock_invest(electricity_storage_2) -+5.017258045399043 InvestmentFlowBlock_invest(electricity_storage_3) -+4.544285192584936 InvestmentFlowBlock_invest(electricity_storage_4) -+3.7278966318848936 InvestmentFlowBlock_invest(electricity_storage_5) -+2.769882109365063 InvestmentFlowBlock_invest(electricity_storage_6) -+1.864051255691565 InvestmentFlowBlock_invest(electricity_storage_7) -+12.231343625058066 GenericInvestmentStorageBlock_invest(storage_0) -+8.231343625058066 GenericInvestmentStorageBlock_invest(storage_1) -+6.116009561015236 GenericInvestmentStorageBlock_invest(storage_2) -+5.017258045399043 GenericInvestmentStorageBlock_invest(storage_3) -+4.544285192584936 GenericInvestmentStorageBlock_invest(storage_4) -+3.7278966318848936 GenericInvestmentStorageBlock_invest(storage_5) -+2.769882109365063 GenericInvestmentStorageBlock_invest(storage_6) -+1.864051255691565 GenericInvestmentStorageBlock_invest(storage_7) ++9.999999999999998 InvestmentFlowBlock_invest(storage_electricity_0) ++6.729713331080573 InvestmentFlowBlock_invest(storage_electricity_1) ++5.000276133592968 InvestmentFlowBlock_invest(storage_electricity_2) ++4.101968025099305 InvestmentFlowBlock_invest(storage_electricity_3) ++3.7152788212696146 InvestmentFlowBlock_invest(storage_electricity_4) ++3.0478226645906985 InvestmentFlowBlock_invest(storage_electricity_5) ++2.264577134183746 InvestmentFlowBlock_invest(storage_electricity_6) ++0.09137506155350818 InvestmentFlowBlock_invest(storage_electricity_7) ++9.999999999999998 InvestmentFlowBlock_invest(electricity_storage_0) ++6.729713331080573 InvestmentFlowBlock_invest(electricity_storage_1) ++5.000276133592968 InvestmentFlowBlock_invest(electricity_storage_2) ++4.101968025099305 InvestmentFlowBlock_invest(electricity_storage_3) ++3.7152788212696146 InvestmentFlowBlock_invest(electricity_storage_4) ++3.0478226645906985 InvestmentFlowBlock_invest(electricity_storage_5) ++2.264577134183746 InvestmentFlowBlock_invest(electricity_storage_6) ++0.09137506155350818 InvestmentFlowBlock_invest(electricity_storage_7) ++9.999999999999998 GenericInvestmentStorageBlock_invest(storage_0) ++6.729713331080573 GenericInvestmentStorageBlock_invest(storage_1) ++5.000276133592968 GenericInvestmentStorageBlock_invest(storage_2) ++4.101968025099305 GenericInvestmentStorageBlock_invest(storage_3) ++3.7152788212696146 GenericInvestmentStorageBlock_invest(storage_4) ++3.0478226645906985 GenericInvestmentStorageBlock_invest(storage_5) ++2.264577134183746 GenericInvestmentStorageBlock_invest(storage_6) ++0.09137506155350818 GenericInvestmentStorageBlock_invest(storage_7) +1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_diw_0_0) +1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_diw_1_0) +1 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_diw_2_0) @@ -651,14 +651,14 @@ objective: +0.15239954929176602 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_diw_22_23) +0.15239954929176602 SinkDSMDIWInvestmentBlock_dsm_do_shift(demand_dsm_diw_23_23) +15.239954929176601 SinkDSMDIWInvestmentBlock_dsm_do_shed(demand_dsm_diw_23) -+455.88267648036174 SinkDSMDIWInvestmentBlock_invest(demand_dsm_diw_0) -+233.38374795126995 SinkDSMDIWInvestmentBlock_invest(demand_dsm_diw_1) -+144.56161688922427 SinkDSMDIWInvestmentBlock_invest(demand_dsm_diw_2) -+106.29941341240747 SinkDSMDIWInvestmentBlock_invest(demand_dsm_diw_3) -+91.48640392066359 SinkDSMDIWInvestmentBlock_invest(demand_dsm_diw_4) -+68.26495688582924 SinkDSMDIWInvestmentBlock_invest(demand_dsm_diw_5) -+44.80528445188661 SinkDSMDIWInvestmentBlock_invest(demand_dsm_diw_6) -+26.387865849578166 SinkDSMDIWInvestmentBlock_invest(demand_dsm_diw_7) ++433.5692402297811 SinkDSMDIWInvestmentBlock_invest(demand_dsm_diw_0) ++218.36744501149502 SinkDSMDIWInvestmentBlock_invest(demand_dsm_diw_1) ++133.4042826150016 SinkDSMDIWInvestmentBlock_invest(demand_dsm_diw_2) ++97.1465132094101 SinkDSMDIWInvestmentBlock_invest(demand_dsm_diw_3) ++83.19634020751037 SinkDSMDIWInvestmentBlock_invest(demand_dsm_diw_4) ++61.46421721288727 SinkDSMDIWInvestmentBlock_invest(demand_dsm_diw_5) ++39.75223470007343 SinkDSMDIWInvestmentBlock_invest(demand_dsm_diw_6) ++1.3782630680217502 SinkDSMDIWInvestmentBlock_invest(demand_dsm_diw_7) +1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_dlr_1_0) +1 SinkDSMDLRInvestmentBlock_balance_dsm_do(demand_dsm_dlr_1_0) +1 SinkDSMDLRInvestmentBlock_dsm_up(demand_dsm_dlr_2_0) @@ -875,14 +875,14 @@ objective: +0.15239954929176602 SinkDSMDLRInvestmentBlock_dsm_do_shift(demand_dsm_dlr_2_23) +0.15239954929176602 SinkDSMDLRInvestmentBlock_balance_dsm_up(demand_dsm_dlr_2_23) +15.239954929176601 SinkDSMDLRInvestmentBlock_dsm_do_shed(demand_dsm_dlr_23) -+455.88267648036174 SinkDSMDLRInvestmentBlock_invest(demand_dsm_dlr_0) -+233.38374795126995 SinkDSMDLRInvestmentBlock_invest(demand_dsm_dlr_1) -+144.56161688922427 SinkDSMDLRInvestmentBlock_invest(demand_dsm_dlr_2) -+106.29941341240747 SinkDSMDLRInvestmentBlock_invest(demand_dsm_dlr_3) -+91.48640392066359 SinkDSMDLRInvestmentBlock_invest(demand_dsm_dlr_4) -+68.26495688582924 SinkDSMDLRInvestmentBlock_invest(demand_dsm_dlr_5) -+44.80528445188661 SinkDSMDLRInvestmentBlock_invest(demand_dsm_dlr_6) -+26.387865849578166 SinkDSMDLRInvestmentBlock_invest(demand_dsm_dlr_7) ++433.5692402297811 SinkDSMDLRInvestmentBlock_invest(demand_dsm_dlr_0) ++218.36744501149502 SinkDSMDLRInvestmentBlock_invest(demand_dsm_dlr_1) ++133.4042826150016 SinkDSMDLRInvestmentBlock_invest(demand_dsm_dlr_2) ++97.1465132094101 SinkDSMDLRInvestmentBlock_invest(demand_dsm_dlr_3) ++83.19634020751037 SinkDSMDLRInvestmentBlock_invest(demand_dsm_dlr_4) ++61.46421721288727 SinkDSMDLRInvestmentBlock_invest(demand_dsm_dlr_5) ++39.75223470007343 SinkDSMDLRInvestmentBlock_invest(demand_dsm_dlr_6) ++1.3782630680217502 SinkDSMDLRInvestmentBlock_invest(demand_dsm_dlr_7) +1 SinkDSMOemofInvestmentBlock_dsm_do_shift(demand_dsm_oemof_0) +100 SinkDSMOemofInvestmentBlock_dsm_do_shed(demand_dsm_oemof_0) +1 SinkDSMOemofInvestmentBlock_dsm_up(demand_dsm_oemof_0) @@ -955,14 +955,14 @@ objective: +0.15239954929176602 SinkDSMOemofInvestmentBlock_dsm_up(demand_dsm_oemof_23) +0.15239954929176602 SinkDSMOemofInvestmentBlock_dsm_do_shift(demand_dsm_oemof_23) +15.239954929176601 SinkDSMOemofInvestmentBlock_dsm_do_shed(demand_dsm_oemof_23) -+455.88267648036174 SinkDSMOemofInvestmentBlock_invest(demand_dsm_oemof_0) -+233.38374795126995 SinkDSMOemofInvestmentBlock_invest(demand_dsm_oemof_1) -+144.56161688922427 SinkDSMOemofInvestmentBlock_invest(demand_dsm_oemof_2) -+106.29941341240747 SinkDSMOemofInvestmentBlock_invest(demand_dsm_oemof_3) -+91.48640392066359 SinkDSMOemofInvestmentBlock_invest(demand_dsm_oemof_4) -+68.26495688582924 SinkDSMOemofInvestmentBlock_invest(demand_dsm_oemof_5) -+44.80528445188661 SinkDSMOemofInvestmentBlock_invest(demand_dsm_oemof_6) -+26.387865849578166 SinkDSMOemofInvestmentBlock_invest(demand_dsm_oemof_7) ++433.5692402297811 SinkDSMOemofInvestmentBlock_invest(demand_dsm_oemof_0) ++218.36744501149502 SinkDSMOemofInvestmentBlock_invest(demand_dsm_oemof_1) ++133.4042826150016 SinkDSMOemofInvestmentBlock_invest(demand_dsm_oemof_2) ++97.1465132094101 SinkDSMOemofInvestmentBlock_invest(demand_dsm_oemof_3) ++83.19634020751037 SinkDSMOemofInvestmentBlock_invest(demand_dsm_oemof_4) ++61.46421721288727 SinkDSMOemofInvestmentBlock_invest(demand_dsm_oemof_5) ++39.75223470007343 SinkDSMOemofInvestmentBlock_invest(demand_dsm_oemof_6) ++1.3782630680217502 SinkDSMOemofInvestmentBlock_invest(demand_dsm_oemof_7) s.t. @@ -1918,14 +1918,14 @@ c_e_GenericInvestmentStorageBlock_old_rule(storage_7)_: = 0 c_e_GenericInvestmentStorageBlock_initially_empty(storage_0)_: -1 GenericInvestmentStorageBlock_storage_content(storage_0) ++1 GenericInvestmentStorageBlock_storage_content(storage_0) = 0 c_e_GenericInvestmentStorageBlock_balance(storage_0_1)_: +1 flow(storage_electricity_0_1) -1 flow(electricity_storage_0_1) -+1 GenericInvestmentStorageBlock_storage_content(storage_1) -1 GenericInvestmentStorageBlock_storage_content(storage_0) ++1 GenericInvestmentStorageBlock_storage_content(storage_1) = 0 c_e_GenericInvestmentStorageBlock_balance(storage_0_2)_: @@ -7894,8 +7894,8 @@ bounds 0 <= GenericInvestmentStorageBlock_old_exo(storage_6) <= +inf 0 <= GenericInvestmentStorageBlock_old_exo(storage_7) <= +inf 0 <= GenericInvestmentStorageBlock_old(storage_0) <= +inf - 0 <= GenericInvestmentStorageBlock_storage_content(storage_1) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage_0) <= +inf + 0 <= GenericInvestmentStorageBlock_storage_content(storage_1) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage_2) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage_3) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage_4) <= +inf diff --git a/tests/lp_files/periodical_investment_limit.lp b/tests/lp_files/periodical_investment_limit.lp index b6c76060f..1a01bf380 100644 --- a/tests/lp_files/periodical_investment_limit.lp +++ b/tests/lp_files/periodical_investment_limit.lp @@ -2,28 +2,28 @@ min objective: -+285.3937455128117 InvestmentFlowBlock_invest(Source_Bus1_0) -+279.7977897184428 InvestmentFlowBlock_invest(Source_Bus1_1) -+274.31155854749295 InvestmentFlowBlock_invest(Source_Bus1_2) -+194.22716197630274 GenericInvestmentStorageBlock_invest(storage_invest_limit_0) -+190.4187862512772 GenericInvestmentStorageBlock_invest(storage_invest_limit_1) -+186.68508456007567 GenericInvestmentStorageBlock_invest(storage_invest_limit_2) ++8.230422488026955 InvestmentFlowBlock_invest(Source_Bus1_0) ++5.432444590842506 InvestmentFlowBlock_invest(Source_Bus1_1) ++2.6893290053675805 InvestmentFlowBlock_invest(Source_Bus1_2) ++18.670948783910358 GenericInvestmentStorageBlock_invest(storage_invest_limit_0) ++12.323655908867737 GenericInvestmentStorageBlock_invest(storage_invest_limit_1) ++6.1008197568652225 GenericInvestmentStorageBlock_invest(storage_invest_limit_2) s.t. c_u_investment_limit_per_period(0)_: -+285.3937455128117 InvestmentFlowBlock_invest(Source_Bus1_0) -+194.22716197630274 GenericInvestmentStorageBlock_invest(storage_invest_limit_0) ++8.230422488026955 InvestmentFlowBlock_invest(Source_Bus1_0) ++18.670948783910358 GenericInvestmentStorageBlock_invest(storage_invest_limit_0) <= 500 c_u_investment_limit_per_period(1)_: -+279.7977897184428 InvestmentFlowBlock_invest(Source_Bus1_1) -+190.4187862512772 GenericInvestmentStorageBlock_invest(storage_invest_limit_1) ++5.432444590842506 InvestmentFlowBlock_invest(Source_Bus1_1) ++12.323655908867737 GenericInvestmentStorageBlock_invest(storage_invest_limit_1) <= 400 c_u_investment_limit_per_period(2)_: -+274.31155854749295 InvestmentFlowBlock_invest(Source_Bus1_2) -+186.68508456007567 GenericInvestmentStorageBlock_invest(storage_invest_limit_2) ++2.6893290053675805 InvestmentFlowBlock_invest(Source_Bus1_2) ++6.1008197568652225 GenericInvestmentStorageBlock_invest(storage_invest_limit_2) <= 300 c_e_BusBlock_balance(Bus1_0_0)_: @@ -81,25 +81,6 @@ c_e_InvestmentFlowBlock_total_rule(storage_invest_limit_Bus1_2)_: +1 InvestmentFlowBlock_old(storage_invest_limit_Bus1_2) = 0 -c_e_InvestmentFlowBlock_total_rule(Source_Bus1_0)_: --1 InvestmentFlowBlock_invest(Source_Bus1_0) -+1 InvestmentFlowBlock_total(Source_Bus1_0) -= 0 - -c_e_InvestmentFlowBlock_total_rule(Source_Bus1_1)_: --1 InvestmentFlowBlock_invest(Source_Bus1_1) --1 InvestmentFlowBlock_total(Source_Bus1_0) -+1 InvestmentFlowBlock_total(Source_Bus1_1) -+1 InvestmentFlowBlock_old(Source_Bus1_1) -= 0 - -c_e_InvestmentFlowBlock_total_rule(Source_Bus1_2)_: --1 InvestmentFlowBlock_invest(Source_Bus1_2) --1 InvestmentFlowBlock_total(Source_Bus1_1) -+1 InvestmentFlowBlock_total(Source_Bus1_2) -+1 InvestmentFlowBlock_old(Source_Bus1_2) -= 0 - c_e_InvestmentFlowBlock_total_rule(Bus1_storage_invest_limit_0)_: +1 InvestmentFlowBlock_total(Bus1_storage_invest_limit_0) -1 InvestmentFlowBlock_invest(Bus1_storage_invest_limit_0) @@ -119,28 +100,35 @@ c_e_InvestmentFlowBlock_total_rule(Bus1_storage_invest_limit_2)_: +1 InvestmentFlowBlock_old(Bus1_storage_invest_limit_2) = 0 -c_e_InvestmentFlowBlock_old_rule_end(storage_invest_limit_Bus1_0)_: -+1 InvestmentFlowBlock_old_end(storage_invest_limit_Bus1_0) +c_e_InvestmentFlowBlock_total_rule(Source_Bus1_0)_: +-1 InvestmentFlowBlock_invest(Source_Bus1_0) ++1 InvestmentFlowBlock_total(Source_Bus1_0) = 0 -c_e_InvestmentFlowBlock_old_rule_end(storage_invest_limit_Bus1_1)_: -+1 InvestmentFlowBlock_old_end(storage_invest_limit_Bus1_1) +c_e_InvestmentFlowBlock_total_rule(Source_Bus1_1)_: +-1 InvestmentFlowBlock_invest(Source_Bus1_1) +-1 InvestmentFlowBlock_total(Source_Bus1_0) ++1 InvestmentFlowBlock_total(Source_Bus1_1) ++1 InvestmentFlowBlock_old(Source_Bus1_1) = 0 -c_e_InvestmentFlowBlock_old_rule_end(storage_invest_limit_Bus1_2)_: -+1 InvestmentFlowBlock_old_end(storage_invest_limit_Bus1_2) +c_e_InvestmentFlowBlock_total_rule(Source_Bus1_2)_: +-1 InvestmentFlowBlock_invest(Source_Bus1_2) +-1 InvestmentFlowBlock_total(Source_Bus1_1) ++1 InvestmentFlowBlock_total(Source_Bus1_2) ++1 InvestmentFlowBlock_old(Source_Bus1_2) = 0 -c_e_InvestmentFlowBlock_old_rule_end(Source_Bus1_0)_: -+1 InvestmentFlowBlock_old_end(Source_Bus1_0) +c_e_InvestmentFlowBlock_old_rule_end(storage_invest_limit_Bus1_0)_: ++1 InvestmentFlowBlock_old_end(storage_invest_limit_Bus1_0) = 0 -c_e_InvestmentFlowBlock_old_rule_end(Source_Bus1_1)_: -+1 InvestmentFlowBlock_old_end(Source_Bus1_1) +c_e_InvestmentFlowBlock_old_rule_end(storage_invest_limit_Bus1_1)_: ++1 InvestmentFlowBlock_old_end(storage_invest_limit_Bus1_1) = 0 -c_e_InvestmentFlowBlock_old_rule_end(Source_Bus1_2)_: -+1 InvestmentFlowBlock_old_end(Source_Bus1_2) +c_e_InvestmentFlowBlock_old_rule_end(storage_invest_limit_Bus1_2)_: ++1 InvestmentFlowBlock_old_end(storage_invest_limit_Bus1_2) = 0 c_e_InvestmentFlowBlock_old_rule_end(Bus1_storage_invest_limit_0)_: @@ -155,28 +143,28 @@ c_e_InvestmentFlowBlock_old_rule_end(Bus1_storage_invest_limit_2)_: +1 InvestmentFlowBlock_old_end(Bus1_storage_invest_limit_2) = 0 -c_e_InvestmentFlowBlock_old_rule_exo(storage_invest_limit_Bus1_0)_: -+1 InvestmentFlowBlock_old_exo(storage_invest_limit_Bus1_0) +c_e_InvestmentFlowBlock_old_rule_end(Source_Bus1_0)_: ++1 InvestmentFlowBlock_old_end(Source_Bus1_0) = 0 -c_e_InvestmentFlowBlock_old_rule_exo(storage_invest_limit_Bus1_1)_: -+1 InvestmentFlowBlock_old_exo(storage_invest_limit_Bus1_1) +c_e_InvestmentFlowBlock_old_rule_end(Source_Bus1_1)_: ++1 InvestmentFlowBlock_old_end(Source_Bus1_1) = 0 -c_e_InvestmentFlowBlock_old_rule_exo(storage_invest_limit_Bus1_2)_: -+1 InvestmentFlowBlock_old_exo(storage_invest_limit_Bus1_2) +c_e_InvestmentFlowBlock_old_rule_end(Source_Bus1_2)_: ++1 InvestmentFlowBlock_old_end(Source_Bus1_2) = 0 -c_e_InvestmentFlowBlock_old_rule_exo(Source_Bus1_0)_: -+1 InvestmentFlowBlock_old_exo(Source_Bus1_0) +c_e_InvestmentFlowBlock_old_rule_exo(storage_invest_limit_Bus1_0)_: ++1 InvestmentFlowBlock_old_exo(storage_invest_limit_Bus1_0) = 0 -c_e_InvestmentFlowBlock_old_rule_exo(Source_Bus1_1)_: -+1 InvestmentFlowBlock_old_exo(Source_Bus1_1) +c_e_InvestmentFlowBlock_old_rule_exo(storage_invest_limit_Bus1_1)_: ++1 InvestmentFlowBlock_old_exo(storage_invest_limit_Bus1_1) = 0 -c_e_InvestmentFlowBlock_old_rule_exo(Source_Bus1_2)_: -+1 InvestmentFlowBlock_old_exo(Source_Bus1_2) +c_e_InvestmentFlowBlock_old_rule_exo(storage_invest_limit_Bus1_2)_: ++1 InvestmentFlowBlock_old_exo(storage_invest_limit_Bus1_2) = 0 c_e_InvestmentFlowBlock_old_rule_exo(Bus1_storage_invest_limit_0)_: @@ -191,6 +179,18 @@ c_e_InvestmentFlowBlock_old_rule_exo(Bus1_storage_invest_limit_2)_: +1 InvestmentFlowBlock_old_exo(Bus1_storage_invest_limit_2) = 0 +c_e_InvestmentFlowBlock_old_rule_exo(Source_Bus1_0)_: ++1 InvestmentFlowBlock_old_exo(Source_Bus1_0) += 0 + +c_e_InvestmentFlowBlock_old_rule_exo(Source_Bus1_1)_: ++1 InvestmentFlowBlock_old_exo(Source_Bus1_1) += 0 + +c_e_InvestmentFlowBlock_old_rule_exo(Source_Bus1_2)_: ++1 InvestmentFlowBlock_old_exo(Source_Bus1_2) += 0 + c_e_InvestmentFlowBlock_old_rule(storage_invest_limit_Bus1_0)_: -1 InvestmentFlowBlock_old_end(storage_invest_limit_Bus1_0) -1 InvestmentFlowBlock_old_exo(storage_invest_limit_Bus1_0) @@ -209,24 +209,6 @@ c_e_InvestmentFlowBlock_old_rule(storage_invest_limit_Bus1_2)_: -1 InvestmentFlowBlock_old_exo(storage_invest_limit_Bus1_2) = 0 -c_e_InvestmentFlowBlock_old_rule(Source_Bus1_0)_: --1 InvestmentFlowBlock_old_end(Source_Bus1_0) --1 InvestmentFlowBlock_old_exo(Source_Bus1_0) -+1 InvestmentFlowBlock_old(Source_Bus1_0) -= 0 - -c_e_InvestmentFlowBlock_old_rule(Source_Bus1_1)_: -+1 InvestmentFlowBlock_old(Source_Bus1_1) --1 InvestmentFlowBlock_old_end(Source_Bus1_1) --1 InvestmentFlowBlock_old_exo(Source_Bus1_1) -= 0 - -c_e_InvestmentFlowBlock_old_rule(Source_Bus1_2)_: -+1 InvestmentFlowBlock_old(Source_Bus1_2) --1 InvestmentFlowBlock_old_end(Source_Bus1_2) --1 InvestmentFlowBlock_old_exo(Source_Bus1_2) -= 0 - c_e_InvestmentFlowBlock_old_rule(Bus1_storage_invest_limit_0)_: -1 InvestmentFlowBlock_old_end(Bus1_storage_invest_limit_0) -1 InvestmentFlowBlock_old_exo(Bus1_storage_invest_limit_0) @@ -245,6 +227,24 @@ c_e_InvestmentFlowBlock_old_rule(Bus1_storage_invest_limit_2)_: -1 InvestmentFlowBlock_old_exo(Bus1_storage_invest_limit_2) = 0 +c_e_InvestmentFlowBlock_old_rule(Source_Bus1_0)_: +-1 InvestmentFlowBlock_old_end(Source_Bus1_0) +-1 InvestmentFlowBlock_old_exo(Source_Bus1_0) ++1 InvestmentFlowBlock_old(Source_Bus1_0) += 0 + +c_e_InvestmentFlowBlock_old_rule(Source_Bus1_1)_: ++1 InvestmentFlowBlock_old(Source_Bus1_1) +-1 InvestmentFlowBlock_old_end(Source_Bus1_1) +-1 InvestmentFlowBlock_old_exo(Source_Bus1_1) += 0 + +c_e_InvestmentFlowBlock_old_rule(Source_Bus1_2)_: ++1 InvestmentFlowBlock_old(Source_Bus1_2) +-1 InvestmentFlowBlock_old_end(Source_Bus1_2) +-1 InvestmentFlowBlock_old_exo(Source_Bus1_2) += 0 + c_u_InvestmentFlowBlock_max(storage_invest_limit_Bus1_0_0)_: +1 flow(storage_invest_limit_Bus1_0_0) -1 InvestmentFlowBlock_total(storage_invest_limit_Bus1_0) @@ -275,36 +275,6 @@ c_u_InvestmentFlowBlock_max(storage_invest_limit_Bus1_2_5)_: -1 InvestmentFlowBlock_total(storage_invest_limit_Bus1_2) <= 0 -c_u_InvestmentFlowBlock_max(Source_Bus1_0_0)_: -+1 flow(Source_Bus1_0_0) --1 InvestmentFlowBlock_total(Source_Bus1_0) -<= 0 - -c_u_InvestmentFlowBlock_max(Source_Bus1_0_1)_: -+1 flow(Source_Bus1_0_1) --1 InvestmentFlowBlock_total(Source_Bus1_0) -<= 0 - -c_u_InvestmentFlowBlock_max(Source_Bus1_1_2)_: -+1 flow(Source_Bus1_1_2) --1 InvestmentFlowBlock_total(Source_Bus1_1) -<= 0 - -c_u_InvestmentFlowBlock_max(Source_Bus1_1_3)_: -+1 flow(Source_Bus1_1_3) --1 InvestmentFlowBlock_total(Source_Bus1_1) -<= 0 - -c_u_InvestmentFlowBlock_max(Source_Bus1_2_4)_: -+1 flow(Source_Bus1_2_4) --1 InvestmentFlowBlock_total(Source_Bus1_2) -<= 0 - -c_u_InvestmentFlowBlock_max(Source_Bus1_2_5)_: -+1 flow(Source_Bus1_2_5) --1 InvestmentFlowBlock_total(Source_Bus1_2) -<= 0 - c_u_InvestmentFlowBlock_max(Bus1_storage_invest_limit_0_0)_: +1 flow(Bus1_storage_invest_limit_0_0) -1 InvestmentFlowBlock_total(Bus1_storage_invest_limit_0) @@ -335,6 +305,36 @@ c_u_InvestmentFlowBlock_max(Bus1_storage_invest_limit_2_5)_: -1 InvestmentFlowBlock_total(Bus1_storage_invest_limit_2) <= 0 +c_u_InvestmentFlowBlock_max(Source_Bus1_0_0)_: ++1 flow(Source_Bus1_0_0) +-1 InvestmentFlowBlock_total(Source_Bus1_0) +<= 0 + +c_u_InvestmentFlowBlock_max(Source_Bus1_0_1)_: ++1 flow(Source_Bus1_0_1) +-1 InvestmentFlowBlock_total(Source_Bus1_0) +<= 0 + +c_u_InvestmentFlowBlock_max(Source_Bus1_1_2)_: ++1 flow(Source_Bus1_1_2) +-1 InvestmentFlowBlock_total(Source_Bus1_1) +<= 0 + +c_u_InvestmentFlowBlock_max(Source_Bus1_1_3)_: ++1 flow(Source_Bus1_1_3) +-1 InvestmentFlowBlock_total(Source_Bus1_1) +<= 0 + +c_u_InvestmentFlowBlock_max(Source_Bus1_2_4)_: ++1 flow(Source_Bus1_2_4) +-1 InvestmentFlowBlock_total(Source_Bus1_2) +<= 0 + +c_u_InvestmentFlowBlock_max(Source_Bus1_2_5)_: ++1 flow(Source_Bus1_2_5) +-1 InvestmentFlowBlock_total(Source_Bus1_2) +<= 0 + c_e_GenericInvestmentStorageBlock_total_storage_rule(storage_invest_limit_0)_: -1 GenericInvestmentStorageBlock_invest(storage_invest_limit_0) +1 GenericInvestmentStorageBlock_total(storage_invest_limit_0) @@ -528,11 +528,6 @@ bounds 0 <= InvestmentFlowBlock_total(storage_invest_limit_Bus1_2) <= +inf 0 <= InvestmentFlowBlock_invest(storage_invest_limit_Bus1_2) <= +inf 0 <= InvestmentFlowBlock_old(storage_invest_limit_Bus1_2) <= +inf - 0 <= InvestmentFlowBlock_total(Source_Bus1_0) <= +inf - 0 <= InvestmentFlowBlock_total(Source_Bus1_1) <= +inf - 0 <= InvestmentFlowBlock_old(Source_Bus1_1) <= +inf - 0 <= InvestmentFlowBlock_total(Source_Bus1_2) <= +inf - 0 <= InvestmentFlowBlock_old(Source_Bus1_2) <= +inf 0 <= InvestmentFlowBlock_total(Bus1_storage_invest_limit_0) <= +inf 0 <= InvestmentFlowBlock_invest(Bus1_storage_invest_limit_0) <= +inf 0 <= InvestmentFlowBlock_total(Bus1_storage_invest_limit_1) <= +inf @@ -541,27 +536,32 @@ bounds 0 <= InvestmentFlowBlock_total(Bus1_storage_invest_limit_2) <= +inf 0 <= InvestmentFlowBlock_invest(Bus1_storage_invest_limit_2) <= +inf 0 <= InvestmentFlowBlock_old(Bus1_storage_invest_limit_2) <= +inf + 0 <= InvestmentFlowBlock_total(Source_Bus1_0) <= +inf + 0 <= InvestmentFlowBlock_total(Source_Bus1_1) <= +inf + 0 <= InvestmentFlowBlock_old(Source_Bus1_1) <= +inf + 0 <= InvestmentFlowBlock_total(Source_Bus1_2) <= +inf + 0 <= InvestmentFlowBlock_old(Source_Bus1_2) <= +inf 0 <= InvestmentFlowBlock_old_end(storage_invest_limit_Bus1_0) <= +inf 0 <= InvestmentFlowBlock_old_end(storage_invest_limit_Bus1_1) <= +inf 0 <= InvestmentFlowBlock_old_end(storage_invest_limit_Bus1_2) <= +inf - 0 <= InvestmentFlowBlock_old_end(Source_Bus1_0) <= +inf - 0 <= InvestmentFlowBlock_old_end(Source_Bus1_1) <= +inf - 0 <= InvestmentFlowBlock_old_end(Source_Bus1_2) <= +inf 0 <= InvestmentFlowBlock_old_end(Bus1_storage_invest_limit_0) <= +inf 0 <= InvestmentFlowBlock_old_end(Bus1_storage_invest_limit_1) <= +inf 0 <= InvestmentFlowBlock_old_end(Bus1_storage_invest_limit_2) <= +inf + 0 <= InvestmentFlowBlock_old_end(Source_Bus1_0) <= +inf + 0 <= InvestmentFlowBlock_old_end(Source_Bus1_1) <= +inf + 0 <= InvestmentFlowBlock_old_end(Source_Bus1_2) <= +inf 0 <= InvestmentFlowBlock_old_exo(storage_invest_limit_Bus1_0) <= +inf 0 <= InvestmentFlowBlock_old_exo(storage_invest_limit_Bus1_1) <= +inf 0 <= InvestmentFlowBlock_old_exo(storage_invest_limit_Bus1_2) <= +inf - 0 <= InvestmentFlowBlock_old_exo(Source_Bus1_0) <= +inf - 0 <= InvestmentFlowBlock_old_exo(Source_Bus1_1) <= +inf - 0 <= InvestmentFlowBlock_old_exo(Source_Bus1_2) <= +inf 0 <= InvestmentFlowBlock_old_exo(Bus1_storage_invest_limit_0) <= +inf 0 <= InvestmentFlowBlock_old_exo(Bus1_storage_invest_limit_1) <= +inf 0 <= InvestmentFlowBlock_old_exo(Bus1_storage_invest_limit_2) <= +inf + 0 <= InvestmentFlowBlock_old_exo(Source_Bus1_0) <= +inf + 0 <= InvestmentFlowBlock_old_exo(Source_Bus1_1) <= +inf + 0 <= InvestmentFlowBlock_old_exo(Source_Bus1_2) <= +inf 0 <= InvestmentFlowBlock_old(storage_invest_limit_Bus1_0) <= +inf - 0 <= InvestmentFlowBlock_old(Source_Bus1_0) <= +inf 0 <= InvestmentFlowBlock_old(Bus1_storage_invest_limit_0) <= +inf + 0 <= InvestmentFlowBlock_old(Source_Bus1_0) <= +inf 0 <= GenericInvestmentStorageBlock_total(storage_invest_limit_0) <= +inf 0 <= GenericInvestmentStorageBlock_total(storage_invest_limit_1) <= +inf 0 <= GenericInvestmentStorageBlock_old(storage_invest_limit_1) <= +inf diff --git a/tests/lp_files/periodical_investment_limit_with_dsm_DIW.lp b/tests/lp_files/periodical_investment_limit_with_dsm_DIW.lp index 28e220674..1fe4aaa5c 100644 --- a/tests/lp_files/periodical_investment_limit_with_dsm_DIW.lp +++ b/tests/lp_files/periodical_investment_limit_with_dsm_DIW.lp @@ -2,9 +2,9 @@ min objective: -+285.3937455128117 InvestmentFlowBlock_invest(Source_Bus1_0) -+279.7977897184428 InvestmentFlowBlock_invest(Source_Bus1_1) -+274.31155854749295 InvestmentFlowBlock_invest(Source_Bus1_2) ++8.230422488026955 InvestmentFlowBlock_invest(Source_Bus1_0) ++5.432444590842506 InvestmentFlowBlock_invest(Source_Bus1_1) ++2.6893290053675805 InvestmentFlowBlock_invest(Source_Bus1_2) +0.5 SinkDSMDIWInvestmentBlock_dsm_do_shift(sink_dsm_DIW_0_0) +0.5 SinkDSMDIWInvestmentBlock_dsm_do_shift(sink_dsm_DIW_1_0) +0.5 SinkDSMDIWInvestmentBlock_dsm_do_shift(sink_dsm_DIW_2_0) @@ -47,25 +47,25 @@ objective: +0.48058439061899266 SinkDSMDIWInvestmentBlock_dsm_do_shift(sink_dsm_DIW_3_5) +0.48058439061899266 SinkDSMDIWInvestmentBlock_dsm_do_shift(sink_dsm_DIW_4_5) +0.48058439061899266 SinkDSMDIWInvestmentBlock_dsm_do_shift(sink_dsm_DIW_5_5) -+103.00990099009903 SinkDSMDIWInvestmentBlock_invest(sink_dsm_DIW_0) -+100.990099009901 SinkDSMDIWInvestmentBlock_invest(sink_dsm_DIW_1) -+99.00990099009901 SinkDSMDIWInvestmentBlock_invest(sink_dsm_DIW_2) ++99.99999999999999 SinkDSMDIWInvestmentBlock_invest(sink_dsm_DIW_0) ++98.03921568627449 SinkDSMDIWInvestmentBlock_invest(sink_dsm_DIW_1) ++48.534265191225046 SinkDSMDIWInvestmentBlock_invest(sink_dsm_DIW_2) s.t. c_u_investment_limit_per_period(0)_: -+285.3937455128117 InvestmentFlowBlock_invest(Source_Bus1_0) -+103.00990099009903 SinkDSMDIWInvestmentBlock_invest(sink_dsm_DIW_0) ++8.230422488026955 InvestmentFlowBlock_invest(Source_Bus1_0) ++99.99999999999999 SinkDSMDIWInvestmentBlock_invest(sink_dsm_DIW_0) <= 400 c_u_investment_limit_per_period(1)_: -+279.7977897184428 InvestmentFlowBlock_invest(Source_Bus1_1) -+100.990099009901 SinkDSMDIWInvestmentBlock_invest(sink_dsm_DIW_1) ++5.432444590842506 InvestmentFlowBlock_invest(Source_Bus1_1) ++98.03921568627449 SinkDSMDIWInvestmentBlock_invest(sink_dsm_DIW_1) <= 300 c_u_investment_limit_per_period(2)_: -+274.31155854749295 InvestmentFlowBlock_invest(Source_Bus1_2) -+99.00990099009901 SinkDSMDIWInvestmentBlock_invest(sink_dsm_DIW_2) ++2.6893290053675805 InvestmentFlowBlock_invest(Source_Bus1_2) ++48.534265191225046 SinkDSMDIWInvestmentBlock_invest(sink_dsm_DIW_2) <= 200 c_e_BusBlock_balance(Bus1_0_0)_: diff --git a/tests/lp_files/periodical_investment_limit_with_dsm_DLR.lp b/tests/lp_files/periodical_investment_limit_with_dsm_DLR.lp index 5f697ad19..3d3d8a7d3 100644 --- a/tests/lp_files/periodical_investment_limit_with_dsm_DLR.lp +++ b/tests/lp_files/periodical_investment_limit_with_dsm_DLR.lp @@ -2,9 +2,9 @@ min objective: -+285.3937455128117 InvestmentFlowBlock_invest(Source_Bus1_0) -+279.7977897184428 InvestmentFlowBlock_invest(Source_Bus1_1) -+274.31155854749295 InvestmentFlowBlock_invest(Source_Bus1_2) ++8.230422488026955 InvestmentFlowBlock_invest(Source_Bus1_0) ++5.432444590842506 InvestmentFlowBlock_invest(Source_Bus1_1) ++2.6893290053675805 InvestmentFlowBlock_invest(Source_Bus1_2) +0.5 SinkDSMDLRInvestmentBlock_dsm_do_shift(sink_dsm_DLR_1_0) +0.5 SinkDSMDLRInvestmentBlock_balance_dsm_up(sink_dsm_DLR_1_0) +0.5 SinkDSMDLRInvestmentBlock_dsm_up(sink_dsm_DLR_1_0) @@ -29,25 +29,25 @@ objective: +0.48058439061899266 SinkDSMDLRInvestmentBlock_balance_dsm_do(sink_dsm_DLR_1_5) +0.48058439061899266 SinkDSMDLRInvestmentBlock_dsm_do_shift(sink_dsm_DLR_1_5) +0.48058439061899266 SinkDSMDLRInvestmentBlock_balance_dsm_up(sink_dsm_DLR_1_5) -+103.00990099009903 SinkDSMDLRInvestmentBlock_invest(sink_dsm_DLR_0) -+100.990099009901 SinkDSMDLRInvestmentBlock_invest(sink_dsm_DLR_1) -+99.00990099009901 SinkDSMDLRInvestmentBlock_invest(sink_dsm_DLR_2) ++99.99999999999999 SinkDSMDLRInvestmentBlock_invest(sink_dsm_DLR_0) ++98.03921568627449 SinkDSMDLRInvestmentBlock_invest(sink_dsm_DLR_1) ++48.534265191225046 SinkDSMDLRInvestmentBlock_invest(sink_dsm_DLR_2) s.t. c_u_investment_limit_per_period(0)_: -+285.3937455128117 InvestmentFlowBlock_invest(Source_Bus1_0) -+103.00990099009903 SinkDSMDLRInvestmentBlock_invest(sink_dsm_DLR_0) ++8.230422488026955 InvestmentFlowBlock_invest(Source_Bus1_0) ++99.99999999999999 SinkDSMDLRInvestmentBlock_invest(sink_dsm_DLR_0) <= 400 c_u_investment_limit_per_period(1)_: -+279.7977897184428 InvestmentFlowBlock_invest(Source_Bus1_1) -+100.990099009901 SinkDSMDLRInvestmentBlock_invest(sink_dsm_DLR_1) ++5.432444590842506 InvestmentFlowBlock_invest(Source_Bus1_1) ++98.03921568627449 SinkDSMDLRInvestmentBlock_invest(sink_dsm_DLR_1) <= 300 c_u_investment_limit_per_period(2)_: -+274.31155854749295 InvestmentFlowBlock_invest(Source_Bus1_2) -+99.00990099009901 SinkDSMDLRInvestmentBlock_invest(sink_dsm_DLR_2) ++2.6893290053675805 InvestmentFlowBlock_invest(Source_Bus1_2) ++48.534265191225046 SinkDSMDLRInvestmentBlock_invest(sink_dsm_DLR_2) <= 200 c_e_BusBlock_balance(Bus1_0_0)_: diff --git a/tests/lp_files/periodical_investment_limit_with_dsm_oemof.lp b/tests/lp_files/periodical_investment_limit_with_dsm_oemof.lp index f1961322c..342026442 100644 --- a/tests/lp_files/periodical_investment_limit_with_dsm_oemof.lp +++ b/tests/lp_files/periodical_investment_limit_with_dsm_oemof.lp @@ -2,9 +2,9 @@ min objective: -+285.3937455128117 InvestmentFlowBlock_invest(Source_Bus1_0) -+279.7977897184428 InvestmentFlowBlock_invest(Source_Bus1_1) -+274.31155854749295 InvestmentFlowBlock_invest(Source_Bus1_2) ++8.230422488026955 InvestmentFlowBlock_invest(Source_Bus1_0) ++5.432444590842506 InvestmentFlowBlock_invest(Source_Bus1_1) ++2.6893290053675805 InvestmentFlowBlock_invest(Source_Bus1_2) +0.5 SinkDSMOemofInvestmentBlock_dsm_do_shift(sink_dsm_oemof_0) +0.5 SinkDSMOemofInvestmentBlock_dsm_up(sink_dsm_oemof_0) +0.5 SinkDSMOemofInvestmentBlock_dsm_up(sink_dsm_oemof_1) @@ -17,25 +17,25 @@ objective: +0.48058439061899266 SinkDSMOemofInvestmentBlock_dsm_do_shift(sink_dsm_oemof_4) +0.48058439061899266 SinkDSMOemofInvestmentBlock_dsm_up(sink_dsm_oemof_5) +0.48058439061899266 SinkDSMOemofInvestmentBlock_dsm_do_shift(sink_dsm_oemof_5) -+103.00990099009903 SinkDSMOemofInvestmentBlock_invest(sink_dsm_oemof_0) -+100.990099009901 SinkDSMOemofInvestmentBlock_invest(sink_dsm_oemof_1) -+99.00990099009901 SinkDSMOemofInvestmentBlock_invest(sink_dsm_oemof_2) ++99.99999999999999 SinkDSMOemofInvestmentBlock_invest(sink_dsm_oemof_0) ++98.03921568627449 SinkDSMOemofInvestmentBlock_invest(sink_dsm_oemof_1) ++48.534265191225046 SinkDSMOemofInvestmentBlock_invest(sink_dsm_oemof_2) s.t. c_u_investment_limit_per_period(0)_: -+285.3937455128117 InvestmentFlowBlock_invest(Source_Bus1_0) -+103.00990099009903 SinkDSMOemofInvestmentBlock_invest(sink_dsm_oemof_0) ++8.230422488026955 InvestmentFlowBlock_invest(Source_Bus1_0) ++99.99999999999999 SinkDSMOemofInvestmentBlock_invest(sink_dsm_oemof_0) <= 400 c_u_investment_limit_per_period(1)_: -+279.7977897184428 InvestmentFlowBlock_invest(Source_Bus1_1) -+100.990099009901 SinkDSMOemofInvestmentBlock_invest(sink_dsm_oemof_1) ++5.432444590842506 InvestmentFlowBlock_invest(Source_Bus1_1) ++98.03921568627449 SinkDSMOemofInvestmentBlock_invest(sink_dsm_oemof_1) <= 300 c_u_investment_limit_per_period(2)_: -+274.31155854749295 InvestmentFlowBlock_invest(Source_Bus1_2) -+99.00990099009901 SinkDSMOemofInvestmentBlock_invest(sink_dsm_oemof_2) ++2.6893290053675805 InvestmentFlowBlock_invest(Source_Bus1_2) ++48.534265191225046 SinkDSMOemofInvestmentBlock_invest(sink_dsm_oemof_2) <= 200 c_e_BusBlock_balance(Bus1_0_0)_: diff --git a/tests/lp_files/storage_invest_1_multi_period.lp b/tests/lp_files/storage_invest_1_multi_period.lp index 35c7ff688..bd64f44ed 100644 --- a/tests/lp_files/storage_invest_1_multi_period.lp +++ b/tests/lp_files/storage_invest_1_multi_period.lp @@ -14,9 +14,9 @@ objective: +23.52941176470588 flow(storage1_electricityBus_1_3) +23.06805074971165 flow(storage1_electricityBus_2_4) +23.06805074971165 flow(storage1_electricityBus_2_5) -+232.70350285300475 GenericInvestmentStorageBlock_invest(storage1_0) -+228.14068907157326 GenericInvestmentStorageBlock_invest(storage1_1) -+223.6673422270326 GenericInvestmentStorageBlock_invest(storage1_2) ++31.685467778602654 GenericInvestmentStorageBlock_invest(storage1_0) ++21.210358847924045 GenericInvestmentStorageBlock_invest(storage1_1) ++10.650825820334894 GenericInvestmentStorageBlock_invest(storage1_2) s.t. diff --git a/tests/lp_files/storage_invest_1_multi_period_remaining_value.lp b/tests/lp_files/storage_invest_1_multi_period_remaining_value.lp new file mode 100644 index 000000000..674580183 --- /dev/null +++ b/tests/lp_files/storage_invest_1_multi_period_remaining_value.lp @@ -0,0 +1,505 @@ +\* Source Pyomo model name=Model *\ + +min +objective: ++56 flow(electricityBus_storage1_0_0) ++56 flow(electricityBus_storage1_0_1) ++54.90196078431372 flow(electricityBus_storage1_1_2) ++54.90196078431372 flow(electricityBus_storage1_1_3) ++53.82545174932718 flow(electricityBus_storage1_2_4) ++53.82545174932718 flow(electricityBus_storage1_2_5) ++24 flow(storage1_electricityBus_0_0) ++24 flow(storage1_electricityBus_0_1) ++23.52941176470588 flow(storage1_electricityBus_1_2) ++23.52941176470588 flow(storage1_electricityBus_1_3) ++23.06805074971165 flow(storage1_electricityBus_2_4) ++23.06805074971165 flow(storage1_electricityBus_2_5) ++3.415797742191323 GenericInvestmentStorageBlock_invest(storage1_0) ++4.881348776484851 GenericInvestmentStorageBlock_invest(storage1_1) ++8.44720668509319 GenericInvestmentStorageBlock_invest(storage1_2) + +s.t. + +c_e_BusBlock_balance(electricityBus_0_0)_: +-1 flow(electricityBus_storage1_0_0) ++1 flow(storage1_electricityBus_0_0) += 0 + +c_e_BusBlock_balance(electricityBus_0_1)_: +-1 flow(electricityBus_storage1_0_1) ++1 flow(storage1_electricityBus_0_1) += 0 + +c_e_BusBlock_balance(electricityBus_1_2)_: +-1 flow(electricityBus_storage1_1_2) ++1 flow(storage1_electricityBus_1_2) += 0 + +c_e_BusBlock_balance(electricityBus_1_3)_: +-1 flow(electricityBus_storage1_1_3) ++1 flow(storage1_electricityBus_1_3) += 0 + +c_e_BusBlock_balance(electricityBus_2_4)_: +-1 flow(electricityBus_storage1_2_4) ++1 flow(storage1_electricityBus_2_4) += 0 + +c_e_BusBlock_balance(electricityBus_2_5)_: +-1 flow(electricityBus_storage1_2_5) ++1 flow(storage1_electricityBus_2_5) += 0 + +c_e_InvestmentFlowBlock_total_rule(storage1_electricityBus_0)_: ++1 InvestmentFlowBlock_total(storage1_electricityBus_0) +-1 InvestmentFlowBlock_invest(storage1_electricityBus_0) += 0 + +c_e_InvestmentFlowBlock_total_rule(storage1_electricityBus_1)_: +-1 InvestmentFlowBlock_total(storage1_electricityBus_0) ++1 InvestmentFlowBlock_total(storage1_electricityBus_1) +-1 InvestmentFlowBlock_invest(storage1_electricityBus_1) ++1 InvestmentFlowBlock_old(storage1_electricityBus_1) += 0 + +c_e_InvestmentFlowBlock_total_rule(storage1_electricityBus_2)_: +-1 InvestmentFlowBlock_total(storage1_electricityBus_1) ++1 InvestmentFlowBlock_total(storage1_electricityBus_2) +-1 InvestmentFlowBlock_invest(storage1_electricityBus_2) ++1 InvestmentFlowBlock_old(storage1_electricityBus_2) += 0 + +c_e_InvestmentFlowBlock_total_rule(electricityBus_storage1_0)_: ++1 InvestmentFlowBlock_total(electricityBus_storage1_0) +-1 InvestmentFlowBlock_invest(electricityBus_storage1_0) += 0 + +c_e_InvestmentFlowBlock_total_rule(electricityBus_storage1_1)_: +-1 InvestmentFlowBlock_total(electricityBus_storage1_0) ++1 InvestmentFlowBlock_total(electricityBus_storage1_1) +-1 InvestmentFlowBlock_invest(electricityBus_storage1_1) ++1 InvestmentFlowBlock_old(electricityBus_storage1_1) += 0 + +c_e_InvestmentFlowBlock_total_rule(electricityBus_storage1_2)_: +-1 InvestmentFlowBlock_total(electricityBus_storage1_1) ++1 InvestmentFlowBlock_total(electricityBus_storage1_2) +-1 InvestmentFlowBlock_invest(electricityBus_storage1_2) ++1 InvestmentFlowBlock_old(electricityBus_storage1_2) += 0 + +c_e_InvestmentFlowBlock_old_rule_end(storage1_electricityBus_0)_: ++1 InvestmentFlowBlock_old_end(storage1_electricityBus_0) += 0 + +c_e_InvestmentFlowBlock_old_rule_end(storage1_electricityBus_1)_: ++1 InvestmentFlowBlock_old_end(storage1_electricityBus_1) += 0 + +c_e_InvestmentFlowBlock_old_rule_end(storage1_electricityBus_2)_: ++1 InvestmentFlowBlock_old_end(storage1_electricityBus_2) += 0 + +c_e_InvestmentFlowBlock_old_rule_end(electricityBus_storage1_0)_: ++1 InvestmentFlowBlock_old_end(electricityBus_storage1_0) += 0 + +c_e_InvestmentFlowBlock_old_rule_end(electricityBus_storage1_1)_: ++1 InvestmentFlowBlock_old_end(electricityBus_storage1_1) += 0 + +c_e_InvestmentFlowBlock_old_rule_end(electricityBus_storage1_2)_: ++1 InvestmentFlowBlock_old_end(electricityBus_storage1_2) += 0 + +c_e_InvestmentFlowBlock_old_rule_exo(storage1_electricityBus_0)_: ++1 InvestmentFlowBlock_old_exo(storage1_electricityBus_0) += 0 + +c_e_InvestmentFlowBlock_old_rule_exo(storage1_electricityBus_1)_: ++1 InvestmentFlowBlock_old_exo(storage1_electricityBus_1) += 0 + +c_e_InvestmentFlowBlock_old_rule_exo(storage1_electricityBus_2)_: ++1 InvestmentFlowBlock_old_exo(storage1_electricityBus_2) += 0 + +c_e_InvestmentFlowBlock_old_rule_exo(electricityBus_storage1_0)_: ++1 InvestmentFlowBlock_old_exo(electricityBus_storage1_0) += 0 + +c_e_InvestmentFlowBlock_old_rule_exo(electricityBus_storage1_1)_: ++1 InvestmentFlowBlock_old_exo(electricityBus_storage1_1) += 0 + +c_e_InvestmentFlowBlock_old_rule_exo(electricityBus_storage1_2)_: ++1 InvestmentFlowBlock_old_exo(electricityBus_storage1_2) += 0 + +c_e_InvestmentFlowBlock_old_rule(storage1_electricityBus_0)_: +-1 InvestmentFlowBlock_old_end(storage1_electricityBus_0) +-1 InvestmentFlowBlock_old_exo(storage1_electricityBus_0) ++1 InvestmentFlowBlock_old(storage1_electricityBus_0) += 0 + +c_e_InvestmentFlowBlock_old_rule(storage1_electricityBus_1)_: ++1 InvestmentFlowBlock_old(storage1_electricityBus_1) +-1 InvestmentFlowBlock_old_end(storage1_electricityBus_1) +-1 InvestmentFlowBlock_old_exo(storage1_electricityBus_1) += 0 + +c_e_InvestmentFlowBlock_old_rule(storage1_electricityBus_2)_: ++1 InvestmentFlowBlock_old(storage1_electricityBus_2) +-1 InvestmentFlowBlock_old_end(storage1_electricityBus_2) +-1 InvestmentFlowBlock_old_exo(storage1_electricityBus_2) += 0 + +c_e_InvestmentFlowBlock_old_rule(electricityBus_storage1_0)_: +-1 InvestmentFlowBlock_old_end(electricityBus_storage1_0) +-1 InvestmentFlowBlock_old_exo(electricityBus_storage1_0) ++1 InvestmentFlowBlock_old(electricityBus_storage1_0) += 0 + +c_e_InvestmentFlowBlock_old_rule(electricityBus_storage1_1)_: ++1 InvestmentFlowBlock_old(electricityBus_storage1_1) +-1 InvestmentFlowBlock_old_end(electricityBus_storage1_1) +-1 InvestmentFlowBlock_old_exo(electricityBus_storage1_1) += 0 + +c_e_InvestmentFlowBlock_old_rule(electricityBus_storage1_2)_: ++1 InvestmentFlowBlock_old(electricityBus_storage1_2) +-1 InvestmentFlowBlock_old_end(electricityBus_storage1_2) +-1 InvestmentFlowBlock_old_exo(electricityBus_storage1_2) += 0 + +c_u_InvestmentFlowBlock_max(storage1_electricityBus_0_0)_: ++1 flow(storage1_electricityBus_0_0) +-1 InvestmentFlowBlock_total(storage1_electricityBus_0) +<= 0 + +c_u_InvestmentFlowBlock_max(storage1_electricityBus_0_1)_: ++1 flow(storage1_electricityBus_0_1) +-1 InvestmentFlowBlock_total(storage1_electricityBus_0) +<= 0 + +c_u_InvestmentFlowBlock_max(storage1_electricityBus_1_2)_: ++1 flow(storage1_electricityBus_1_2) +-1 InvestmentFlowBlock_total(storage1_electricityBus_1) +<= 0 + +c_u_InvestmentFlowBlock_max(storage1_electricityBus_1_3)_: ++1 flow(storage1_electricityBus_1_3) +-1 InvestmentFlowBlock_total(storage1_electricityBus_1) +<= 0 + +c_u_InvestmentFlowBlock_max(storage1_electricityBus_2_4)_: ++1 flow(storage1_electricityBus_2_4) +-1 InvestmentFlowBlock_total(storage1_electricityBus_2) +<= 0 + +c_u_InvestmentFlowBlock_max(storage1_electricityBus_2_5)_: ++1 flow(storage1_electricityBus_2_5) +-1 InvestmentFlowBlock_total(storage1_electricityBus_2) +<= 0 + +c_u_InvestmentFlowBlock_max(electricityBus_storage1_0_0)_: ++1 flow(electricityBus_storage1_0_0) +-1 InvestmentFlowBlock_total(electricityBus_storage1_0) +<= 0 + +c_u_InvestmentFlowBlock_max(electricityBus_storage1_0_1)_: ++1 flow(electricityBus_storage1_0_1) +-1 InvestmentFlowBlock_total(electricityBus_storage1_0) +<= 0 + +c_u_InvestmentFlowBlock_max(electricityBus_storage1_1_2)_: ++1 flow(electricityBus_storage1_1_2) +-1 InvestmentFlowBlock_total(electricityBus_storage1_1) +<= 0 + +c_u_InvestmentFlowBlock_max(electricityBus_storage1_1_3)_: ++1 flow(electricityBus_storage1_1_3) +-1 InvestmentFlowBlock_total(electricityBus_storage1_1) +<= 0 + +c_u_InvestmentFlowBlock_max(electricityBus_storage1_2_4)_: ++1 flow(electricityBus_storage1_2_4) +-1 InvestmentFlowBlock_total(electricityBus_storage1_2) +<= 0 + +c_u_InvestmentFlowBlock_max(electricityBus_storage1_2_5)_: ++1 flow(electricityBus_storage1_2_5) +-1 InvestmentFlowBlock_total(electricityBus_storage1_2) +<= 0 + +c_e_GenericInvestmentStorageBlock_total_storage_rule(storage1_0)_: +-1 GenericInvestmentStorageBlock_invest(storage1_0) ++1 GenericInvestmentStorageBlock_total(storage1_0) += 0 + +c_e_GenericInvestmentStorageBlock_total_storage_rule(storage1_1)_: +-1 GenericInvestmentStorageBlock_invest(storage1_1) +-1 GenericInvestmentStorageBlock_total(storage1_0) ++1 GenericInvestmentStorageBlock_total(storage1_1) ++1 GenericInvestmentStorageBlock_old(storage1_1) += 0 + +c_e_GenericInvestmentStorageBlock_total_storage_rule(storage1_2)_: +-1 GenericInvestmentStorageBlock_invest(storage1_2) +-1 GenericInvestmentStorageBlock_total(storage1_1) ++1 GenericInvestmentStorageBlock_total(storage1_2) ++1 GenericInvestmentStorageBlock_old(storage1_2) += 0 + +c_e_GenericInvestmentStorageBlock_old_rule_end(storage1_0)_: ++1 GenericInvestmentStorageBlock_old_end(storage1_0) += 0 + +c_e_GenericInvestmentStorageBlock_old_rule_end(storage1_1)_: ++1 GenericInvestmentStorageBlock_old_end(storage1_1) += 0 + +c_e_GenericInvestmentStorageBlock_old_rule_end(storage1_2)_: ++1 GenericInvestmentStorageBlock_old_end(storage1_2) += 0 + +c_e_GenericInvestmentStorageBlock_old_rule_exo(storage1_0)_: ++1 GenericInvestmentStorageBlock_old_exo(storage1_0) += 0 + +c_e_GenericInvestmentStorageBlock_old_rule_exo(storage1_1)_: ++1 GenericInvestmentStorageBlock_old_exo(storage1_1) += 0 + +c_e_GenericInvestmentStorageBlock_old_rule_exo(storage1_2)_: ++1 GenericInvestmentStorageBlock_old_exo(storage1_2) += 0 + +c_e_GenericInvestmentStorageBlock_old_rule(storage1_0)_: +-1 GenericInvestmentStorageBlock_old_end(storage1_0) +-1 GenericInvestmentStorageBlock_old_exo(storage1_0) ++1 GenericInvestmentStorageBlock_old(storage1_0) += 0 + +c_e_GenericInvestmentStorageBlock_old_rule(storage1_1)_: ++1 GenericInvestmentStorageBlock_old(storage1_1) +-1 GenericInvestmentStorageBlock_old_end(storage1_1) +-1 GenericInvestmentStorageBlock_old_exo(storage1_1) += 0 + +c_e_GenericInvestmentStorageBlock_old_rule(storage1_2)_: ++1 GenericInvestmentStorageBlock_old(storage1_2) +-1 GenericInvestmentStorageBlock_old_end(storage1_2) +-1 GenericInvestmentStorageBlock_old_exo(storage1_2) += 0 + +c_e_GenericInvestmentStorageBlock_initially_empty(storage1_0)_: ++1 GenericInvestmentStorageBlock_storage_content(storage1_0) += 0 + +c_e_GenericInvestmentStorageBlock_balance(storage1_0_1)_: +-0.97 flow(electricityBus_storage1_0_1) ++1.1627906976744187 flow(storage1_electricityBus_0_1) +-0.87 GenericInvestmentStorageBlock_storage_content(storage1_0) ++1 GenericInvestmentStorageBlock_storage_content(storage1_1) += 0 + +c_e_GenericInvestmentStorageBlock_balance(storage1_1_2)_: +-0.97 flow(electricityBus_storage1_1_2) ++1.1627906976744187 flow(storage1_electricityBus_1_2) +-0.87 GenericInvestmentStorageBlock_storage_content(storage1_1) ++1 GenericInvestmentStorageBlock_storage_content(storage1_2) += 0 + +c_e_GenericInvestmentStorageBlock_balance(storage1_1_3)_: +-0.97 flow(electricityBus_storage1_1_3) ++1.1627906976744187 flow(storage1_electricityBus_1_3) +-0.87 GenericInvestmentStorageBlock_storage_content(storage1_2) ++1 GenericInvestmentStorageBlock_storage_content(storage1_3) += 0 + +c_e_GenericInvestmentStorageBlock_balance(storage1_2_4)_: +-0.97 flow(electricityBus_storage1_2_4) ++1.1627906976744187 flow(storage1_electricityBus_2_4) +-0.87 GenericInvestmentStorageBlock_storage_content(storage1_3) ++1 GenericInvestmentStorageBlock_storage_content(storage1_4) += 0 + +c_e_GenericInvestmentStorageBlock_balance(storage1_2_5)_: +-0.97 flow(electricityBus_storage1_2_5) ++1.1627906976744187 flow(storage1_electricityBus_2_5) +-0.87 GenericInvestmentStorageBlock_storage_content(storage1_4) ++1 GenericInvestmentStorageBlock_storage_content(storage1_5) += 0 + +c_e_GenericInvestmentStorageBlock_storage_capacity_inflow(storage1_0)_: ++1 InvestmentFlowBlock_total(electricityBus_storage1_0) +-0.16666666666666666 GenericInvestmentStorageBlock_total(storage1_0) += 0 + +c_e_GenericInvestmentStorageBlock_storage_capacity_inflow(storage1_1)_: ++1 InvestmentFlowBlock_total(electricityBus_storage1_1) +-0.16666666666666666 GenericInvestmentStorageBlock_total(storage1_1) += 0 + +c_e_GenericInvestmentStorageBlock_storage_capacity_inflow(storage1_2)_: ++1 InvestmentFlowBlock_total(electricityBus_storage1_2) +-0.16666666666666666 GenericInvestmentStorageBlock_total(storage1_2) += 0 + +c_e_GenericInvestmentStorageBlock_storage_capacity_outflow(storage1_0)_: ++1 InvestmentFlowBlock_total(storage1_electricityBus_0) +-0.16666666666666666 GenericInvestmentStorageBlock_total(storage1_0) += 0 + +c_e_GenericInvestmentStorageBlock_storage_capacity_outflow(storage1_1)_: ++1 InvestmentFlowBlock_total(storage1_electricityBus_1) +-0.16666666666666666 GenericInvestmentStorageBlock_total(storage1_1) += 0 + +c_e_GenericInvestmentStorageBlock_storage_capacity_outflow(storage1_2)_: ++1 InvestmentFlowBlock_total(storage1_electricityBus_2) +-0.16666666666666666 GenericInvestmentStorageBlock_total(storage1_2) += 0 + +c_u_GenericInvestmentStorageBlock_max_storage_content(storage1_0_0)_: +-0.9 GenericInvestmentStorageBlock_total(storage1_0) ++1 GenericInvestmentStorageBlock_storage_content(storage1_0) +<= 0 + +c_u_GenericInvestmentStorageBlock_max_storage_content(storage1_0_1)_: +-0.9 GenericInvestmentStorageBlock_total(storage1_0) ++1 GenericInvestmentStorageBlock_storage_content(storage1_1) +<= 0 + +c_u_GenericInvestmentStorageBlock_max_storage_content(storage1_1_2)_: +-0.9 GenericInvestmentStorageBlock_total(storage1_1) ++1 GenericInvestmentStorageBlock_storage_content(storage1_2) +<= 0 + +c_u_GenericInvestmentStorageBlock_max_storage_content(storage1_1_3)_: +-0.9 GenericInvestmentStorageBlock_total(storage1_1) ++1 GenericInvestmentStorageBlock_storage_content(storage1_3) +<= 0 + +c_u_GenericInvestmentStorageBlock_max_storage_content(storage1_2_4)_: +-0.9 GenericInvestmentStorageBlock_total(storage1_2) ++1 GenericInvestmentStorageBlock_storage_content(storage1_4) +<= 0 + +c_u_GenericInvestmentStorageBlock_max_storage_content(storage1_2_5)_: +-0.9 GenericInvestmentStorageBlock_total(storage1_2) ++1 GenericInvestmentStorageBlock_storage_content(storage1_5) +<= 0 + +c_u_GenericInvestmentStorageBlock_min_storage_content(storage1_0_0)_: ++0.1 GenericInvestmentStorageBlock_total(storage1_0) +-1 GenericInvestmentStorageBlock_storage_content(storage1_0) +<= 0 + +c_u_GenericInvestmentStorageBlock_min_storage_content(storage1_0_1)_: ++0.1 GenericInvestmentStorageBlock_total(storage1_0) +-1 GenericInvestmentStorageBlock_storage_content(storage1_1) +<= 0 + +c_u_GenericInvestmentStorageBlock_min_storage_content(storage1_1_2)_: ++0.1 GenericInvestmentStorageBlock_total(storage1_1) +-1 GenericInvestmentStorageBlock_storage_content(storage1_2) +<= 0 + +c_u_GenericInvestmentStorageBlock_min_storage_content(storage1_1_3)_: ++0.1 GenericInvestmentStorageBlock_total(storage1_1) +-1 GenericInvestmentStorageBlock_storage_content(storage1_3) +<= 0 + +c_u_GenericInvestmentStorageBlock_min_storage_content(storage1_2_4)_: ++0.1 GenericInvestmentStorageBlock_total(storage1_2) +-1 GenericInvestmentStorageBlock_storage_content(storage1_4) +<= 0 + +c_u_GenericInvestmentStorageBlock_min_storage_content(storage1_2_5)_: ++0.1 GenericInvestmentStorageBlock_total(storage1_2) +-1 GenericInvestmentStorageBlock_storage_content(storage1_5) +<= 0 + +c_u_GenericInvestmentStorageBlock_overall_storage_maximum(storage1_0)_: ++1 GenericInvestmentStorageBlock_total(storage1_0) +<= 1000 + +c_u_GenericInvestmentStorageBlock_overall_storage_maximum(storage1_1)_: ++1 GenericInvestmentStorageBlock_total(storage1_1) +<= 1000 + +c_u_GenericInvestmentStorageBlock_overall_storage_maximum(storage1_2)_: ++1 GenericInvestmentStorageBlock_total(storage1_2) +<= 1000 + +c_l_GenericInvestmentStorageBlock_overall_minimum(storage1)_: ++1 GenericInvestmentStorageBlock_total(storage1_2) +>= 2 + +bounds + 0 <= flow(electricityBus_storage1_0_0) <= +inf + 0 <= flow(electricityBus_storage1_0_1) <= +inf + 0 <= flow(electricityBus_storage1_1_2) <= +inf + 0 <= flow(electricityBus_storage1_1_3) <= +inf + 0 <= flow(electricityBus_storage1_2_4) <= +inf + 0 <= flow(electricityBus_storage1_2_5) <= +inf + 0 <= flow(storage1_electricityBus_0_0) <= +inf + 0 <= flow(storage1_electricityBus_0_1) <= +inf + 0 <= flow(storage1_electricityBus_1_2) <= +inf + 0 <= flow(storage1_electricityBus_1_3) <= +inf + 0 <= flow(storage1_electricityBus_2_4) <= +inf + 0 <= flow(storage1_electricityBus_2_5) <= +inf + 0 <= GenericInvestmentStorageBlock_invest(storage1_0) <= 234 + 0 <= GenericInvestmentStorageBlock_invest(storage1_1) <= 234 + 0 <= GenericInvestmentStorageBlock_invest(storage1_2) <= 234 + 0 <= InvestmentFlowBlock_total(storage1_electricityBus_0) <= +inf + 0 <= InvestmentFlowBlock_invest(storage1_electricityBus_0) <= +inf + 0 <= InvestmentFlowBlock_total(storage1_electricityBus_1) <= +inf + 0 <= InvestmentFlowBlock_invest(storage1_electricityBus_1) <= +inf + 0 <= InvestmentFlowBlock_old(storage1_electricityBus_1) <= +inf + 0 <= InvestmentFlowBlock_total(storage1_electricityBus_2) <= +inf + 0 <= InvestmentFlowBlock_invest(storage1_electricityBus_2) <= +inf + 0 <= InvestmentFlowBlock_old(storage1_electricityBus_2) <= +inf + 0 <= InvestmentFlowBlock_total(electricityBus_storage1_0) <= +inf + 0 <= InvestmentFlowBlock_invest(electricityBus_storage1_0) <= +inf + 0 <= InvestmentFlowBlock_total(electricityBus_storage1_1) <= +inf + 0 <= InvestmentFlowBlock_invest(electricityBus_storage1_1) <= +inf + 0 <= InvestmentFlowBlock_old(electricityBus_storage1_1) <= +inf + 0 <= InvestmentFlowBlock_total(electricityBus_storage1_2) <= +inf + 0 <= InvestmentFlowBlock_invest(electricityBus_storage1_2) <= +inf + 0 <= InvestmentFlowBlock_old(electricityBus_storage1_2) <= +inf + 0 <= InvestmentFlowBlock_old_end(storage1_electricityBus_0) <= +inf + 0 <= InvestmentFlowBlock_old_end(storage1_electricityBus_1) <= +inf + 0 <= InvestmentFlowBlock_old_end(storage1_electricityBus_2) <= +inf + 0 <= InvestmentFlowBlock_old_end(electricityBus_storage1_0) <= +inf + 0 <= InvestmentFlowBlock_old_end(electricityBus_storage1_1) <= +inf + 0 <= InvestmentFlowBlock_old_end(electricityBus_storage1_2) <= +inf + 0 <= InvestmentFlowBlock_old_exo(storage1_electricityBus_0) <= +inf + 0 <= InvestmentFlowBlock_old_exo(storage1_electricityBus_1) <= +inf + 0 <= InvestmentFlowBlock_old_exo(storage1_electricityBus_2) <= +inf + 0 <= InvestmentFlowBlock_old_exo(electricityBus_storage1_0) <= +inf + 0 <= InvestmentFlowBlock_old_exo(electricityBus_storage1_1) <= +inf + 0 <= InvestmentFlowBlock_old_exo(electricityBus_storage1_2) <= +inf + 0 <= InvestmentFlowBlock_old(storage1_electricityBus_0) <= +inf + 0 <= InvestmentFlowBlock_old(electricityBus_storage1_0) <= +inf + 0 <= GenericInvestmentStorageBlock_total(storage1_0) <= +inf + 0 <= GenericInvestmentStorageBlock_total(storage1_1) <= +inf + 0 <= GenericInvestmentStorageBlock_old(storage1_1) <= +inf + 0 <= GenericInvestmentStorageBlock_total(storage1_2) <= +inf + 0 <= GenericInvestmentStorageBlock_old(storage1_2) <= +inf + 0 <= GenericInvestmentStorageBlock_old_end(storage1_0) <= +inf + 0 <= GenericInvestmentStorageBlock_old_end(storage1_1) <= +inf + 0 <= GenericInvestmentStorageBlock_old_end(storage1_2) <= +inf + 0 <= GenericInvestmentStorageBlock_old_exo(storage1_0) <= +inf + 0 <= GenericInvestmentStorageBlock_old_exo(storage1_1) <= +inf + 0 <= GenericInvestmentStorageBlock_old_exo(storage1_2) <= +inf + 0 <= GenericInvestmentStorageBlock_old(storage1_0) <= +inf + 0 <= GenericInvestmentStorageBlock_storage_content(storage1_0) <= +inf + 0 <= GenericInvestmentStorageBlock_storage_content(storage1_1) <= +inf + 0 <= GenericInvestmentStorageBlock_storage_content(storage1_2) <= +inf + 0 <= GenericInvestmentStorageBlock_storage_content(storage1_3) <= +inf + 0 <= GenericInvestmentStorageBlock_storage_content(storage1_4) <= +inf + 0 <= GenericInvestmentStorageBlock_storage_content(storage1_5) <= +inf +end diff --git a/tests/lp_files/storage_invest_2_multi_period.lp b/tests/lp_files/storage_invest_2_multi_period.lp index 2331318ef..816985cb6 100644 --- a/tests/lp_files/storage_invest_2_multi_period.lp +++ b/tests/lp_files/storage_invest_2_multi_period.lp @@ -2,15 +2,15 @@ min objective: -+121.09030188807486 InvestmentFlowBlock_invest(electricityBus_storage2_0) -+118.71598224321065 InvestmentFlowBlock_invest(electricityBus_storage2_1) -+116.38821788550062 InvestmentFlowBlock_invest(electricityBus_storage2_2) -+11.00820926255226 InvestmentFlowBlock_invest(storage2_electricityBus_0) -+10.792362022110058 InvestmentFlowBlock_invest(storage2_electricityBus_1) -+10.580747080500057 InvestmentFlowBlock_invest(storage2_electricityBus_2) -+177.35448256334197 GenericInvestmentStorageBlock_invest(storage2_0) -+173.87694368955096 GenericInvestmentStorageBlock_invest(storage2_1) -+170.46759185250093 GenericInvestmentStorageBlock_invest(storage2_2) ++1.5873195277040417 InvestmentFlowBlock_invest(storage2_electricityBus_0) ++1.0477014265985347 InvestmentFlowBlock_invest(storage2_electricityBus_1) ++0.5186640725735326 InvestmentFlowBlock_invest(storage2_electricityBus_2) ++17.46051480474446 InvestmentFlowBlock_invest(electricityBus_storage2_0) ++11.524715692583884 InvestmentFlowBlock_invest(electricityBus_storage2_1) ++5.705304798308859 InvestmentFlowBlock_invest(electricityBus_storage2_2) ++25.57348127967623 GenericInvestmentStorageBlock_invest(storage2_0) ++16.879634095198618 GenericInvestmentStorageBlock_invest(storage2_1) ++8.35625450257358 GenericInvestmentStorageBlock_invest(storage2_2) s.t. @@ -44,25 +44,6 @@ c_e_BusBlock_balance(electricityBus_2_5)_: -1 flow(electricityBus_storage2_2_5) = 0 -c_e_InvestmentFlowBlock_total_rule(electricityBus_storage2_0)_: --1 InvestmentFlowBlock_invest(electricityBus_storage2_0) -+1 InvestmentFlowBlock_total(electricityBus_storage2_0) -= 0 - -c_e_InvestmentFlowBlock_total_rule(electricityBus_storage2_1)_: --1 InvestmentFlowBlock_invest(electricityBus_storage2_1) --1 InvestmentFlowBlock_total(electricityBus_storage2_0) -+1 InvestmentFlowBlock_total(electricityBus_storage2_1) -+1 InvestmentFlowBlock_old(electricityBus_storage2_1) -= 0 - -c_e_InvestmentFlowBlock_total_rule(electricityBus_storage2_2)_: --1 InvestmentFlowBlock_invest(electricityBus_storage2_2) --1 InvestmentFlowBlock_total(electricityBus_storage2_1) -+1 InvestmentFlowBlock_total(electricityBus_storage2_2) -+1 InvestmentFlowBlock_old(electricityBus_storage2_2) -= 0 - c_e_InvestmentFlowBlock_total_rule(storage2_electricityBus_0)_: -1 InvestmentFlowBlock_invest(storage2_electricityBus_0) +1 InvestmentFlowBlock_total(storage2_electricityBus_0) @@ -82,16 +63,23 @@ c_e_InvestmentFlowBlock_total_rule(storage2_electricityBus_2)_: +1 InvestmentFlowBlock_old(storage2_electricityBus_2) = 0 -c_e_InvestmentFlowBlock_old_rule_end(electricityBus_storage2_0)_: -+1 InvestmentFlowBlock_old_end(electricityBus_storage2_0) +c_e_InvestmentFlowBlock_total_rule(electricityBus_storage2_0)_: +-1 InvestmentFlowBlock_invest(electricityBus_storage2_0) ++1 InvestmentFlowBlock_total(electricityBus_storage2_0) = 0 -c_e_InvestmentFlowBlock_old_rule_end(electricityBus_storage2_1)_: -+1 InvestmentFlowBlock_old_end(electricityBus_storage2_1) +c_e_InvestmentFlowBlock_total_rule(electricityBus_storage2_1)_: +-1 InvestmentFlowBlock_invest(electricityBus_storage2_1) +-1 InvestmentFlowBlock_total(electricityBus_storage2_0) ++1 InvestmentFlowBlock_total(electricityBus_storage2_1) ++1 InvestmentFlowBlock_old(electricityBus_storage2_1) = 0 -c_e_InvestmentFlowBlock_old_rule_end(electricityBus_storage2_2)_: -+1 InvestmentFlowBlock_old_end(electricityBus_storage2_2) +c_e_InvestmentFlowBlock_total_rule(electricityBus_storage2_2)_: +-1 InvestmentFlowBlock_invest(electricityBus_storage2_2) +-1 InvestmentFlowBlock_total(electricityBus_storage2_1) ++1 InvestmentFlowBlock_total(electricityBus_storage2_2) ++1 InvestmentFlowBlock_old(electricityBus_storage2_2) = 0 c_e_InvestmentFlowBlock_old_rule_end(storage2_electricityBus_0)_: @@ -106,16 +94,16 @@ c_e_InvestmentFlowBlock_old_rule_end(storage2_electricityBus_2)_: +1 InvestmentFlowBlock_old_end(storage2_electricityBus_2) = 0 -c_e_InvestmentFlowBlock_old_rule_exo(electricityBus_storage2_0)_: -+1 InvestmentFlowBlock_old_exo(electricityBus_storage2_0) +c_e_InvestmentFlowBlock_old_rule_end(electricityBus_storage2_0)_: ++1 InvestmentFlowBlock_old_end(electricityBus_storage2_0) = 0 -c_e_InvestmentFlowBlock_old_rule_exo(electricityBus_storage2_1)_: -+1 InvestmentFlowBlock_old_exo(electricityBus_storage2_1) +c_e_InvestmentFlowBlock_old_rule_end(electricityBus_storage2_1)_: ++1 InvestmentFlowBlock_old_end(electricityBus_storage2_1) = 0 -c_e_InvestmentFlowBlock_old_rule_exo(electricityBus_storage2_2)_: -+1 InvestmentFlowBlock_old_exo(electricityBus_storage2_2) +c_e_InvestmentFlowBlock_old_rule_end(electricityBus_storage2_2)_: ++1 InvestmentFlowBlock_old_end(electricityBus_storage2_2) = 0 c_e_InvestmentFlowBlock_old_rule_exo(storage2_electricityBus_0)_: @@ -130,22 +118,16 @@ c_e_InvestmentFlowBlock_old_rule_exo(storage2_electricityBus_2)_: +1 InvestmentFlowBlock_old_exo(storage2_electricityBus_2) = 0 -c_e_InvestmentFlowBlock_old_rule(electricityBus_storage2_0)_: --1 InvestmentFlowBlock_old_end(electricityBus_storage2_0) --1 InvestmentFlowBlock_old_exo(electricityBus_storage2_0) -+1 InvestmentFlowBlock_old(electricityBus_storage2_0) +c_e_InvestmentFlowBlock_old_rule_exo(electricityBus_storage2_0)_: ++1 InvestmentFlowBlock_old_exo(electricityBus_storage2_0) = 0 -c_e_InvestmentFlowBlock_old_rule(electricityBus_storage2_1)_: -+1 InvestmentFlowBlock_old(electricityBus_storage2_1) --1 InvestmentFlowBlock_old_end(electricityBus_storage2_1) --1 InvestmentFlowBlock_old_exo(electricityBus_storage2_1) +c_e_InvestmentFlowBlock_old_rule_exo(electricityBus_storage2_1)_: ++1 InvestmentFlowBlock_old_exo(electricityBus_storage2_1) = 0 -c_e_InvestmentFlowBlock_old_rule(electricityBus_storage2_2)_: -+1 InvestmentFlowBlock_old(electricityBus_storage2_2) --1 InvestmentFlowBlock_old_end(electricityBus_storage2_2) --1 InvestmentFlowBlock_old_exo(electricityBus_storage2_2) +c_e_InvestmentFlowBlock_old_rule_exo(electricityBus_storage2_2)_: ++1 InvestmentFlowBlock_old_exo(electricityBus_storage2_2) = 0 c_e_InvestmentFlowBlock_old_rule(storage2_electricityBus_0)_: @@ -166,35 +148,23 @@ c_e_InvestmentFlowBlock_old_rule(storage2_electricityBus_2)_: -1 InvestmentFlowBlock_old_exo(storage2_electricityBus_2) = 0 -c_u_InvestmentFlowBlock_max(electricityBus_storage2_0_0)_: -+1 flow(electricityBus_storage2_0_0) --1 InvestmentFlowBlock_total(electricityBus_storage2_0) -<= 0 - -c_u_InvestmentFlowBlock_max(electricityBus_storage2_0_1)_: -+1 flow(electricityBus_storage2_0_1) --1 InvestmentFlowBlock_total(electricityBus_storage2_0) -<= 0 - -c_u_InvestmentFlowBlock_max(electricityBus_storage2_1_2)_: -+1 flow(electricityBus_storage2_1_2) --1 InvestmentFlowBlock_total(electricityBus_storage2_1) -<= 0 - -c_u_InvestmentFlowBlock_max(electricityBus_storage2_1_3)_: -+1 flow(electricityBus_storage2_1_3) --1 InvestmentFlowBlock_total(electricityBus_storage2_1) -<= 0 +c_e_InvestmentFlowBlock_old_rule(electricityBus_storage2_0)_: +-1 InvestmentFlowBlock_old_end(electricityBus_storage2_0) +-1 InvestmentFlowBlock_old_exo(electricityBus_storage2_0) ++1 InvestmentFlowBlock_old(electricityBus_storage2_0) += 0 -c_u_InvestmentFlowBlock_max(electricityBus_storage2_2_4)_: -+1 flow(electricityBus_storage2_2_4) --1 InvestmentFlowBlock_total(electricityBus_storage2_2) -<= 0 +c_e_InvestmentFlowBlock_old_rule(electricityBus_storage2_1)_: ++1 InvestmentFlowBlock_old(electricityBus_storage2_1) +-1 InvestmentFlowBlock_old_end(electricityBus_storage2_1) +-1 InvestmentFlowBlock_old_exo(electricityBus_storage2_1) += 0 -c_u_InvestmentFlowBlock_max(electricityBus_storage2_2_5)_: -+1 flow(electricityBus_storage2_2_5) --1 InvestmentFlowBlock_total(electricityBus_storage2_2) -<= 0 +c_e_InvestmentFlowBlock_old_rule(electricityBus_storage2_2)_: ++1 InvestmentFlowBlock_old(electricityBus_storage2_2) +-1 InvestmentFlowBlock_old_end(electricityBus_storage2_2) +-1 InvestmentFlowBlock_old_exo(electricityBus_storage2_2) += 0 c_u_InvestmentFlowBlock_max(storage2_electricityBus_0_0)_: +1 flow(storage2_electricityBus_0_0) @@ -226,6 +196,36 @@ c_u_InvestmentFlowBlock_max(storage2_electricityBus_2_5)_: -1 InvestmentFlowBlock_total(storage2_electricityBus_2) <= 0 +c_u_InvestmentFlowBlock_max(electricityBus_storage2_0_0)_: ++1 flow(electricityBus_storage2_0_0) +-1 InvestmentFlowBlock_total(electricityBus_storage2_0) +<= 0 + +c_u_InvestmentFlowBlock_max(electricityBus_storage2_0_1)_: ++1 flow(electricityBus_storage2_0_1) +-1 InvestmentFlowBlock_total(electricityBus_storage2_0) +<= 0 + +c_u_InvestmentFlowBlock_max(electricityBus_storage2_1_2)_: ++1 flow(electricityBus_storage2_1_2) +-1 InvestmentFlowBlock_total(electricityBus_storage2_1) +<= 0 + +c_u_InvestmentFlowBlock_max(electricityBus_storage2_1_3)_: ++1 flow(electricityBus_storage2_1_3) +-1 InvestmentFlowBlock_total(electricityBus_storage2_1) +<= 0 + +c_u_InvestmentFlowBlock_max(electricityBus_storage2_2_4)_: ++1 flow(electricityBus_storage2_2_4) +-1 InvestmentFlowBlock_total(electricityBus_storage2_2) +<= 0 + +c_u_InvestmentFlowBlock_max(electricityBus_storage2_2_5)_: ++1 flow(electricityBus_storage2_2_5) +-1 InvestmentFlowBlock_total(electricityBus_storage2_2) +<= 0 + c_e_GenericInvestmentStorageBlock_total_storage_rule(storage2_0)_: -1 GenericInvestmentStorageBlock_invest(storage2_0) +1 GenericInvestmentStorageBlock_total(storage2_0) @@ -357,12 +357,12 @@ c_u_GenericInvestmentStorageBlock_max_storage_content(storage2_2_5)_: <= 0 bounds - 0 <= InvestmentFlowBlock_invest(electricityBus_storage2_0) <= +inf - 0 <= InvestmentFlowBlock_invest(electricityBus_storage2_1) <= +inf - 0 <= InvestmentFlowBlock_invest(electricityBus_storage2_2) <= +inf 0 <= InvestmentFlowBlock_invest(storage2_electricityBus_0) <= +inf 0 <= InvestmentFlowBlock_invest(storage2_electricityBus_1) <= +inf 0 <= InvestmentFlowBlock_invest(storage2_electricityBus_2) <= +inf + 0 <= InvestmentFlowBlock_invest(electricityBus_storage2_0) <= +inf + 0 <= InvestmentFlowBlock_invest(electricityBus_storage2_1) <= +inf + 0 <= InvestmentFlowBlock_invest(electricityBus_storage2_2) <= +inf 0 <= GenericInvestmentStorageBlock_invest(storage2_0) <= +inf 0 <= GenericInvestmentStorageBlock_invest(storage2_1) <= +inf 0 <= GenericInvestmentStorageBlock_invest(storage2_2) <= +inf @@ -378,30 +378,30 @@ bounds 0 <= flow(electricityBus_storage2_2_4) <= +inf 0 <= flow(storage2_electricityBus_2_5) <= +inf 0 <= flow(electricityBus_storage2_2_5) <= +inf - 0 <= InvestmentFlowBlock_total(electricityBus_storage2_0) <= +inf - 0 <= InvestmentFlowBlock_total(electricityBus_storage2_1) <= +inf - 0 <= InvestmentFlowBlock_old(electricityBus_storage2_1) <= +inf - 0 <= InvestmentFlowBlock_total(electricityBus_storage2_2) <= +inf - 0 <= InvestmentFlowBlock_old(electricityBus_storage2_2) <= +inf 0 <= InvestmentFlowBlock_total(storage2_electricityBus_0) <= +inf 0 <= InvestmentFlowBlock_total(storage2_electricityBus_1) <= +inf 0 <= InvestmentFlowBlock_old(storage2_electricityBus_1) <= +inf 0 <= InvestmentFlowBlock_total(storage2_electricityBus_2) <= +inf 0 <= InvestmentFlowBlock_old(storage2_electricityBus_2) <= +inf - 0 <= InvestmentFlowBlock_old_end(electricityBus_storage2_0) <= +inf - 0 <= InvestmentFlowBlock_old_end(electricityBus_storage2_1) <= +inf - 0 <= InvestmentFlowBlock_old_end(electricityBus_storage2_2) <= +inf + 0 <= InvestmentFlowBlock_total(electricityBus_storage2_0) <= +inf + 0 <= InvestmentFlowBlock_total(electricityBus_storage2_1) <= +inf + 0 <= InvestmentFlowBlock_old(electricityBus_storage2_1) <= +inf + 0 <= InvestmentFlowBlock_total(electricityBus_storage2_2) <= +inf + 0 <= InvestmentFlowBlock_old(electricityBus_storage2_2) <= +inf 0 <= InvestmentFlowBlock_old_end(storage2_electricityBus_0) <= +inf 0 <= InvestmentFlowBlock_old_end(storage2_electricityBus_1) <= +inf 0 <= InvestmentFlowBlock_old_end(storage2_electricityBus_2) <= +inf - 0 <= InvestmentFlowBlock_old_exo(electricityBus_storage2_0) <= +inf - 0 <= InvestmentFlowBlock_old_exo(electricityBus_storage2_1) <= +inf - 0 <= InvestmentFlowBlock_old_exo(electricityBus_storage2_2) <= +inf + 0 <= InvestmentFlowBlock_old_end(electricityBus_storage2_0) <= +inf + 0 <= InvestmentFlowBlock_old_end(electricityBus_storage2_1) <= +inf + 0 <= InvestmentFlowBlock_old_end(electricityBus_storage2_2) <= +inf 0 <= InvestmentFlowBlock_old_exo(storage2_electricityBus_0) <= +inf 0 <= InvestmentFlowBlock_old_exo(storage2_electricityBus_1) <= +inf 0 <= InvestmentFlowBlock_old_exo(storage2_electricityBus_2) <= +inf - 0 <= InvestmentFlowBlock_old(electricityBus_storage2_0) <= +inf + 0 <= InvestmentFlowBlock_old_exo(electricityBus_storage2_0) <= +inf + 0 <= InvestmentFlowBlock_old_exo(electricityBus_storage2_1) <= +inf + 0 <= InvestmentFlowBlock_old_exo(electricityBus_storage2_2) <= +inf 0 <= InvestmentFlowBlock_old(storage2_electricityBus_0) <= +inf + 0 <= InvestmentFlowBlock_old(electricityBus_storage2_0) <= +inf 0 <= GenericInvestmentStorageBlock_total(storage2_0) <= +inf 0 <= GenericInvestmentStorageBlock_total(storage2_1) <= +inf 0 <= GenericInvestmentStorageBlock_old(storage2_1) <= +inf diff --git a/tests/lp_files/storage_invest_3_multi_period.lp b/tests/lp_files/storage_invest_3_multi_period.lp index 2fc9750d0..f5646972e 100644 --- a/tests/lp_files/storage_invest_3_multi_period.lp +++ b/tests/lp_files/storage_invest_3_multi_period.lp @@ -2,12 +2,12 @@ min objective: -+101.97980198019803 InvestmentFlowBlock_invest(electricityBus_storage3_0) -+99.98019801980199 InvestmentFlowBlock_invest(electricityBus_storage3_1) -+98.01980198019803 InvestmentFlowBlock_invest(electricityBus_storage3_2) -+11.00820926255226 InvestmentFlowBlock_invest(storage3_electricityBus_0) -+10.792362022110058 InvestmentFlowBlock_invest(storage3_electricityBus_1) -+10.580747080500057 InvestmentFlowBlock_invest(storage3_electricityBus_2) ++98.99999999999999 InvestmentFlowBlock_invest(electricityBus_storage3_0) ++97.05882352941174 InvestmentFlowBlock_invest(electricityBus_storage3_1) ++48.0489225393128 InvestmentFlowBlock_invest(electricityBus_storage3_2) ++1.5873195277040417 InvestmentFlowBlock_invest(storage3_electricityBus_0) ++1.0477014265985347 InvestmentFlowBlock_invest(storage3_electricityBus_1) ++0.5186640725735326 InvestmentFlowBlock_invest(storage3_electricityBus_2) s.t. diff --git a/tests/lp_files/storage_invest_4_multi_period.lp b/tests/lp_files/storage_invest_4_multi_period.lp index c391c9b46..c08305a40 100644 --- a/tests/lp_files/storage_invest_4_multi_period.lp +++ b/tests/lp_files/storage_invest_4_multi_period.lp @@ -2,9 +2,9 @@ min objective: -+149.3643564356436 GenericInvestmentStorageBlock_invest(storage4_0) -+146.43564356435647 GenericInvestmentStorageBlock_invest(storage4_1) -+143.5643564356436 GenericInvestmentStorageBlock_invest(storage4_2) ++145.0 GenericInvestmentStorageBlock_invest(storage4_0) ++142.15686274509804 GenericInvestmentStorageBlock_invest(storage4_1) ++70.37468452727633 GenericInvestmentStorageBlock_invest(storage4_2) s.t. diff --git a/tests/lp_files/storage_invest_5_multi_period.lp b/tests/lp_files/storage_invest_5_multi_period.lp index db88b35f0..e139e72db 100644 --- a/tests/lp_files/storage_invest_5_multi_period.lp +++ b/tests/lp_files/storage_invest_5_multi_period.lp @@ -2,9 +2,9 @@ min objective: -+121.09030188807486 InvestmentFlowBlock_invest(electricityBus_storage5_0) -+118.71598224321065 InvestmentFlowBlock_invest(electricityBus_storage5_1) -+116.38821788550062 InvestmentFlowBlock_invest(electricityBus_storage5_2) ++17.46051480474446 InvestmentFlowBlock_invest(electricityBus_storage5_0) ++11.524715692583884 InvestmentFlowBlock_invest(electricityBus_storage5_1) ++5.705304798308859 InvestmentFlowBlock_invest(electricityBus_storage5_2) s.t. @@ -38,25 +38,6 @@ c_e_BusBlock_balance(electricityBus_2_5)_: -1 flow(electricityBus_storage5_2_5) = 0 -c_e_InvestmentFlowBlock_total_rule(electricityBus_storage5_0)_: --1 InvestmentFlowBlock_invest(electricityBus_storage5_0) -+1 InvestmentFlowBlock_total(electricityBus_storage5_0) -= 110 - -c_e_InvestmentFlowBlock_total_rule(electricityBus_storage5_1)_: --1 InvestmentFlowBlock_invest(electricityBus_storage5_1) --1 InvestmentFlowBlock_total(electricityBus_storage5_0) -+1 InvestmentFlowBlock_total(electricityBus_storage5_1) -+1 InvestmentFlowBlock_old(electricityBus_storage5_1) -= 0 - -c_e_InvestmentFlowBlock_total_rule(electricityBus_storage5_2)_: --1 InvestmentFlowBlock_invest(electricityBus_storage5_2) --1 InvestmentFlowBlock_total(electricityBus_storage5_1) -+1 InvestmentFlowBlock_total(electricityBus_storage5_2) -+1 InvestmentFlowBlock_old(electricityBus_storage5_2) -= 0 - c_e_InvestmentFlowBlock_total_rule(storage5_electricityBus_0)_: +1 InvestmentFlowBlock_total(storage5_electricityBus_0) -1 InvestmentFlowBlock_invest(storage5_electricityBus_0) @@ -76,16 +57,23 @@ c_e_InvestmentFlowBlock_total_rule(storage5_electricityBus_2)_: +1 InvestmentFlowBlock_old(storage5_electricityBus_2) = 0 -c_e_InvestmentFlowBlock_old_rule_end(electricityBus_storage5_0)_: -+1 InvestmentFlowBlock_old_end(electricityBus_storage5_0) -= 0 +c_e_InvestmentFlowBlock_total_rule(electricityBus_storage5_0)_: +-1 InvestmentFlowBlock_invest(electricityBus_storage5_0) ++1 InvestmentFlowBlock_total(electricityBus_storage5_0) += 110 -c_e_InvestmentFlowBlock_old_rule_end(electricityBus_storage5_1)_: -+1 InvestmentFlowBlock_old_end(electricityBus_storage5_1) +c_e_InvestmentFlowBlock_total_rule(electricityBus_storage5_1)_: +-1 InvestmentFlowBlock_invest(electricityBus_storage5_1) +-1 InvestmentFlowBlock_total(electricityBus_storage5_0) ++1 InvestmentFlowBlock_total(electricityBus_storage5_1) ++1 InvestmentFlowBlock_old(electricityBus_storage5_1) = 0 -c_e_InvestmentFlowBlock_old_rule_end(electricityBus_storage5_2)_: -+1 InvestmentFlowBlock_old_end(electricityBus_storage5_2) +c_e_InvestmentFlowBlock_total_rule(electricityBus_storage5_2)_: +-1 InvestmentFlowBlock_invest(electricityBus_storage5_2) +-1 InvestmentFlowBlock_total(electricityBus_storage5_1) ++1 InvestmentFlowBlock_total(electricityBus_storage5_2) ++1 InvestmentFlowBlock_old(electricityBus_storage5_2) = 0 c_e_InvestmentFlowBlock_old_rule_end(storage5_electricityBus_0)_: @@ -100,16 +88,16 @@ c_e_InvestmentFlowBlock_old_rule_end(storage5_electricityBus_2)_: +1 InvestmentFlowBlock_old_end(storage5_electricityBus_2) = 0 -c_e_InvestmentFlowBlock_old_rule_exo(electricityBus_storage5_0)_: -+1 InvestmentFlowBlock_old_exo(electricityBus_storage5_0) +c_e_InvestmentFlowBlock_old_rule_end(electricityBus_storage5_0)_: ++1 InvestmentFlowBlock_old_end(electricityBus_storage5_0) = 0 -c_e_InvestmentFlowBlock_old_rule_exo(electricityBus_storage5_1)_: -+1 InvestmentFlowBlock_old_exo(electricityBus_storage5_1) +c_e_InvestmentFlowBlock_old_rule_end(electricityBus_storage5_1)_: ++1 InvestmentFlowBlock_old_end(electricityBus_storage5_1) = 0 -c_e_InvestmentFlowBlock_old_rule_exo(electricityBus_storage5_2)_: -+1 InvestmentFlowBlock_old_exo(electricityBus_storage5_2) +c_e_InvestmentFlowBlock_old_rule_end(electricityBus_storage5_2)_: ++1 InvestmentFlowBlock_old_end(electricityBus_storage5_2) = 0 c_e_InvestmentFlowBlock_old_rule_exo(storage5_electricityBus_0)_: @@ -124,22 +112,16 @@ c_e_InvestmentFlowBlock_old_rule_exo(storage5_electricityBus_2)_: +1 InvestmentFlowBlock_old_exo(storage5_electricityBus_2) = 0 -c_e_InvestmentFlowBlock_old_rule(electricityBus_storage5_0)_: --1 InvestmentFlowBlock_old_end(electricityBus_storage5_0) --1 InvestmentFlowBlock_old_exo(electricityBus_storage5_0) -+1 InvestmentFlowBlock_old(electricityBus_storage5_0) +c_e_InvestmentFlowBlock_old_rule_exo(electricityBus_storage5_0)_: ++1 InvestmentFlowBlock_old_exo(electricityBus_storage5_0) = 0 -c_e_InvestmentFlowBlock_old_rule(electricityBus_storage5_1)_: -+1 InvestmentFlowBlock_old(electricityBus_storage5_1) --1 InvestmentFlowBlock_old_end(electricityBus_storage5_1) --1 InvestmentFlowBlock_old_exo(electricityBus_storage5_1) +c_e_InvestmentFlowBlock_old_rule_exo(electricityBus_storage5_1)_: ++1 InvestmentFlowBlock_old_exo(electricityBus_storage5_1) = 0 -c_e_InvestmentFlowBlock_old_rule(electricityBus_storage5_2)_: -+1 InvestmentFlowBlock_old(electricityBus_storage5_2) --1 InvestmentFlowBlock_old_end(electricityBus_storage5_2) --1 InvestmentFlowBlock_old_exo(electricityBus_storage5_2) +c_e_InvestmentFlowBlock_old_rule_exo(electricityBus_storage5_2)_: ++1 InvestmentFlowBlock_old_exo(electricityBus_storage5_2) = 0 c_e_InvestmentFlowBlock_old_rule(storage5_electricityBus_0)_: @@ -160,35 +142,23 @@ c_e_InvestmentFlowBlock_old_rule(storage5_electricityBus_2)_: -1 InvestmentFlowBlock_old_exo(storage5_electricityBus_2) = 0 -c_u_InvestmentFlowBlock_max(electricityBus_storage5_0_0)_: -+1 flow(electricityBus_storage5_0_0) --1 InvestmentFlowBlock_total(electricityBus_storage5_0) -<= 0 - -c_u_InvestmentFlowBlock_max(electricityBus_storage5_0_1)_: -+1 flow(electricityBus_storage5_0_1) --1 InvestmentFlowBlock_total(electricityBus_storage5_0) -<= 0 - -c_u_InvestmentFlowBlock_max(electricityBus_storage5_1_2)_: -+1 flow(electricityBus_storage5_1_2) --1 InvestmentFlowBlock_total(electricityBus_storage5_1) -<= 0 - -c_u_InvestmentFlowBlock_max(electricityBus_storage5_1_3)_: -+1 flow(electricityBus_storage5_1_3) --1 InvestmentFlowBlock_total(electricityBus_storage5_1) -<= 0 +c_e_InvestmentFlowBlock_old_rule(electricityBus_storage5_0)_: +-1 InvestmentFlowBlock_old_end(electricityBus_storage5_0) +-1 InvestmentFlowBlock_old_exo(electricityBus_storage5_0) ++1 InvestmentFlowBlock_old(electricityBus_storage5_0) += 0 -c_u_InvestmentFlowBlock_max(electricityBus_storage5_2_4)_: -+1 flow(electricityBus_storage5_2_4) --1 InvestmentFlowBlock_total(electricityBus_storage5_2) -<= 0 +c_e_InvestmentFlowBlock_old_rule(electricityBus_storage5_1)_: ++1 InvestmentFlowBlock_old(electricityBus_storage5_1) +-1 InvestmentFlowBlock_old_end(electricityBus_storage5_1) +-1 InvestmentFlowBlock_old_exo(electricityBus_storage5_1) += 0 -c_u_InvestmentFlowBlock_max(electricityBus_storage5_2_5)_: -+1 flow(electricityBus_storage5_2_5) --1 InvestmentFlowBlock_total(electricityBus_storage5_2) -<= 0 +c_e_InvestmentFlowBlock_old_rule(electricityBus_storage5_2)_: ++1 InvestmentFlowBlock_old(electricityBus_storage5_2) +-1 InvestmentFlowBlock_old_end(electricityBus_storage5_2) +-1 InvestmentFlowBlock_old_exo(electricityBus_storage5_2) += 0 c_u_InvestmentFlowBlock_max(storage5_electricityBus_0_0)_: +1 flow(storage5_electricityBus_0_0) @@ -220,6 +190,36 @@ c_u_InvestmentFlowBlock_max(storage5_electricityBus_2_5)_: -1 InvestmentFlowBlock_total(storage5_electricityBus_2) <= 0 +c_u_InvestmentFlowBlock_max(electricityBus_storage5_0_0)_: ++1 flow(electricityBus_storage5_0_0) +-1 InvestmentFlowBlock_total(electricityBus_storage5_0) +<= 0 + +c_u_InvestmentFlowBlock_max(electricityBus_storage5_0_1)_: ++1 flow(electricityBus_storage5_0_1) +-1 InvestmentFlowBlock_total(electricityBus_storage5_0) +<= 0 + +c_u_InvestmentFlowBlock_max(electricityBus_storage5_1_2)_: ++1 flow(electricityBus_storage5_1_2) +-1 InvestmentFlowBlock_total(electricityBus_storage5_1) +<= 0 + +c_u_InvestmentFlowBlock_max(electricityBus_storage5_1_3)_: ++1 flow(electricityBus_storage5_1_3) +-1 InvestmentFlowBlock_total(electricityBus_storage5_1) +<= 0 + +c_u_InvestmentFlowBlock_max(electricityBus_storage5_2_4)_: ++1 flow(electricityBus_storage5_2_4) +-1 InvestmentFlowBlock_total(electricityBus_storage5_2) +<= 0 + +c_u_InvestmentFlowBlock_max(electricityBus_storage5_2_5)_: ++1 flow(electricityBus_storage5_2_5) +-1 InvestmentFlowBlock_total(electricityBus_storage5_2) +<= 0 + c_e_GenericStorageBlock_balance(storage5_0_0)_: +1 flow(storage5_electricityBus_0_0) -1 flow(electricityBus_storage5_0_0) @@ -268,18 +268,18 @@ c_e_GenericStorageBlock_balanced_cstr(storage5)_: = 0 c_e_GenericStorageBlock_power_coupled(storage5_0)_: --1 InvestmentFlowBlock_total(electricityBus_storage5_0) +1.1 InvestmentFlowBlock_total(storage5_electricityBus_0) +-1 InvestmentFlowBlock_total(electricityBus_storage5_0) = 0 c_e_GenericStorageBlock_power_coupled(storage5_1)_: --1 InvestmentFlowBlock_total(electricityBus_storage5_1) +1.1 InvestmentFlowBlock_total(storage5_electricityBus_1) +-1 InvestmentFlowBlock_total(electricityBus_storage5_1) = 0 c_e_GenericStorageBlock_power_coupled(storage5_2)_: --1 InvestmentFlowBlock_total(electricityBus_storage5_2) +1.1 InvestmentFlowBlock_total(storage5_electricityBus_2) +-1 InvestmentFlowBlock_total(electricityBus_storage5_2) = 0 bounds @@ -298,11 +298,6 @@ bounds 0 <= flow(electricityBus_storage5_2_4) <= +inf 0 <= flow(storage5_electricityBus_2_5) <= +inf 0 <= flow(electricityBus_storage5_2_5) <= +inf - 0 <= InvestmentFlowBlock_total(electricityBus_storage5_0) <= +inf - 0 <= InvestmentFlowBlock_total(electricityBus_storage5_1) <= +inf - 0 <= InvestmentFlowBlock_old(electricityBus_storage5_1) <= +inf - 0 <= InvestmentFlowBlock_total(electricityBus_storage5_2) <= +inf - 0 <= InvestmentFlowBlock_old(electricityBus_storage5_2) <= +inf 0 <= InvestmentFlowBlock_total(storage5_electricityBus_0) <= +inf 0 <= InvestmentFlowBlock_invest(storage5_electricityBus_0) <= +inf 0 <= InvestmentFlowBlock_total(storage5_electricityBus_1) <= +inf @@ -311,20 +306,25 @@ bounds 0 <= InvestmentFlowBlock_total(storage5_electricityBus_2) <= +inf 0 <= InvestmentFlowBlock_invest(storage5_electricityBus_2) <= +inf 0 <= InvestmentFlowBlock_old(storage5_electricityBus_2) <= +inf - 0 <= InvestmentFlowBlock_old_end(electricityBus_storage5_0) <= +inf - 0 <= InvestmentFlowBlock_old_end(electricityBus_storage5_1) <= +inf - 0 <= InvestmentFlowBlock_old_end(electricityBus_storage5_2) <= +inf + 0 <= InvestmentFlowBlock_total(electricityBus_storage5_0) <= +inf + 0 <= InvestmentFlowBlock_total(electricityBus_storage5_1) <= +inf + 0 <= InvestmentFlowBlock_old(electricityBus_storage5_1) <= +inf + 0 <= InvestmentFlowBlock_total(electricityBus_storage5_2) <= +inf + 0 <= InvestmentFlowBlock_old(electricityBus_storage5_2) <= +inf 0 <= InvestmentFlowBlock_old_end(storage5_electricityBus_0) <= +inf 0 <= InvestmentFlowBlock_old_end(storage5_electricityBus_1) <= +inf 0 <= InvestmentFlowBlock_old_end(storage5_electricityBus_2) <= +inf - 0 <= InvestmentFlowBlock_old_exo(electricityBus_storage5_0) <= +inf - 0 <= InvestmentFlowBlock_old_exo(electricityBus_storage5_1) <= +inf - 0 <= InvestmentFlowBlock_old_exo(electricityBus_storage5_2) <= +inf + 0 <= InvestmentFlowBlock_old_end(electricityBus_storage5_0) <= +inf + 0 <= InvestmentFlowBlock_old_end(electricityBus_storage5_1) <= +inf + 0 <= InvestmentFlowBlock_old_end(electricityBus_storage5_2) <= +inf 0 <= InvestmentFlowBlock_old_exo(storage5_electricityBus_0) <= +inf 0 <= InvestmentFlowBlock_old_exo(storage5_electricityBus_1) <= +inf 0 <= InvestmentFlowBlock_old_exo(storage5_electricityBus_2) <= +inf - 0 <= InvestmentFlowBlock_old(electricityBus_storage5_0) <= +inf + 0 <= InvestmentFlowBlock_old_exo(electricityBus_storage5_0) <= +inf + 0 <= InvestmentFlowBlock_old_exo(electricityBus_storage5_1) <= +inf + 0 <= InvestmentFlowBlock_old_exo(electricityBus_storage5_2) <= +inf 0 <= InvestmentFlowBlock_old(storage5_electricityBus_0) <= +inf + 0 <= InvestmentFlowBlock_old(electricityBus_storage5_0) <= +inf 0 <= GenericStorageBlock_storage_content(storage5_1) <= 10000 0 <= GenericStorageBlock_storage_content(storage5_0) <= 10000 0 <= GenericStorageBlock_storage_content(storage5_2) <= 10000 diff --git a/tests/lp_files/storage_invest_6_multi_period.lp b/tests/lp_files/storage_invest_6_multi_period.lp index 8ad4b9f42..4fc195eda 100644 --- a/tests/lp_files/storage_invest_6_multi_period.lp +++ b/tests/lp_files/storage_invest_6_multi_period.lp @@ -2,12 +2,12 @@ min objective: -+121.09030188807486 InvestmentFlowBlock_invest(electricityBus_storage6_0) -+118.71598224321065 InvestmentFlowBlock_invest(electricityBus_storage6_1) -+116.38821788550062 InvestmentFlowBlock_invest(electricityBus_storage6_2) -+177.35448256334197 GenericInvestmentStorageBlock_invest(storage6_0) -+173.87694368955096 GenericInvestmentStorageBlock_invest(storage6_1) -+170.46759185250093 GenericInvestmentStorageBlock_invest(storage6_2) ++17.46051480474446 InvestmentFlowBlock_invest(electricityBus_storage6_0) ++11.524715692583884 InvestmentFlowBlock_invest(electricityBus_storage6_1) ++5.705304798308859 InvestmentFlowBlock_invest(electricityBus_storage6_2) ++25.57348127967623 GenericInvestmentStorageBlock_invest(storage6_0) ++16.879634095198618 GenericInvestmentStorageBlock_invest(storage6_1) ++8.35625450257358 GenericInvestmentStorageBlock_invest(storage6_2) s.t. diff --git a/tests/lp_files/storage_invest_all_nonconvex_multi_period.lp b/tests/lp_files/storage_invest_all_nonconvex_multi_period.lp index 68765fd78..b78eca2f7 100644 --- a/tests/lp_files/storage_invest_all_nonconvex_multi_period.lp +++ b/tests/lp_files/storage_invest_all_nonconvex_multi_period.lp @@ -2,23 +2,23 @@ min objective: -+12.231343625058066 InvestmentFlowBlock_invest(bus1_storage_all_nonconvex_0) -+10 InvestmentFlowBlock_invest_status(bus1_storage_all_nonconvex_0) -+11.991513357900065 InvestmentFlowBlock_invest(bus1_storage_all_nonconvex_1) -+9.80392156862745 InvestmentFlowBlock_invest_status(bus1_storage_all_nonconvex_1) -+11.756385645000064 InvestmentFlowBlock_invest(bus1_storage_all_nonconvex_2) -+9.611687812379854 InvestmentFlowBlock_invest_status(bus1_storage_all_nonconvex_2) -+12.231343625058066 InvestmentFlowBlock_invest(storage_all_nonconvex_bus1_0) ++1.7636883641156018 InvestmentFlowBlock_invest(storage_all_nonconvex_bus1_0) +15 InvestmentFlowBlock_invest_status(storage_all_nonconvex_bus1_0) -+11.991513357900065 InvestmentFlowBlock_invest(storage_all_nonconvex_bus1_1) ++1.164112696220594 InvestmentFlowBlock_invest(storage_all_nonconvex_bus1_1) +14.705882352941176 InvestmentFlowBlock_invest_status(storage_all_nonconvex_bus1_1) -+11.756385645000064 InvestmentFlowBlock_invest(storage_all_nonconvex_bus1_2) ++0.5762934139705919 InvestmentFlowBlock_invest(storage_all_nonconvex_bus1_2) +14.41753171856978 InvestmentFlowBlock_invest_status(storage_all_nonconvex_bus1_2) -+24.462687250116133 GenericInvestmentStorageBlock_invest(storage_all_nonconvex_0) ++1.7636883641156018 InvestmentFlowBlock_invest(bus1_storage_all_nonconvex_0) ++10 InvestmentFlowBlock_invest_status(bus1_storage_all_nonconvex_0) ++1.164112696220594 InvestmentFlowBlock_invest(bus1_storage_all_nonconvex_1) ++9.80392156862745 InvestmentFlowBlock_invest_status(bus1_storage_all_nonconvex_1) ++0.5762934139705919 InvestmentFlowBlock_invest(bus1_storage_all_nonconvex_2) ++9.611687812379854 InvestmentFlowBlock_invest_status(bus1_storage_all_nonconvex_2) ++3.5273767282312036 GenericInvestmentStorageBlock_invest(storage_all_nonconvex_0) +30 GenericInvestmentStorageBlock_invest_status(storage_all_nonconvex_0) -+23.98302671580013 GenericInvestmentStorageBlock_invest(storage_all_nonconvex_1) ++2.328225392441188 GenericInvestmentStorageBlock_invest(storage_all_nonconvex_1) +29.41176470588235 GenericInvestmentStorageBlock_invest_status(storage_all_nonconvex_1) -+23.512771290000128 GenericInvestmentStorageBlock_invest(storage_all_nonconvex_2) ++1.1525868279411837 GenericInvestmentStorageBlock_invest(storage_all_nonconvex_2) +28.83506343713956 GenericInvestmentStorageBlock_invest_status(storage_all_nonconvex_2) s.t. @@ -53,21 +53,6 @@ c_e_BusBlock_balance(bus1_2_5)_: -1 flow(bus1_storage_all_nonconvex_2_5) = 0 -c_u_InvestmentFlowBlock_minimum_rule(bus1_storage_all_nonconvex_0)_: --1 InvestmentFlowBlock_invest(bus1_storage_all_nonconvex_0) -+5 InvestmentFlowBlock_invest_status(bus1_storage_all_nonconvex_0) -<= 0 - -c_u_InvestmentFlowBlock_minimum_rule(bus1_storage_all_nonconvex_1)_: --1 InvestmentFlowBlock_invest(bus1_storage_all_nonconvex_1) -+5 InvestmentFlowBlock_invest_status(bus1_storage_all_nonconvex_1) -<= 0 - -c_u_InvestmentFlowBlock_minimum_rule(bus1_storage_all_nonconvex_2)_: --1 InvestmentFlowBlock_invest(bus1_storage_all_nonconvex_2) -+5 InvestmentFlowBlock_invest_status(bus1_storage_all_nonconvex_2) -<= 0 - c_u_InvestmentFlowBlock_minimum_rule(storage_all_nonconvex_bus1_0)_: -1 InvestmentFlowBlock_invest(storage_all_nonconvex_bus1_0) +8 InvestmentFlowBlock_invest_status(storage_all_nonconvex_bus1_0) @@ -83,19 +68,19 @@ c_u_InvestmentFlowBlock_minimum_rule(storage_all_nonconvex_bus1_2)_: +8 InvestmentFlowBlock_invest_status(storage_all_nonconvex_bus1_2) <= 0 -c_u_InvestmentFlowBlock_maximum_rule(bus1_storage_all_nonconvex_0)_: -+1 InvestmentFlowBlock_invest(bus1_storage_all_nonconvex_0) --30 InvestmentFlowBlock_invest_status(bus1_storage_all_nonconvex_0) +c_u_InvestmentFlowBlock_minimum_rule(bus1_storage_all_nonconvex_0)_: +-1 InvestmentFlowBlock_invest(bus1_storage_all_nonconvex_0) ++5 InvestmentFlowBlock_invest_status(bus1_storage_all_nonconvex_0) <= 0 -c_u_InvestmentFlowBlock_maximum_rule(bus1_storage_all_nonconvex_1)_: -+1 InvestmentFlowBlock_invest(bus1_storage_all_nonconvex_1) --30 InvestmentFlowBlock_invest_status(bus1_storage_all_nonconvex_1) +c_u_InvestmentFlowBlock_minimum_rule(bus1_storage_all_nonconvex_1)_: +-1 InvestmentFlowBlock_invest(bus1_storage_all_nonconvex_1) ++5 InvestmentFlowBlock_invest_status(bus1_storage_all_nonconvex_1) <= 0 -c_u_InvestmentFlowBlock_maximum_rule(bus1_storage_all_nonconvex_2)_: -+1 InvestmentFlowBlock_invest(bus1_storage_all_nonconvex_2) --30 InvestmentFlowBlock_invest_status(bus1_storage_all_nonconvex_2) +c_u_InvestmentFlowBlock_minimum_rule(bus1_storage_all_nonconvex_2)_: +-1 InvestmentFlowBlock_invest(bus1_storage_all_nonconvex_2) ++5 InvestmentFlowBlock_invest_status(bus1_storage_all_nonconvex_2) <= 0 c_u_InvestmentFlowBlock_maximum_rule(storage_all_nonconvex_bus1_0)_: @@ -113,24 +98,20 @@ c_u_InvestmentFlowBlock_maximum_rule(storage_all_nonconvex_bus1_2)_: -20 InvestmentFlowBlock_invest_status(storage_all_nonconvex_bus1_2) <= 0 -c_e_InvestmentFlowBlock_total_rule(bus1_storage_all_nonconvex_0)_: --1 InvestmentFlowBlock_invest(bus1_storage_all_nonconvex_0) -+1 InvestmentFlowBlock_total(bus1_storage_all_nonconvex_0) -= 0 +c_u_InvestmentFlowBlock_maximum_rule(bus1_storage_all_nonconvex_0)_: ++1 InvestmentFlowBlock_invest(bus1_storage_all_nonconvex_0) +-30 InvestmentFlowBlock_invest_status(bus1_storage_all_nonconvex_0) +<= 0 -c_e_InvestmentFlowBlock_total_rule(bus1_storage_all_nonconvex_1)_: --1 InvestmentFlowBlock_invest(bus1_storage_all_nonconvex_1) --1 InvestmentFlowBlock_total(bus1_storage_all_nonconvex_0) -+1 InvestmentFlowBlock_total(bus1_storage_all_nonconvex_1) -+1 InvestmentFlowBlock_old(bus1_storage_all_nonconvex_1) -= 0 +c_u_InvestmentFlowBlock_maximum_rule(bus1_storage_all_nonconvex_1)_: ++1 InvestmentFlowBlock_invest(bus1_storage_all_nonconvex_1) +-30 InvestmentFlowBlock_invest_status(bus1_storage_all_nonconvex_1) +<= 0 -c_e_InvestmentFlowBlock_total_rule(bus1_storage_all_nonconvex_2)_: --1 InvestmentFlowBlock_invest(bus1_storage_all_nonconvex_2) --1 InvestmentFlowBlock_total(bus1_storage_all_nonconvex_1) -+1 InvestmentFlowBlock_total(bus1_storage_all_nonconvex_2) -+1 InvestmentFlowBlock_old(bus1_storage_all_nonconvex_2) -= 0 +c_u_InvestmentFlowBlock_maximum_rule(bus1_storage_all_nonconvex_2)_: ++1 InvestmentFlowBlock_invest(bus1_storage_all_nonconvex_2) +-30 InvestmentFlowBlock_invest_status(bus1_storage_all_nonconvex_2) +<= 0 c_e_InvestmentFlowBlock_total_rule(storage_all_nonconvex_bus1_0)_: -1 InvestmentFlowBlock_invest(storage_all_nonconvex_bus1_0) @@ -151,16 +132,23 @@ c_e_InvestmentFlowBlock_total_rule(storage_all_nonconvex_bus1_2)_: +1 InvestmentFlowBlock_old(storage_all_nonconvex_bus1_2) = 0 -c_e_InvestmentFlowBlock_old_rule_end(bus1_storage_all_nonconvex_0)_: -+1 InvestmentFlowBlock_old_end(bus1_storage_all_nonconvex_0) +c_e_InvestmentFlowBlock_total_rule(bus1_storage_all_nonconvex_0)_: +-1 InvestmentFlowBlock_invest(bus1_storage_all_nonconvex_0) ++1 InvestmentFlowBlock_total(bus1_storage_all_nonconvex_0) = 0 -c_e_InvestmentFlowBlock_old_rule_end(bus1_storage_all_nonconvex_1)_: -+1 InvestmentFlowBlock_old_end(bus1_storage_all_nonconvex_1) +c_e_InvestmentFlowBlock_total_rule(bus1_storage_all_nonconvex_1)_: +-1 InvestmentFlowBlock_invest(bus1_storage_all_nonconvex_1) +-1 InvestmentFlowBlock_total(bus1_storage_all_nonconvex_0) ++1 InvestmentFlowBlock_total(bus1_storage_all_nonconvex_1) ++1 InvestmentFlowBlock_old(bus1_storage_all_nonconvex_1) = 0 -c_e_InvestmentFlowBlock_old_rule_end(bus1_storage_all_nonconvex_2)_: -+1 InvestmentFlowBlock_old_end(bus1_storage_all_nonconvex_2) +c_e_InvestmentFlowBlock_total_rule(bus1_storage_all_nonconvex_2)_: +-1 InvestmentFlowBlock_invest(bus1_storage_all_nonconvex_2) +-1 InvestmentFlowBlock_total(bus1_storage_all_nonconvex_1) ++1 InvestmentFlowBlock_total(bus1_storage_all_nonconvex_2) ++1 InvestmentFlowBlock_old(bus1_storage_all_nonconvex_2) = 0 c_e_InvestmentFlowBlock_old_rule_end(storage_all_nonconvex_bus1_0)_: @@ -175,16 +163,16 @@ c_e_InvestmentFlowBlock_old_rule_end(storage_all_nonconvex_bus1_2)_: +1 InvestmentFlowBlock_old_end(storage_all_nonconvex_bus1_2) = 0 -c_e_InvestmentFlowBlock_old_rule_exo(bus1_storage_all_nonconvex_0)_: -+1 InvestmentFlowBlock_old_exo(bus1_storage_all_nonconvex_0) +c_e_InvestmentFlowBlock_old_rule_end(bus1_storage_all_nonconvex_0)_: ++1 InvestmentFlowBlock_old_end(bus1_storage_all_nonconvex_0) = 0 -c_e_InvestmentFlowBlock_old_rule_exo(bus1_storage_all_nonconvex_1)_: -+1 InvestmentFlowBlock_old_exo(bus1_storage_all_nonconvex_1) +c_e_InvestmentFlowBlock_old_rule_end(bus1_storage_all_nonconvex_1)_: ++1 InvestmentFlowBlock_old_end(bus1_storage_all_nonconvex_1) = 0 -c_e_InvestmentFlowBlock_old_rule_exo(bus1_storage_all_nonconvex_2)_: -+1 InvestmentFlowBlock_old_exo(bus1_storage_all_nonconvex_2) +c_e_InvestmentFlowBlock_old_rule_end(bus1_storage_all_nonconvex_2)_: ++1 InvestmentFlowBlock_old_end(bus1_storage_all_nonconvex_2) = 0 c_e_InvestmentFlowBlock_old_rule_exo(storage_all_nonconvex_bus1_0)_: @@ -199,22 +187,16 @@ c_e_InvestmentFlowBlock_old_rule_exo(storage_all_nonconvex_bus1_2)_: +1 InvestmentFlowBlock_old_exo(storage_all_nonconvex_bus1_2) = 0 -c_e_InvestmentFlowBlock_old_rule(bus1_storage_all_nonconvex_0)_: --1 InvestmentFlowBlock_old_end(bus1_storage_all_nonconvex_0) --1 InvestmentFlowBlock_old_exo(bus1_storage_all_nonconvex_0) -+1 InvestmentFlowBlock_old(bus1_storage_all_nonconvex_0) +c_e_InvestmentFlowBlock_old_rule_exo(bus1_storage_all_nonconvex_0)_: ++1 InvestmentFlowBlock_old_exo(bus1_storage_all_nonconvex_0) = 0 -c_e_InvestmentFlowBlock_old_rule(bus1_storage_all_nonconvex_1)_: -+1 InvestmentFlowBlock_old(bus1_storage_all_nonconvex_1) --1 InvestmentFlowBlock_old_end(bus1_storage_all_nonconvex_1) --1 InvestmentFlowBlock_old_exo(bus1_storage_all_nonconvex_1) +c_e_InvestmentFlowBlock_old_rule_exo(bus1_storage_all_nonconvex_1)_: ++1 InvestmentFlowBlock_old_exo(bus1_storage_all_nonconvex_1) = 0 -c_e_InvestmentFlowBlock_old_rule(bus1_storage_all_nonconvex_2)_: -+1 InvestmentFlowBlock_old(bus1_storage_all_nonconvex_2) --1 InvestmentFlowBlock_old_end(bus1_storage_all_nonconvex_2) --1 InvestmentFlowBlock_old_exo(bus1_storage_all_nonconvex_2) +c_e_InvestmentFlowBlock_old_rule_exo(bus1_storage_all_nonconvex_2)_: ++1 InvestmentFlowBlock_old_exo(bus1_storage_all_nonconvex_2) = 0 c_e_InvestmentFlowBlock_old_rule(storage_all_nonconvex_bus1_0)_: @@ -235,35 +217,23 @@ c_e_InvestmentFlowBlock_old_rule(storage_all_nonconvex_bus1_2)_: -1 InvestmentFlowBlock_old_exo(storage_all_nonconvex_bus1_2) = 0 -c_u_InvestmentFlowBlock_max(bus1_storage_all_nonconvex_0_0)_: -+1 flow(bus1_storage_all_nonconvex_0_0) --1 InvestmentFlowBlock_total(bus1_storage_all_nonconvex_0) -<= 0 - -c_u_InvestmentFlowBlock_max(bus1_storage_all_nonconvex_0_1)_: -+1 flow(bus1_storage_all_nonconvex_0_1) --1 InvestmentFlowBlock_total(bus1_storage_all_nonconvex_0) -<= 0 - -c_u_InvestmentFlowBlock_max(bus1_storage_all_nonconvex_1_2)_: -+1 flow(bus1_storage_all_nonconvex_1_2) --1 InvestmentFlowBlock_total(bus1_storage_all_nonconvex_1) -<= 0 - -c_u_InvestmentFlowBlock_max(bus1_storage_all_nonconvex_1_3)_: -+1 flow(bus1_storage_all_nonconvex_1_3) --1 InvestmentFlowBlock_total(bus1_storage_all_nonconvex_1) -<= 0 +c_e_InvestmentFlowBlock_old_rule(bus1_storage_all_nonconvex_0)_: +-1 InvestmentFlowBlock_old_end(bus1_storage_all_nonconvex_0) +-1 InvestmentFlowBlock_old_exo(bus1_storage_all_nonconvex_0) ++1 InvestmentFlowBlock_old(bus1_storage_all_nonconvex_0) += 0 -c_u_InvestmentFlowBlock_max(bus1_storage_all_nonconvex_2_4)_: -+1 flow(bus1_storage_all_nonconvex_2_4) --1 InvestmentFlowBlock_total(bus1_storage_all_nonconvex_2) -<= 0 +c_e_InvestmentFlowBlock_old_rule(bus1_storage_all_nonconvex_1)_: ++1 InvestmentFlowBlock_old(bus1_storage_all_nonconvex_1) +-1 InvestmentFlowBlock_old_end(bus1_storage_all_nonconvex_1) +-1 InvestmentFlowBlock_old_exo(bus1_storage_all_nonconvex_1) += 0 -c_u_InvestmentFlowBlock_max(bus1_storage_all_nonconvex_2_5)_: -+1 flow(bus1_storage_all_nonconvex_2_5) --1 InvestmentFlowBlock_total(bus1_storage_all_nonconvex_2) -<= 0 +c_e_InvestmentFlowBlock_old_rule(bus1_storage_all_nonconvex_2)_: ++1 InvestmentFlowBlock_old(bus1_storage_all_nonconvex_2) +-1 InvestmentFlowBlock_old_end(bus1_storage_all_nonconvex_2) +-1 InvestmentFlowBlock_old_exo(bus1_storage_all_nonconvex_2) += 0 c_u_InvestmentFlowBlock_max(storage_all_nonconvex_bus1_0_0)_: +1 flow(storage_all_nonconvex_bus1_0_0) @@ -295,6 +265,36 @@ c_u_InvestmentFlowBlock_max(storage_all_nonconvex_bus1_2_5)_: -1 InvestmentFlowBlock_total(storage_all_nonconvex_bus1_2) <= 0 +c_u_InvestmentFlowBlock_max(bus1_storage_all_nonconvex_0_0)_: ++1 flow(bus1_storage_all_nonconvex_0_0) +-1 InvestmentFlowBlock_total(bus1_storage_all_nonconvex_0) +<= 0 + +c_u_InvestmentFlowBlock_max(bus1_storage_all_nonconvex_0_1)_: ++1 flow(bus1_storage_all_nonconvex_0_1) +-1 InvestmentFlowBlock_total(bus1_storage_all_nonconvex_0) +<= 0 + +c_u_InvestmentFlowBlock_max(bus1_storage_all_nonconvex_1_2)_: ++1 flow(bus1_storage_all_nonconvex_1_2) +-1 InvestmentFlowBlock_total(bus1_storage_all_nonconvex_1) +<= 0 + +c_u_InvestmentFlowBlock_max(bus1_storage_all_nonconvex_1_3)_: ++1 flow(bus1_storage_all_nonconvex_1_3) +-1 InvestmentFlowBlock_total(bus1_storage_all_nonconvex_1) +<= 0 + +c_u_InvestmentFlowBlock_max(bus1_storage_all_nonconvex_2_4)_: ++1 flow(bus1_storage_all_nonconvex_2_4) +-1 InvestmentFlowBlock_total(bus1_storage_all_nonconvex_2) +<= 0 + +c_u_InvestmentFlowBlock_max(bus1_storage_all_nonconvex_2_5)_: ++1 flow(bus1_storage_all_nonconvex_2_5) +-1 InvestmentFlowBlock_total(bus1_storage_all_nonconvex_2) +<= 0 + c_e_GenericInvestmentStorageBlock_total_storage_rule(storage_all_nonconvex_0)_: -1 GenericInvestmentStorageBlock_invest(storage_all_nonconvex_0) +1 GenericInvestmentStorageBlock_total(storage_all_nonconvex_0) @@ -456,18 +456,18 @@ c_l_GenericInvestmentStorageBlock_limit_min(storage_all_nonconvex_2)_: >= 0 bounds - 0 <= InvestmentFlowBlock_invest(bus1_storage_all_nonconvex_0) <= 30 - 0 <= InvestmentFlowBlock_invest_status(bus1_storage_all_nonconvex_0) <= 1 - 0 <= InvestmentFlowBlock_invest(bus1_storage_all_nonconvex_1) <= 30 - 0 <= InvestmentFlowBlock_invest_status(bus1_storage_all_nonconvex_1) <= 1 - 0 <= InvestmentFlowBlock_invest(bus1_storage_all_nonconvex_2) <= 30 - 0 <= InvestmentFlowBlock_invest_status(bus1_storage_all_nonconvex_2) <= 1 0 <= InvestmentFlowBlock_invest(storage_all_nonconvex_bus1_0) <= 20 0 <= InvestmentFlowBlock_invest_status(storage_all_nonconvex_bus1_0) <= 1 0 <= InvestmentFlowBlock_invest(storage_all_nonconvex_bus1_1) <= 20 0 <= InvestmentFlowBlock_invest_status(storage_all_nonconvex_bus1_1) <= 1 0 <= InvestmentFlowBlock_invest(storage_all_nonconvex_bus1_2) <= 20 0 <= InvestmentFlowBlock_invest_status(storage_all_nonconvex_bus1_2) <= 1 + 0 <= InvestmentFlowBlock_invest(bus1_storage_all_nonconvex_0) <= 30 + 0 <= InvestmentFlowBlock_invest_status(bus1_storage_all_nonconvex_0) <= 1 + 0 <= InvestmentFlowBlock_invest(bus1_storage_all_nonconvex_1) <= 30 + 0 <= InvestmentFlowBlock_invest_status(bus1_storage_all_nonconvex_1) <= 1 + 0 <= InvestmentFlowBlock_invest(bus1_storage_all_nonconvex_2) <= 30 + 0 <= InvestmentFlowBlock_invest_status(bus1_storage_all_nonconvex_2) <= 1 0 <= GenericInvestmentStorageBlock_invest(storage_all_nonconvex_0) <= 100 0 <= GenericInvestmentStorageBlock_invest_status(storage_all_nonconvex_0) <= 1 0 <= GenericInvestmentStorageBlock_invest(storage_all_nonconvex_1) <= 100 @@ -486,30 +486,30 @@ bounds 0 <= flow(bus1_storage_all_nonconvex_2_4) <= +inf 0 <= flow(storage_all_nonconvex_bus1_2_5) <= +inf 0 <= flow(bus1_storage_all_nonconvex_2_5) <= +inf - 0 <= InvestmentFlowBlock_total(bus1_storage_all_nonconvex_0) <= +inf - 0 <= InvestmentFlowBlock_total(bus1_storage_all_nonconvex_1) <= +inf - 0 <= InvestmentFlowBlock_old(bus1_storage_all_nonconvex_1) <= +inf - 0 <= InvestmentFlowBlock_total(bus1_storage_all_nonconvex_2) <= +inf - 0 <= InvestmentFlowBlock_old(bus1_storage_all_nonconvex_2) <= +inf 0 <= InvestmentFlowBlock_total(storage_all_nonconvex_bus1_0) <= +inf 0 <= InvestmentFlowBlock_total(storage_all_nonconvex_bus1_1) <= +inf 0 <= InvestmentFlowBlock_old(storage_all_nonconvex_bus1_1) <= +inf 0 <= InvestmentFlowBlock_total(storage_all_nonconvex_bus1_2) <= +inf 0 <= InvestmentFlowBlock_old(storage_all_nonconvex_bus1_2) <= +inf - 0 <= InvestmentFlowBlock_old_end(bus1_storage_all_nonconvex_0) <= +inf - 0 <= InvestmentFlowBlock_old_end(bus1_storage_all_nonconvex_1) <= +inf - 0 <= InvestmentFlowBlock_old_end(bus1_storage_all_nonconvex_2) <= +inf + 0 <= InvestmentFlowBlock_total(bus1_storage_all_nonconvex_0) <= +inf + 0 <= InvestmentFlowBlock_total(bus1_storage_all_nonconvex_1) <= +inf + 0 <= InvestmentFlowBlock_old(bus1_storage_all_nonconvex_1) <= +inf + 0 <= InvestmentFlowBlock_total(bus1_storage_all_nonconvex_2) <= +inf + 0 <= InvestmentFlowBlock_old(bus1_storage_all_nonconvex_2) <= +inf 0 <= InvestmentFlowBlock_old_end(storage_all_nonconvex_bus1_0) <= +inf 0 <= InvestmentFlowBlock_old_end(storage_all_nonconvex_bus1_1) <= +inf 0 <= InvestmentFlowBlock_old_end(storage_all_nonconvex_bus1_2) <= +inf - 0 <= InvestmentFlowBlock_old_exo(bus1_storage_all_nonconvex_0) <= +inf - 0 <= InvestmentFlowBlock_old_exo(bus1_storage_all_nonconvex_1) <= +inf - 0 <= InvestmentFlowBlock_old_exo(bus1_storage_all_nonconvex_2) <= +inf + 0 <= InvestmentFlowBlock_old_end(bus1_storage_all_nonconvex_0) <= +inf + 0 <= InvestmentFlowBlock_old_end(bus1_storage_all_nonconvex_1) <= +inf + 0 <= InvestmentFlowBlock_old_end(bus1_storage_all_nonconvex_2) <= +inf 0 <= InvestmentFlowBlock_old_exo(storage_all_nonconvex_bus1_0) <= +inf 0 <= InvestmentFlowBlock_old_exo(storage_all_nonconvex_bus1_1) <= +inf 0 <= InvestmentFlowBlock_old_exo(storage_all_nonconvex_bus1_2) <= +inf - 0 <= InvestmentFlowBlock_old(bus1_storage_all_nonconvex_0) <= +inf + 0 <= InvestmentFlowBlock_old_exo(bus1_storage_all_nonconvex_0) <= +inf + 0 <= InvestmentFlowBlock_old_exo(bus1_storage_all_nonconvex_1) <= +inf + 0 <= InvestmentFlowBlock_old_exo(bus1_storage_all_nonconvex_2) <= +inf 0 <= InvestmentFlowBlock_old(storage_all_nonconvex_bus1_0) <= +inf + 0 <= InvestmentFlowBlock_old(bus1_storage_all_nonconvex_0) <= +inf 0 <= GenericInvestmentStorageBlock_total(storage_all_nonconvex_0) <= +inf 0 <= GenericInvestmentStorageBlock_total(storage_all_nonconvex_1) <= +inf 0 <= GenericInvestmentStorageBlock_old(storage_all_nonconvex_1) <= +inf @@ -529,12 +529,12 @@ bounds 0 <= GenericInvestmentStorageBlock_storage_content(storage_all_nonconvex_4) <= +inf 0 <= GenericInvestmentStorageBlock_storage_content(storage_all_nonconvex_5) <= +inf binary - InvestmentFlowBlock_invest_status(bus1_storage_all_nonconvex_0) - InvestmentFlowBlock_invest_status(bus1_storage_all_nonconvex_1) - InvestmentFlowBlock_invest_status(bus1_storage_all_nonconvex_2) InvestmentFlowBlock_invest_status(storage_all_nonconvex_bus1_0) InvestmentFlowBlock_invest_status(storage_all_nonconvex_bus1_1) InvestmentFlowBlock_invest_status(storage_all_nonconvex_bus1_2) + InvestmentFlowBlock_invest_status(bus1_storage_all_nonconvex_0) + InvestmentFlowBlock_invest_status(bus1_storage_all_nonconvex_1) + InvestmentFlowBlock_invest_status(bus1_storage_all_nonconvex_2) GenericInvestmentStorageBlock_invest_status(storage_all_nonconvex_0) GenericInvestmentStorageBlock_invest_status(storage_all_nonconvex_1) GenericInvestmentStorageBlock_invest_status(storage_all_nonconvex_2) diff --git a/tests/lp_files/storage_invest_minimum_multi_period.lp b/tests/lp_files/storage_invest_minimum_multi_period.lp index 76e8aa662..c61a64544 100644 --- a/tests/lp_files/storage_invest_minimum_multi_period.lp +++ b/tests/lp_files/storage_invest_minimum_multi_period.lp @@ -2,9 +2,9 @@ min objective: -+212.02333722461535 GenericInvestmentStorageBlock_invest(storage1_0) -+207.8660168868778 GenericInvestmentStorageBlock_invest(storage1_1) -+203.7902126341939 GenericInvestmentStorageBlock_invest(storage1_2) ++15.2862638908257 GenericInvestmentStorageBlock_invest(storage1_0) ++10.089613468653715 GenericInvestmentStorageBlock_invest(storage1_1) ++4.994858152798875 GenericInvestmentStorageBlock_invest(storage1_2) s.t. diff --git a/tests/lp_files/storage_invest_multi_period.lp b/tests/lp_files/storage_invest_multi_period.lp index 228aadf96..49c4f5e84 100644 --- a/tests/lp_files/storage_invest_multi_period.lp +++ b/tests/lp_files/storage_invest_multi_period.lp @@ -3,9 +3,9 @@ min objective: +250.0 ONE_VAR_CONSTANT -+351.53628135238 GenericInvestmentStorageBlock_invest(storage1_0) -+341.9615033610845 GenericInvestmentStorageBlock_invest(storage1_1) -+332.6786079381219 GenericInvestmentStorageBlock_invest(storage1_2) ++29.99406858132935 GenericInvestmentStorageBlock_invest(storage1_0) ++19.60706904757886 GenericInvestmentStorageBlock_invest(storage1_1) ++9.614085282931445 GenericInvestmentStorageBlock_invest(storage1_2) s.t. diff --git a/tests/lp_files/storage_invest_with_offset_multi_period.lp b/tests/lp_files/storage_invest_with_offset_multi_period.lp index 9fb9d7680..0391a3236 100644 --- a/tests/lp_files/storage_invest_with_offset_multi_period.lp +++ b/tests/lp_files/storage_invest_with_offset_multi_period.lp @@ -14,11 +14,11 @@ objective: +23.52941176470588 flow(storage_non_convex_electricityBus_1_3) +23.06805074971165 flow(storage_non_convex_electricityBus_2_4) +23.06805074971165 flow(storage_non_convex_electricityBus_2_5) -+177.35448256334197 GenericInvestmentStorageBlock_invest(storage_non_convex_0) ++25.57348127967623 GenericInvestmentStorageBlock_invest(storage_non_convex_0) +5 GenericInvestmentStorageBlock_invest_status(storage_non_convex_0) -+173.87694368955096 GenericInvestmentStorageBlock_invest(storage_non_convex_1) ++16.879634095198618 GenericInvestmentStorageBlock_invest(storage_non_convex_1) +4.901960784313725 GenericInvestmentStorageBlock_invest_status(storage_non_convex_1) -+170.46759185250093 GenericInvestmentStorageBlock_invest(storage_non_convex_2) ++8.35625450257358 GenericInvestmentStorageBlock_invest(storage_non_convex_2) +4.805843906189927 GenericInvestmentStorageBlock_invest_status(storage_non_convex_2) s.t. @@ -53,25 +53,6 @@ c_e_BusBlock_balance(electricityBus_2_5)_: +1 flow(storage_non_convex_electricityBus_2_5) = 0 -c_e_InvestmentFlowBlock_total_rule(storage_non_convex_electricityBus_0)_: -+1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_0) --1 InvestmentFlowBlock_invest(storage_non_convex_electricityBus_0) -= 0 - -c_e_InvestmentFlowBlock_total_rule(storage_non_convex_electricityBus_1)_: --1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_0) -+1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_1) --1 InvestmentFlowBlock_invest(storage_non_convex_electricityBus_1) -+1 InvestmentFlowBlock_old(storage_non_convex_electricityBus_1) -= 0 - -c_e_InvestmentFlowBlock_total_rule(storage_non_convex_electricityBus_2)_: --1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_1) -+1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_2) --1 InvestmentFlowBlock_invest(storage_non_convex_electricityBus_2) -+1 InvestmentFlowBlock_old(storage_non_convex_electricityBus_2) -= 0 - c_e_InvestmentFlowBlock_total_rule(electricityBus_storage_non_convex_0)_: +1 InvestmentFlowBlock_total(electricityBus_storage_non_convex_0) -1 InvestmentFlowBlock_invest(electricityBus_storage_non_convex_0) @@ -91,16 +72,23 @@ c_e_InvestmentFlowBlock_total_rule(electricityBus_storage_non_convex_2)_: +1 InvestmentFlowBlock_old(electricityBus_storage_non_convex_2) = 0 -c_e_InvestmentFlowBlock_old_rule_end(storage_non_convex_electricityBus_0)_: -+1 InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_0) +c_e_InvestmentFlowBlock_total_rule(storage_non_convex_electricityBus_0)_: ++1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_0) +-1 InvestmentFlowBlock_invest(storage_non_convex_electricityBus_0) = 0 -c_e_InvestmentFlowBlock_old_rule_end(storage_non_convex_electricityBus_1)_: -+1 InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_1) +c_e_InvestmentFlowBlock_total_rule(storage_non_convex_electricityBus_1)_: +-1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_0) ++1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_1) +-1 InvestmentFlowBlock_invest(storage_non_convex_electricityBus_1) ++1 InvestmentFlowBlock_old(storage_non_convex_electricityBus_1) = 0 -c_e_InvestmentFlowBlock_old_rule_end(storage_non_convex_electricityBus_2)_: -+1 InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_2) +c_e_InvestmentFlowBlock_total_rule(storage_non_convex_electricityBus_2)_: +-1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_1) ++1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_2) +-1 InvestmentFlowBlock_invest(storage_non_convex_electricityBus_2) ++1 InvestmentFlowBlock_old(storage_non_convex_electricityBus_2) = 0 c_e_InvestmentFlowBlock_old_rule_end(electricityBus_storage_non_convex_0)_: @@ -115,16 +103,16 @@ c_e_InvestmentFlowBlock_old_rule_end(electricityBus_storage_non_convex_2)_: +1 InvestmentFlowBlock_old_end(electricityBus_storage_non_convex_2) = 0 -c_e_InvestmentFlowBlock_old_rule_exo(storage_non_convex_electricityBus_0)_: -+1 InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_0) +c_e_InvestmentFlowBlock_old_rule_end(storage_non_convex_electricityBus_0)_: ++1 InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_0) = 0 -c_e_InvestmentFlowBlock_old_rule_exo(storage_non_convex_electricityBus_1)_: -+1 InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_1) +c_e_InvestmentFlowBlock_old_rule_end(storage_non_convex_electricityBus_1)_: ++1 InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_1) = 0 -c_e_InvestmentFlowBlock_old_rule_exo(storage_non_convex_electricityBus_2)_: -+1 InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_2) +c_e_InvestmentFlowBlock_old_rule_end(storage_non_convex_electricityBus_2)_: ++1 InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_2) = 0 c_e_InvestmentFlowBlock_old_rule_exo(electricityBus_storage_non_convex_0)_: @@ -139,22 +127,16 @@ c_e_InvestmentFlowBlock_old_rule_exo(electricityBus_storage_non_convex_2)_: +1 InvestmentFlowBlock_old_exo(electricityBus_storage_non_convex_2) = 0 -c_e_InvestmentFlowBlock_old_rule(storage_non_convex_electricityBus_0)_: --1 InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_0) --1 InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_0) -+1 InvestmentFlowBlock_old(storage_non_convex_electricityBus_0) +c_e_InvestmentFlowBlock_old_rule_exo(storage_non_convex_electricityBus_0)_: ++1 InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_0) = 0 -c_e_InvestmentFlowBlock_old_rule(storage_non_convex_electricityBus_1)_: -+1 InvestmentFlowBlock_old(storage_non_convex_electricityBus_1) --1 InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_1) --1 InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_1) +c_e_InvestmentFlowBlock_old_rule_exo(storage_non_convex_electricityBus_1)_: ++1 InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_1) = 0 -c_e_InvestmentFlowBlock_old_rule(storage_non_convex_electricityBus_2)_: -+1 InvestmentFlowBlock_old(storage_non_convex_electricityBus_2) --1 InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_2) --1 InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_2) +c_e_InvestmentFlowBlock_old_rule_exo(storage_non_convex_electricityBus_2)_: ++1 InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_2) = 0 c_e_InvestmentFlowBlock_old_rule(electricityBus_storage_non_convex_0)_: @@ -175,35 +157,23 @@ c_e_InvestmentFlowBlock_old_rule(electricityBus_storage_non_convex_2)_: -1 InvestmentFlowBlock_old_exo(electricityBus_storage_non_convex_2) = 0 -c_u_InvestmentFlowBlock_max(storage_non_convex_electricityBus_0_0)_: -+1 flow(storage_non_convex_electricityBus_0_0) --1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_0) -<= 0 - -c_u_InvestmentFlowBlock_max(storage_non_convex_electricityBus_0_1)_: -+1 flow(storage_non_convex_electricityBus_0_1) --1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_0) -<= 0 - -c_u_InvestmentFlowBlock_max(storage_non_convex_electricityBus_1_2)_: -+1 flow(storage_non_convex_electricityBus_1_2) --1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_1) -<= 0 - -c_u_InvestmentFlowBlock_max(storage_non_convex_electricityBus_1_3)_: -+1 flow(storage_non_convex_electricityBus_1_3) --1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_1) -<= 0 +c_e_InvestmentFlowBlock_old_rule(storage_non_convex_electricityBus_0)_: +-1 InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_0) +-1 InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_0) ++1 InvestmentFlowBlock_old(storage_non_convex_electricityBus_0) += 0 -c_u_InvestmentFlowBlock_max(storage_non_convex_electricityBus_2_4)_: -+1 flow(storage_non_convex_electricityBus_2_4) --1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_2) -<= 0 +c_e_InvestmentFlowBlock_old_rule(storage_non_convex_electricityBus_1)_: ++1 InvestmentFlowBlock_old(storage_non_convex_electricityBus_1) +-1 InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_1) +-1 InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_1) += 0 -c_u_InvestmentFlowBlock_max(storage_non_convex_electricityBus_2_5)_: -+1 flow(storage_non_convex_electricityBus_2_5) --1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_2) -<= 0 +c_e_InvestmentFlowBlock_old_rule(storage_non_convex_electricityBus_2)_: ++1 InvestmentFlowBlock_old(storage_non_convex_electricityBus_2) +-1 InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_2) +-1 InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_2) += 0 c_u_InvestmentFlowBlock_max(electricityBus_storage_non_convex_0_0)_: +1 flow(electricityBus_storage_non_convex_0_0) @@ -235,6 +205,36 @@ c_u_InvestmentFlowBlock_max(electricityBus_storage_non_convex_2_5)_: -1 InvestmentFlowBlock_total(electricityBus_storage_non_convex_2) <= 0 +c_u_InvestmentFlowBlock_max(storage_non_convex_electricityBus_0_0)_: ++1 flow(storage_non_convex_electricityBus_0_0) +-1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_0) +<= 0 + +c_u_InvestmentFlowBlock_max(storage_non_convex_electricityBus_0_1)_: ++1 flow(storage_non_convex_electricityBus_0_1) +-1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_0) +<= 0 + +c_u_InvestmentFlowBlock_max(storage_non_convex_electricityBus_1_2)_: ++1 flow(storage_non_convex_electricityBus_1_2) +-1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_1) +<= 0 + +c_u_InvestmentFlowBlock_max(storage_non_convex_electricityBus_1_3)_: ++1 flow(storage_non_convex_electricityBus_1_3) +-1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_1) +<= 0 + +c_u_InvestmentFlowBlock_max(storage_non_convex_electricityBus_2_4)_: ++1 flow(storage_non_convex_electricityBus_2_4) +-1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_2) +<= 0 + +c_u_InvestmentFlowBlock_max(storage_non_convex_electricityBus_2_5)_: ++1 flow(storage_non_convex_electricityBus_2_5) +-1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_2) +<= 0 + c_e_GenericInvestmentStorageBlock_total_storage_rule(storage_non_convex_0)_: -1 GenericInvestmentStorageBlock_invest(storage_non_convex_0) +1 GenericInvestmentStorageBlock_total(storage_non_convex_0) @@ -474,14 +474,6 @@ bounds 0 <= GenericInvestmentStorageBlock_invest_status(storage_non_convex_1) <= 1 0 <= GenericInvestmentStorageBlock_invest(storage_non_convex_2) <= 1454 0 <= GenericInvestmentStorageBlock_invest_status(storage_non_convex_2) <= 1 - 0 <= InvestmentFlowBlock_total(storage_non_convex_electricityBus_0) <= +inf - 0 <= InvestmentFlowBlock_invest(storage_non_convex_electricityBus_0) <= +inf - 0 <= InvestmentFlowBlock_total(storage_non_convex_electricityBus_1) <= +inf - 0 <= InvestmentFlowBlock_invest(storage_non_convex_electricityBus_1) <= +inf - 0 <= InvestmentFlowBlock_old(storage_non_convex_electricityBus_1) <= +inf - 0 <= InvestmentFlowBlock_total(storage_non_convex_electricityBus_2) <= +inf - 0 <= InvestmentFlowBlock_invest(storage_non_convex_electricityBus_2) <= +inf - 0 <= InvestmentFlowBlock_old(storage_non_convex_electricityBus_2) <= +inf 0 <= InvestmentFlowBlock_total(electricityBus_storage_non_convex_0) <= +inf 0 <= InvestmentFlowBlock_invest(electricityBus_storage_non_convex_0) <= +inf 0 <= InvestmentFlowBlock_total(electricityBus_storage_non_convex_1) <= +inf @@ -490,20 +482,28 @@ bounds 0 <= InvestmentFlowBlock_total(electricityBus_storage_non_convex_2) <= +inf 0 <= InvestmentFlowBlock_invest(electricityBus_storage_non_convex_2) <= +inf 0 <= InvestmentFlowBlock_old(electricityBus_storage_non_convex_2) <= +inf - 0 <= InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_0) <= +inf - 0 <= InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_1) <= +inf - 0 <= InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_2) <= +inf + 0 <= InvestmentFlowBlock_total(storage_non_convex_electricityBus_0) <= +inf + 0 <= InvestmentFlowBlock_invest(storage_non_convex_electricityBus_0) <= +inf + 0 <= InvestmentFlowBlock_total(storage_non_convex_electricityBus_1) <= +inf + 0 <= InvestmentFlowBlock_invest(storage_non_convex_electricityBus_1) <= +inf + 0 <= InvestmentFlowBlock_old(storage_non_convex_electricityBus_1) <= +inf + 0 <= InvestmentFlowBlock_total(storage_non_convex_electricityBus_2) <= +inf + 0 <= InvestmentFlowBlock_invest(storage_non_convex_electricityBus_2) <= +inf + 0 <= InvestmentFlowBlock_old(storage_non_convex_electricityBus_2) <= +inf 0 <= InvestmentFlowBlock_old_end(electricityBus_storage_non_convex_0) <= +inf 0 <= InvestmentFlowBlock_old_end(electricityBus_storage_non_convex_1) <= +inf 0 <= InvestmentFlowBlock_old_end(electricityBus_storage_non_convex_2) <= +inf - 0 <= InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_0) <= +inf - 0 <= InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_1) <= +inf - 0 <= InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_2) <= +inf + 0 <= InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_0) <= +inf + 0 <= InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_1) <= +inf + 0 <= InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_2) <= +inf 0 <= InvestmentFlowBlock_old_exo(electricityBus_storage_non_convex_0) <= +inf 0 <= InvestmentFlowBlock_old_exo(electricityBus_storage_non_convex_1) <= +inf 0 <= InvestmentFlowBlock_old_exo(electricityBus_storage_non_convex_2) <= +inf - 0 <= InvestmentFlowBlock_old(storage_non_convex_electricityBus_0) <= +inf + 0 <= InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_0) <= +inf + 0 <= InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_1) <= +inf + 0 <= InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_2) <= +inf 0 <= InvestmentFlowBlock_old(electricityBus_storage_non_convex_0) <= +inf + 0 <= InvestmentFlowBlock_old(storage_non_convex_electricityBus_0) <= +inf 0 <= GenericInvestmentStorageBlock_total(storage_non_convex_0) <= +inf 0 <= GenericInvestmentStorageBlock_total(storage_non_convex_1) <= +inf 0 <= GenericInvestmentStorageBlock_old(storage_non_convex_1) <= +inf diff --git a/tests/lp_files/storage_invest_with_offset_multi_period_remaining_value.lp b/tests/lp_files/storage_invest_with_offset_multi_period_remaining_value.lp new file mode 100644 index 000000000..9347789d9 --- /dev/null +++ b/tests/lp_files/storage_invest_with_offset_multi_period_remaining_value.lp @@ -0,0 +1,529 @@ +\* Source Pyomo model name=Model *\ + +min +objective: ++56 flow(electricityBus_storage_non_convex_0_0) ++56 flow(electricityBus_storage_non_convex_0_1) ++54.90196078431372 flow(electricityBus_storage_non_convex_1_2) ++54.90196078431372 flow(electricityBus_storage_non_convex_1_3) ++53.82545174932718 flow(electricityBus_storage_non_convex_2_4) ++53.82545174932718 flow(electricityBus_storage_non_convex_2_5) ++24 flow(storage_non_convex_electricityBus_0_0) ++24 flow(storage_non_convex_electricityBus_0_1) ++23.52941176470588 flow(storage_non_convex_electricityBus_1_2) ++23.52941176470588 flow(storage_non_convex_electricityBus_1_3) ++23.06805074971165 flow(storage_non_convex_electricityBus_2_4) ++23.06805074971165 flow(storage_non_convex_electricityBus_2_5) ++25.57348127967623 GenericInvestmentStorageBlock_invest(storage_non_convex_0) ++5 GenericInvestmentStorageBlock_invest_status(storage_non_convex_0) ++16.879634095198618 GenericInvestmentStorageBlock_invest(storage_non_convex_1) ++4.901960784313725 GenericInvestmentStorageBlock_invest_status(storage_non_convex_1) ++8.35625450257358 GenericInvestmentStorageBlock_invest(storage_non_convex_2) ++4.805843906189927 GenericInvestmentStorageBlock_invest_status(storage_non_convex_2) + +s.t. + +c_e_BusBlock_balance(electricityBus_0_0)_: +-1 flow(electricityBus_storage_non_convex_0_0) ++1 flow(storage_non_convex_electricityBus_0_0) += 0 + +c_e_BusBlock_balance(electricityBus_0_1)_: +-1 flow(electricityBus_storage_non_convex_0_1) ++1 flow(storage_non_convex_electricityBus_0_1) += 0 + +c_e_BusBlock_balance(electricityBus_1_2)_: +-1 flow(electricityBus_storage_non_convex_1_2) ++1 flow(storage_non_convex_electricityBus_1_2) += 0 + +c_e_BusBlock_balance(electricityBus_1_3)_: +-1 flow(electricityBus_storage_non_convex_1_3) ++1 flow(storage_non_convex_electricityBus_1_3) += 0 + +c_e_BusBlock_balance(electricityBus_2_4)_: +-1 flow(electricityBus_storage_non_convex_2_4) ++1 flow(storage_non_convex_electricityBus_2_4) += 0 + +c_e_BusBlock_balance(electricityBus_2_5)_: +-1 flow(electricityBus_storage_non_convex_2_5) ++1 flow(storage_non_convex_electricityBus_2_5) += 0 + +c_e_InvestmentFlowBlock_total_rule(storage_non_convex_electricityBus_0)_: ++1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_0) +-1 InvestmentFlowBlock_invest(storage_non_convex_electricityBus_0) += 0 + +c_e_InvestmentFlowBlock_total_rule(storage_non_convex_electricityBus_1)_: +-1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_0) ++1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_1) +-1 InvestmentFlowBlock_invest(storage_non_convex_electricityBus_1) ++1 InvestmentFlowBlock_old(storage_non_convex_electricityBus_1) += 0 + +c_e_InvestmentFlowBlock_total_rule(storage_non_convex_electricityBus_2)_: +-1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_1) ++1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_2) +-1 InvestmentFlowBlock_invest(storage_non_convex_electricityBus_2) ++1 InvestmentFlowBlock_old(storage_non_convex_electricityBus_2) += 0 + +c_e_InvestmentFlowBlock_total_rule(electricityBus_storage_non_convex_0)_: ++1 InvestmentFlowBlock_total(electricityBus_storage_non_convex_0) +-1 InvestmentFlowBlock_invest(electricityBus_storage_non_convex_0) += 0 + +c_e_InvestmentFlowBlock_total_rule(electricityBus_storage_non_convex_1)_: +-1 InvestmentFlowBlock_total(electricityBus_storage_non_convex_0) ++1 InvestmentFlowBlock_total(electricityBus_storage_non_convex_1) +-1 InvestmentFlowBlock_invest(electricityBus_storage_non_convex_1) ++1 InvestmentFlowBlock_old(electricityBus_storage_non_convex_1) += 0 + +c_e_InvestmentFlowBlock_total_rule(electricityBus_storage_non_convex_2)_: +-1 InvestmentFlowBlock_total(electricityBus_storage_non_convex_1) ++1 InvestmentFlowBlock_total(electricityBus_storage_non_convex_2) +-1 InvestmentFlowBlock_invest(electricityBus_storage_non_convex_2) ++1 InvestmentFlowBlock_old(electricityBus_storage_non_convex_2) += 0 + +c_e_InvestmentFlowBlock_old_rule_end(storage_non_convex_electricityBus_0)_: ++1 InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_0) += 0 + +c_e_InvestmentFlowBlock_old_rule_end(storage_non_convex_electricityBus_1)_: ++1 InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_1) += 0 + +c_e_InvestmentFlowBlock_old_rule_end(storage_non_convex_electricityBus_2)_: ++1 InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_2) += 0 + +c_e_InvestmentFlowBlock_old_rule_end(electricityBus_storage_non_convex_0)_: ++1 InvestmentFlowBlock_old_end(electricityBus_storage_non_convex_0) += 0 + +c_e_InvestmentFlowBlock_old_rule_end(electricityBus_storage_non_convex_1)_: ++1 InvestmentFlowBlock_old_end(electricityBus_storage_non_convex_1) += 0 + +c_e_InvestmentFlowBlock_old_rule_end(electricityBus_storage_non_convex_2)_: ++1 InvestmentFlowBlock_old_end(electricityBus_storage_non_convex_2) += 0 + +c_e_InvestmentFlowBlock_old_rule_exo(storage_non_convex_electricityBus_0)_: ++1 InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_0) += 0 + +c_e_InvestmentFlowBlock_old_rule_exo(storage_non_convex_electricityBus_1)_: ++1 InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_1) += 0 + +c_e_InvestmentFlowBlock_old_rule_exo(storage_non_convex_electricityBus_2)_: ++1 InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_2) += 0 + +c_e_InvestmentFlowBlock_old_rule_exo(electricityBus_storage_non_convex_0)_: ++1 InvestmentFlowBlock_old_exo(electricityBus_storage_non_convex_0) += 0 + +c_e_InvestmentFlowBlock_old_rule_exo(electricityBus_storage_non_convex_1)_: ++1 InvestmentFlowBlock_old_exo(electricityBus_storage_non_convex_1) += 0 + +c_e_InvestmentFlowBlock_old_rule_exo(electricityBus_storage_non_convex_2)_: ++1 InvestmentFlowBlock_old_exo(electricityBus_storage_non_convex_2) += 0 + +c_e_InvestmentFlowBlock_old_rule(storage_non_convex_electricityBus_0)_: +-1 InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_0) +-1 InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_0) ++1 InvestmentFlowBlock_old(storage_non_convex_electricityBus_0) += 0 + +c_e_InvestmentFlowBlock_old_rule(storage_non_convex_electricityBus_1)_: ++1 InvestmentFlowBlock_old(storage_non_convex_electricityBus_1) +-1 InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_1) +-1 InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_1) += 0 + +c_e_InvestmentFlowBlock_old_rule(storage_non_convex_electricityBus_2)_: ++1 InvestmentFlowBlock_old(storage_non_convex_electricityBus_2) +-1 InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_2) +-1 InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_2) += 0 + +c_e_InvestmentFlowBlock_old_rule(electricityBus_storage_non_convex_0)_: +-1 InvestmentFlowBlock_old_end(electricityBus_storage_non_convex_0) +-1 InvestmentFlowBlock_old_exo(electricityBus_storage_non_convex_0) ++1 InvestmentFlowBlock_old(electricityBus_storage_non_convex_0) += 0 + +c_e_InvestmentFlowBlock_old_rule(electricityBus_storage_non_convex_1)_: ++1 InvestmentFlowBlock_old(electricityBus_storage_non_convex_1) +-1 InvestmentFlowBlock_old_end(electricityBus_storage_non_convex_1) +-1 InvestmentFlowBlock_old_exo(electricityBus_storage_non_convex_1) += 0 + +c_e_InvestmentFlowBlock_old_rule(electricityBus_storage_non_convex_2)_: ++1 InvestmentFlowBlock_old(electricityBus_storage_non_convex_2) +-1 InvestmentFlowBlock_old_end(electricityBus_storage_non_convex_2) +-1 InvestmentFlowBlock_old_exo(electricityBus_storage_non_convex_2) += 0 + +c_u_InvestmentFlowBlock_max(storage_non_convex_electricityBus_0_0)_: ++1 flow(storage_non_convex_electricityBus_0_0) +-1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_0) +<= 0 + +c_u_InvestmentFlowBlock_max(storage_non_convex_electricityBus_0_1)_: ++1 flow(storage_non_convex_electricityBus_0_1) +-1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_0) +<= 0 + +c_u_InvestmentFlowBlock_max(storage_non_convex_electricityBus_1_2)_: ++1 flow(storage_non_convex_electricityBus_1_2) +-1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_1) +<= 0 + +c_u_InvestmentFlowBlock_max(storage_non_convex_electricityBus_1_3)_: ++1 flow(storage_non_convex_electricityBus_1_3) +-1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_1) +<= 0 + +c_u_InvestmentFlowBlock_max(storage_non_convex_electricityBus_2_4)_: ++1 flow(storage_non_convex_electricityBus_2_4) +-1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_2) +<= 0 + +c_u_InvestmentFlowBlock_max(storage_non_convex_electricityBus_2_5)_: ++1 flow(storage_non_convex_electricityBus_2_5) +-1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_2) +<= 0 + +c_u_InvestmentFlowBlock_max(electricityBus_storage_non_convex_0_0)_: ++1 flow(electricityBus_storage_non_convex_0_0) +-1 InvestmentFlowBlock_total(electricityBus_storage_non_convex_0) +<= 0 + +c_u_InvestmentFlowBlock_max(electricityBus_storage_non_convex_0_1)_: ++1 flow(electricityBus_storage_non_convex_0_1) +-1 InvestmentFlowBlock_total(electricityBus_storage_non_convex_0) +<= 0 + +c_u_InvestmentFlowBlock_max(electricityBus_storage_non_convex_1_2)_: ++1 flow(electricityBus_storage_non_convex_1_2) +-1 InvestmentFlowBlock_total(electricityBus_storage_non_convex_1) +<= 0 + +c_u_InvestmentFlowBlock_max(electricityBus_storage_non_convex_1_3)_: ++1 flow(electricityBus_storage_non_convex_1_3) +-1 InvestmentFlowBlock_total(electricityBus_storage_non_convex_1) +<= 0 + +c_u_InvestmentFlowBlock_max(electricityBus_storage_non_convex_2_4)_: ++1 flow(electricityBus_storage_non_convex_2_4) +-1 InvestmentFlowBlock_total(electricityBus_storage_non_convex_2) +<= 0 + +c_u_InvestmentFlowBlock_max(electricityBus_storage_non_convex_2_5)_: ++1 flow(electricityBus_storage_non_convex_2_5) +-1 InvestmentFlowBlock_total(electricityBus_storage_non_convex_2) +<= 0 + +c_e_GenericInvestmentStorageBlock_total_storage_rule(storage_non_convex_0)_: +-1 GenericInvestmentStorageBlock_invest(storage_non_convex_0) ++1 GenericInvestmentStorageBlock_total(storage_non_convex_0) += 0 + +c_e_GenericInvestmentStorageBlock_total_storage_rule(storage_non_convex_1)_: +-1 GenericInvestmentStorageBlock_invest(storage_non_convex_1) +-1 GenericInvestmentStorageBlock_total(storage_non_convex_0) ++1 GenericInvestmentStorageBlock_total(storage_non_convex_1) ++1 GenericInvestmentStorageBlock_old(storage_non_convex_1) += 0 + +c_e_GenericInvestmentStorageBlock_total_storage_rule(storage_non_convex_2)_: +-1 GenericInvestmentStorageBlock_invest(storage_non_convex_2) +-1 GenericInvestmentStorageBlock_total(storage_non_convex_1) ++1 GenericInvestmentStorageBlock_total(storage_non_convex_2) ++1 GenericInvestmentStorageBlock_old(storage_non_convex_2) += 0 + +c_e_GenericInvestmentStorageBlock_old_rule_end(storage_non_convex_0)_: ++1 GenericInvestmentStorageBlock_old_end(storage_non_convex_0) += 0 + +c_e_GenericInvestmentStorageBlock_old_rule_end(storage_non_convex_1)_: ++1 GenericInvestmentStorageBlock_old_end(storage_non_convex_1) += 0 + +c_e_GenericInvestmentStorageBlock_old_rule_end(storage_non_convex_2)_: ++1 GenericInvestmentStorageBlock_old_end(storage_non_convex_2) += 0 + +c_e_GenericInvestmentStorageBlock_old_rule_exo(storage_non_convex_0)_: ++1 GenericInvestmentStorageBlock_old_exo(storage_non_convex_0) += 0 + +c_e_GenericInvestmentStorageBlock_old_rule_exo(storage_non_convex_1)_: ++1 GenericInvestmentStorageBlock_old_exo(storage_non_convex_1) += 0 + +c_e_GenericInvestmentStorageBlock_old_rule_exo(storage_non_convex_2)_: ++1 GenericInvestmentStorageBlock_old_exo(storage_non_convex_2) += 0 + +c_e_GenericInvestmentStorageBlock_old_rule(storage_non_convex_0)_: +-1 GenericInvestmentStorageBlock_old_end(storage_non_convex_0) +-1 GenericInvestmentStorageBlock_old_exo(storage_non_convex_0) ++1 GenericInvestmentStorageBlock_old(storage_non_convex_0) += 0 + +c_e_GenericInvestmentStorageBlock_old_rule(storage_non_convex_1)_: ++1 GenericInvestmentStorageBlock_old(storage_non_convex_1) +-1 GenericInvestmentStorageBlock_old_end(storage_non_convex_1) +-1 GenericInvestmentStorageBlock_old_exo(storage_non_convex_1) += 0 + +c_e_GenericInvestmentStorageBlock_old_rule(storage_non_convex_2)_: ++1 GenericInvestmentStorageBlock_old(storage_non_convex_2) +-1 GenericInvestmentStorageBlock_old_end(storage_non_convex_2) +-1 GenericInvestmentStorageBlock_old_exo(storage_non_convex_2) += 0 + +c_e_GenericInvestmentStorageBlock_initially_empty(storage_non_convex_0)_: ++1 GenericInvestmentStorageBlock_storage_content(storage_non_convex_0) += 0 + +c_e_GenericInvestmentStorageBlock_balance(storage_non_convex_0_1)_: +-0.97 flow(electricityBus_storage_non_convex_0_1) ++1.1627906976744187 flow(storage_non_convex_electricityBus_0_1) +-0.87 GenericInvestmentStorageBlock_storage_content(storage_non_convex_0) ++1 GenericInvestmentStorageBlock_storage_content(storage_non_convex_1) += 0 + +c_e_GenericInvestmentStorageBlock_balance(storage_non_convex_1_2)_: +-0.97 flow(electricityBus_storage_non_convex_1_2) ++1.1627906976744187 flow(storage_non_convex_electricityBus_1_2) +-0.87 GenericInvestmentStorageBlock_storage_content(storage_non_convex_1) ++1 GenericInvestmentStorageBlock_storage_content(storage_non_convex_2) += 0 + +c_e_GenericInvestmentStorageBlock_balance(storage_non_convex_1_3)_: +-0.97 flow(electricityBus_storage_non_convex_1_3) ++1.1627906976744187 flow(storage_non_convex_electricityBus_1_3) +-0.87 GenericInvestmentStorageBlock_storage_content(storage_non_convex_2) ++1 GenericInvestmentStorageBlock_storage_content(storage_non_convex_3) += 0 + +c_e_GenericInvestmentStorageBlock_balance(storage_non_convex_2_4)_: +-0.97 flow(electricityBus_storage_non_convex_2_4) ++1.1627906976744187 flow(storage_non_convex_electricityBus_2_4) +-0.87 GenericInvestmentStorageBlock_storage_content(storage_non_convex_3) ++1 GenericInvestmentStorageBlock_storage_content(storage_non_convex_4) += 0 + +c_e_GenericInvestmentStorageBlock_balance(storage_non_convex_2_5)_: +-0.97 flow(electricityBus_storage_non_convex_2_5) ++1.1627906976744187 flow(storage_non_convex_electricityBus_2_5) +-0.87 GenericInvestmentStorageBlock_storage_content(storage_non_convex_4) ++1 GenericInvestmentStorageBlock_storage_content(storage_non_convex_5) += 0 + +c_e_GenericInvestmentStorageBlock_storage_capacity_inflow(storage_non_convex_0)_: ++1 InvestmentFlowBlock_total(electricityBus_storage_non_convex_0) +-0.16666666666666666 GenericInvestmentStorageBlock_total(storage_non_convex_0) += 0 + +c_e_GenericInvestmentStorageBlock_storage_capacity_inflow(storage_non_convex_1)_: ++1 InvestmentFlowBlock_total(electricityBus_storage_non_convex_1) +-0.16666666666666666 GenericInvestmentStorageBlock_total(storage_non_convex_1) += 0 + +c_e_GenericInvestmentStorageBlock_storage_capacity_inflow(storage_non_convex_2)_: ++1 InvestmentFlowBlock_total(electricityBus_storage_non_convex_2) +-0.16666666666666666 GenericInvestmentStorageBlock_total(storage_non_convex_2) += 0 + +c_e_GenericInvestmentStorageBlock_storage_capacity_outflow(storage_non_convex_0)_: ++1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_0) +-0.16666666666666666 GenericInvestmentStorageBlock_total(storage_non_convex_0) += 0 + +c_e_GenericInvestmentStorageBlock_storage_capacity_outflow(storage_non_convex_1)_: ++1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_1) +-0.16666666666666666 GenericInvestmentStorageBlock_total(storage_non_convex_1) += 0 + +c_e_GenericInvestmentStorageBlock_storage_capacity_outflow(storage_non_convex_2)_: ++1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_2) +-0.16666666666666666 GenericInvestmentStorageBlock_total(storage_non_convex_2) += 0 + +c_u_GenericInvestmentStorageBlock_max_storage_content(storage_non_convex_0_0)_: +-0.9 GenericInvestmentStorageBlock_total(storage_non_convex_0) ++1 GenericInvestmentStorageBlock_storage_content(storage_non_convex_0) +<= 0 + +c_u_GenericInvestmentStorageBlock_max_storage_content(storage_non_convex_0_1)_: +-0.9 GenericInvestmentStorageBlock_total(storage_non_convex_0) ++1 GenericInvestmentStorageBlock_storage_content(storage_non_convex_1) +<= 0 + +c_u_GenericInvestmentStorageBlock_max_storage_content(storage_non_convex_1_2)_: +-0.9 GenericInvestmentStorageBlock_total(storage_non_convex_1) ++1 GenericInvestmentStorageBlock_storage_content(storage_non_convex_2) +<= 0 + +c_u_GenericInvestmentStorageBlock_max_storage_content(storage_non_convex_1_3)_: +-0.9 GenericInvestmentStorageBlock_total(storage_non_convex_1) ++1 GenericInvestmentStorageBlock_storage_content(storage_non_convex_3) +<= 0 + +c_u_GenericInvestmentStorageBlock_max_storage_content(storage_non_convex_2_4)_: +-0.9 GenericInvestmentStorageBlock_total(storage_non_convex_2) ++1 GenericInvestmentStorageBlock_storage_content(storage_non_convex_4) +<= 0 + +c_u_GenericInvestmentStorageBlock_max_storage_content(storage_non_convex_2_5)_: +-0.9 GenericInvestmentStorageBlock_total(storage_non_convex_2) ++1 GenericInvestmentStorageBlock_storage_content(storage_non_convex_5) +<= 0 + +c_u_GenericInvestmentStorageBlock_min_storage_content(storage_non_convex_0_0)_: ++0.1 GenericInvestmentStorageBlock_total(storage_non_convex_0) +-1 GenericInvestmentStorageBlock_storage_content(storage_non_convex_0) +<= 0 + +c_u_GenericInvestmentStorageBlock_min_storage_content(storage_non_convex_0_1)_: ++0.1 GenericInvestmentStorageBlock_total(storage_non_convex_0) +-1 GenericInvestmentStorageBlock_storage_content(storage_non_convex_1) +<= 0 + +c_u_GenericInvestmentStorageBlock_min_storage_content(storage_non_convex_1_2)_: ++0.1 GenericInvestmentStorageBlock_total(storage_non_convex_1) +-1 GenericInvestmentStorageBlock_storage_content(storage_non_convex_2) +<= 0 + +c_u_GenericInvestmentStorageBlock_min_storage_content(storage_non_convex_1_3)_: ++0.1 GenericInvestmentStorageBlock_total(storage_non_convex_1) +-1 GenericInvestmentStorageBlock_storage_content(storage_non_convex_3) +<= 0 + +c_u_GenericInvestmentStorageBlock_min_storage_content(storage_non_convex_2_4)_: ++0.1 GenericInvestmentStorageBlock_total(storage_non_convex_2) +-1 GenericInvestmentStorageBlock_storage_content(storage_non_convex_4) +<= 0 + +c_u_GenericInvestmentStorageBlock_min_storage_content(storage_non_convex_2_5)_: ++0.1 GenericInvestmentStorageBlock_total(storage_non_convex_2) +-1 GenericInvestmentStorageBlock_storage_content(storage_non_convex_5) +<= 0 + +c_l_GenericInvestmentStorageBlock_limit_max(storage_non_convex_0)_: +-1 GenericInvestmentStorageBlock_invest(storage_non_convex_0) ++1454 GenericInvestmentStorageBlock_invest_status(storage_non_convex_0) +>= 0 + +c_l_GenericInvestmentStorageBlock_limit_max(storage_non_convex_1)_: +-1 GenericInvestmentStorageBlock_invest(storage_non_convex_1) ++1454 GenericInvestmentStorageBlock_invest_status(storage_non_convex_1) +>= 0 + +c_l_GenericInvestmentStorageBlock_limit_max(storage_non_convex_2)_: +-1 GenericInvestmentStorageBlock_invest(storage_non_convex_2) ++1454 GenericInvestmentStorageBlock_invest_status(storage_non_convex_2) +>= 0 + +c_l_GenericInvestmentStorageBlock_limit_min(storage_non_convex_0)_: ++1 GenericInvestmentStorageBlock_invest(storage_non_convex_0) +-19 GenericInvestmentStorageBlock_invest_status(storage_non_convex_0) +>= 0 + +c_l_GenericInvestmentStorageBlock_limit_min(storage_non_convex_1)_: ++1 GenericInvestmentStorageBlock_invest(storage_non_convex_1) +-19 GenericInvestmentStorageBlock_invest_status(storage_non_convex_1) +>= 0 + +c_l_GenericInvestmentStorageBlock_limit_min(storage_non_convex_2)_: ++1 GenericInvestmentStorageBlock_invest(storage_non_convex_2) +-19 GenericInvestmentStorageBlock_invest_status(storage_non_convex_2) +>= 0 + +bounds + 0 <= flow(electricityBus_storage_non_convex_0_0) <= +inf + 0 <= flow(electricityBus_storage_non_convex_0_1) <= +inf + 0 <= flow(electricityBus_storage_non_convex_1_2) <= +inf + 0 <= flow(electricityBus_storage_non_convex_1_3) <= +inf + 0 <= flow(electricityBus_storage_non_convex_2_4) <= +inf + 0 <= flow(electricityBus_storage_non_convex_2_5) <= +inf + 0 <= flow(storage_non_convex_electricityBus_0_0) <= +inf + 0 <= flow(storage_non_convex_electricityBus_0_1) <= +inf + 0 <= flow(storage_non_convex_electricityBus_1_2) <= +inf + 0 <= flow(storage_non_convex_electricityBus_1_3) <= +inf + 0 <= flow(storage_non_convex_electricityBus_2_4) <= +inf + 0 <= flow(storage_non_convex_electricityBus_2_5) <= +inf + 0 <= GenericInvestmentStorageBlock_invest(storage_non_convex_0) <= 1454 + 0 <= GenericInvestmentStorageBlock_invest_status(storage_non_convex_0) <= 1 + 0 <= GenericInvestmentStorageBlock_invest(storage_non_convex_1) <= 1454 + 0 <= GenericInvestmentStorageBlock_invest_status(storage_non_convex_1) <= 1 + 0 <= GenericInvestmentStorageBlock_invest(storage_non_convex_2) <= 1454 + 0 <= GenericInvestmentStorageBlock_invest_status(storage_non_convex_2) <= 1 + 0 <= InvestmentFlowBlock_total(storage_non_convex_electricityBus_0) <= +inf + 0 <= InvestmentFlowBlock_invest(storage_non_convex_electricityBus_0) <= +inf + 0 <= InvestmentFlowBlock_total(storage_non_convex_electricityBus_1) <= +inf + 0 <= InvestmentFlowBlock_invest(storage_non_convex_electricityBus_1) <= +inf + 0 <= InvestmentFlowBlock_old(storage_non_convex_electricityBus_1) <= +inf + 0 <= InvestmentFlowBlock_total(storage_non_convex_electricityBus_2) <= +inf + 0 <= InvestmentFlowBlock_invest(storage_non_convex_electricityBus_2) <= +inf + 0 <= InvestmentFlowBlock_old(storage_non_convex_electricityBus_2) <= +inf + 0 <= InvestmentFlowBlock_total(electricityBus_storage_non_convex_0) <= +inf + 0 <= InvestmentFlowBlock_invest(electricityBus_storage_non_convex_0) <= +inf + 0 <= InvestmentFlowBlock_total(electricityBus_storage_non_convex_1) <= +inf + 0 <= InvestmentFlowBlock_invest(electricityBus_storage_non_convex_1) <= +inf + 0 <= InvestmentFlowBlock_old(electricityBus_storage_non_convex_1) <= +inf + 0 <= InvestmentFlowBlock_total(electricityBus_storage_non_convex_2) <= +inf + 0 <= InvestmentFlowBlock_invest(electricityBus_storage_non_convex_2) <= +inf + 0 <= InvestmentFlowBlock_old(electricityBus_storage_non_convex_2) <= +inf + 0 <= InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_0) <= +inf + 0 <= InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_1) <= +inf + 0 <= InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_2) <= +inf + 0 <= InvestmentFlowBlock_old_end(electricityBus_storage_non_convex_0) <= +inf + 0 <= InvestmentFlowBlock_old_end(electricityBus_storage_non_convex_1) <= +inf + 0 <= InvestmentFlowBlock_old_end(electricityBus_storage_non_convex_2) <= +inf + 0 <= InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_0) <= +inf + 0 <= InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_1) <= +inf + 0 <= InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_2) <= +inf + 0 <= InvestmentFlowBlock_old_exo(electricityBus_storage_non_convex_0) <= +inf + 0 <= InvestmentFlowBlock_old_exo(electricityBus_storage_non_convex_1) <= +inf + 0 <= InvestmentFlowBlock_old_exo(electricityBus_storage_non_convex_2) <= +inf + 0 <= InvestmentFlowBlock_old(storage_non_convex_electricityBus_0) <= +inf + 0 <= InvestmentFlowBlock_old(electricityBus_storage_non_convex_0) <= +inf + 0 <= GenericInvestmentStorageBlock_total(storage_non_convex_0) <= +inf + 0 <= GenericInvestmentStorageBlock_total(storage_non_convex_1) <= +inf + 0 <= GenericInvestmentStorageBlock_old(storage_non_convex_1) <= +inf + 0 <= GenericInvestmentStorageBlock_total(storage_non_convex_2) <= +inf + 0 <= GenericInvestmentStorageBlock_old(storage_non_convex_2) <= +inf + 0 <= GenericInvestmentStorageBlock_old_end(storage_non_convex_0) <= +inf + 0 <= GenericInvestmentStorageBlock_old_end(storage_non_convex_1) <= +inf + 0 <= GenericInvestmentStorageBlock_old_end(storage_non_convex_2) <= +inf + 0 <= GenericInvestmentStorageBlock_old_exo(storage_non_convex_0) <= +inf + 0 <= GenericInvestmentStorageBlock_old_exo(storage_non_convex_1) <= +inf + 0 <= GenericInvestmentStorageBlock_old_exo(storage_non_convex_2) <= +inf + 0 <= GenericInvestmentStorageBlock_old(storage_non_convex_0) <= +inf + 0 <= GenericInvestmentStorageBlock_storage_content(storage_non_convex_0) <= +inf + 0 <= GenericInvestmentStorageBlock_storage_content(storage_non_convex_1) <= +inf + 0 <= GenericInvestmentStorageBlock_storage_content(storage_non_convex_2) <= +inf + 0 <= GenericInvestmentStorageBlock_storage_content(storage_non_convex_3) <= +inf + 0 <= GenericInvestmentStorageBlock_storage_content(storage_non_convex_4) <= +inf + 0 <= GenericInvestmentStorageBlock_storage_content(storage_non_convex_5) <= +inf +binary + GenericInvestmentStorageBlock_invest_status(storage_non_convex_0) + GenericInvestmentStorageBlock_invest_status(storage_non_convex_1) + GenericInvestmentStorageBlock_invest_status(storage_non_convex_2) +end diff --git a/tests/lp_files/storage_invest_without_offset_multi_period.lp b/tests/lp_files/storage_invest_without_offset_multi_period.lp index 3e98a271f..f4a182548 100644 --- a/tests/lp_files/storage_invest_without_offset_multi_period.lp +++ b/tests/lp_files/storage_invest_without_offset_multi_period.lp @@ -14,9 +14,9 @@ objective: +23.52941176470588 flow(storage_non_convex_electricityBus_1_3) +23.06805074971165 flow(storage_non_convex_electricityBus_2_4) +23.06805074971165 flow(storage_non_convex_electricityBus_2_5) -+172.46194511331876 GenericInvestmentStorageBlock_invest(storage_non_convex_0) -+169.08033834639093 GenericInvestmentStorageBlock_invest(storage_non_convex_1) -+165.7650375945009 GenericInvestmentStorageBlock_invest(storage_non_convex_2) ++24.868005934029988 GenericInvestmentStorageBlock_invest(storage_non_convex_0) ++16.413989016710378 GenericInvestmentStorageBlock_invest(storage_non_convex_1) ++8.125737136985347 GenericInvestmentStorageBlock_invest(storage_non_convex_2) s.t. @@ -50,25 +50,6 @@ c_e_BusBlock_balance(electricityBus_2_5)_: +1 flow(storage_non_convex_electricityBus_2_5) = 0 -c_e_InvestmentFlowBlock_total_rule(storage_non_convex_electricityBus_0)_: -+1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_0) --1 InvestmentFlowBlock_invest(storage_non_convex_electricityBus_0) -= 0 - -c_e_InvestmentFlowBlock_total_rule(storage_non_convex_electricityBus_1)_: --1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_0) -+1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_1) --1 InvestmentFlowBlock_invest(storage_non_convex_electricityBus_1) -+1 InvestmentFlowBlock_old(storage_non_convex_electricityBus_1) -= 0 - -c_e_InvestmentFlowBlock_total_rule(storage_non_convex_electricityBus_2)_: --1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_1) -+1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_2) --1 InvestmentFlowBlock_invest(storage_non_convex_electricityBus_2) -+1 InvestmentFlowBlock_old(storage_non_convex_electricityBus_2) -= 0 - c_e_InvestmentFlowBlock_total_rule(electricityBus_storage_non_convex_0)_: +1 InvestmentFlowBlock_total(electricityBus_storage_non_convex_0) -1 InvestmentFlowBlock_invest(electricityBus_storage_non_convex_0) @@ -88,16 +69,23 @@ c_e_InvestmentFlowBlock_total_rule(electricityBus_storage_non_convex_2)_: +1 InvestmentFlowBlock_old(electricityBus_storage_non_convex_2) = 0 -c_e_InvestmentFlowBlock_old_rule_end(storage_non_convex_electricityBus_0)_: -+1 InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_0) +c_e_InvestmentFlowBlock_total_rule(storage_non_convex_electricityBus_0)_: ++1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_0) +-1 InvestmentFlowBlock_invest(storage_non_convex_electricityBus_0) = 0 -c_e_InvestmentFlowBlock_old_rule_end(storage_non_convex_electricityBus_1)_: -+1 InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_1) +c_e_InvestmentFlowBlock_total_rule(storage_non_convex_electricityBus_1)_: +-1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_0) ++1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_1) +-1 InvestmentFlowBlock_invest(storage_non_convex_electricityBus_1) ++1 InvestmentFlowBlock_old(storage_non_convex_electricityBus_1) = 0 -c_e_InvestmentFlowBlock_old_rule_end(storage_non_convex_electricityBus_2)_: -+1 InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_2) +c_e_InvestmentFlowBlock_total_rule(storage_non_convex_electricityBus_2)_: +-1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_1) ++1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_2) +-1 InvestmentFlowBlock_invest(storage_non_convex_electricityBus_2) ++1 InvestmentFlowBlock_old(storage_non_convex_electricityBus_2) = 0 c_e_InvestmentFlowBlock_old_rule_end(electricityBus_storage_non_convex_0)_: @@ -112,16 +100,16 @@ c_e_InvestmentFlowBlock_old_rule_end(electricityBus_storage_non_convex_2)_: +1 InvestmentFlowBlock_old_end(electricityBus_storage_non_convex_2) = 0 -c_e_InvestmentFlowBlock_old_rule_exo(storage_non_convex_electricityBus_0)_: -+1 InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_0) +c_e_InvestmentFlowBlock_old_rule_end(storage_non_convex_electricityBus_0)_: ++1 InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_0) = 0 -c_e_InvestmentFlowBlock_old_rule_exo(storage_non_convex_electricityBus_1)_: -+1 InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_1) +c_e_InvestmentFlowBlock_old_rule_end(storage_non_convex_electricityBus_1)_: ++1 InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_1) = 0 -c_e_InvestmentFlowBlock_old_rule_exo(storage_non_convex_electricityBus_2)_: -+1 InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_2) +c_e_InvestmentFlowBlock_old_rule_end(storage_non_convex_electricityBus_2)_: ++1 InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_2) = 0 c_e_InvestmentFlowBlock_old_rule_exo(electricityBus_storage_non_convex_0)_: @@ -136,22 +124,16 @@ c_e_InvestmentFlowBlock_old_rule_exo(electricityBus_storage_non_convex_2)_: +1 InvestmentFlowBlock_old_exo(electricityBus_storage_non_convex_2) = 0 -c_e_InvestmentFlowBlock_old_rule(storage_non_convex_electricityBus_0)_: --1 InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_0) --1 InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_0) -+1 InvestmentFlowBlock_old(storage_non_convex_electricityBus_0) +c_e_InvestmentFlowBlock_old_rule_exo(storage_non_convex_electricityBus_0)_: ++1 InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_0) = 0 -c_e_InvestmentFlowBlock_old_rule(storage_non_convex_electricityBus_1)_: -+1 InvestmentFlowBlock_old(storage_non_convex_electricityBus_1) --1 InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_1) --1 InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_1) +c_e_InvestmentFlowBlock_old_rule_exo(storage_non_convex_electricityBus_1)_: ++1 InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_1) = 0 -c_e_InvestmentFlowBlock_old_rule(storage_non_convex_electricityBus_2)_: -+1 InvestmentFlowBlock_old(storage_non_convex_electricityBus_2) --1 InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_2) --1 InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_2) +c_e_InvestmentFlowBlock_old_rule_exo(storage_non_convex_electricityBus_2)_: ++1 InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_2) = 0 c_e_InvestmentFlowBlock_old_rule(electricityBus_storage_non_convex_0)_: @@ -172,35 +154,23 @@ c_e_InvestmentFlowBlock_old_rule(electricityBus_storage_non_convex_2)_: -1 InvestmentFlowBlock_old_exo(electricityBus_storage_non_convex_2) = 0 -c_u_InvestmentFlowBlock_max(storage_non_convex_electricityBus_0_0)_: -+1 flow(storage_non_convex_electricityBus_0_0) --1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_0) -<= 0 - -c_u_InvestmentFlowBlock_max(storage_non_convex_electricityBus_0_1)_: -+1 flow(storage_non_convex_electricityBus_0_1) --1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_0) -<= 0 - -c_u_InvestmentFlowBlock_max(storage_non_convex_electricityBus_1_2)_: -+1 flow(storage_non_convex_electricityBus_1_2) --1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_1) -<= 0 - -c_u_InvestmentFlowBlock_max(storage_non_convex_electricityBus_1_3)_: -+1 flow(storage_non_convex_electricityBus_1_3) --1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_1) -<= 0 +c_e_InvestmentFlowBlock_old_rule(storage_non_convex_electricityBus_0)_: +-1 InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_0) +-1 InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_0) ++1 InvestmentFlowBlock_old(storage_non_convex_electricityBus_0) += 0 -c_u_InvestmentFlowBlock_max(storage_non_convex_electricityBus_2_4)_: -+1 flow(storage_non_convex_electricityBus_2_4) --1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_2) -<= 0 +c_e_InvestmentFlowBlock_old_rule(storage_non_convex_electricityBus_1)_: ++1 InvestmentFlowBlock_old(storage_non_convex_electricityBus_1) +-1 InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_1) +-1 InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_1) += 0 -c_u_InvestmentFlowBlock_max(storage_non_convex_electricityBus_2_5)_: -+1 flow(storage_non_convex_electricityBus_2_5) --1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_2) -<= 0 +c_e_InvestmentFlowBlock_old_rule(storage_non_convex_electricityBus_2)_: ++1 InvestmentFlowBlock_old(storage_non_convex_electricityBus_2) +-1 InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_2) +-1 InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_2) += 0 c_u_InvestmentFlowBlock_max(electricityBus_storage_non_convex_0_0)_: +1 flow(electricityBus_storage_non_convex_0_0) @@ -232,6 +202,36 @@ c_u_InvestmentFlowBlock_max(electricityBus_storage_non_convex_2_5)_: -1 InvestmentFlowBlock_total(electricityBus_storage_non_convex_2) <= 0 +c_u_InvestmentFlowBlock_max(storage_non_convex_electricityBus_0_0)_: ++1 flow(storage_non_convex_electricityBus_0_0) +-1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_0) +<= 0 + +c_u_InvestmentFlowBlock_max(storage_non_convex_electricityBus_0_1)_: ++1 flow(storage_non_convex_electricityBus_0_1) +-1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_0) +<= 0 + +c_u_InvestmentFlowBlock_max(storage_non_convex_electricityBus_1_2)_: ++1 flow(storage_non_convex_electricityBus_1_2) +-1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_1) +<= 0 + +c_u_InvestmentFlowBlock_max(storage_non_convex_electricityBus_1_3)_: ++1 flow(storage_non_convex_electricityBus_1_3) +-1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_1) +<= 0 + +c_u_InvestmentFlowBlock_max(storage_non_convex_electricityBus_2_4)_: ++1 flow(storage_non_convex_electricityBus_2_4) +-1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_2) +<= 0 + +c_u_InvestmentFlowBlock_max(storage_non_convex_electricityBus_2_5)_: ++1 flow(storage_non_convex_electricityBus_2_5) +-1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_2) +<= 0 + c_e_GenericInvestmentStorageBlock_total_storage_rule(storage_non_convex_0)_: -1 GenericInvestmentStorageBlock_invest(storage_non_convex_0) +1 GenericInvestmentStorageBlock_total(storage_non_convex_0) @@ -468,14 +468,6 @@ bounds 0 <= GenericInvestmentStorageBlock_invest(storage_non_convex_0) <= 244 0 <= GenericInvestmentStorageBlock_invest(storage_non_convex_1) <= 244 0 <= GenericInvestmentStorageBlock_invest(storage_non_convex_2) <= 244 - 0 <= InvestmentFlowBlock_total(storage_non_convex_electricityBus_0) <= +inf - 0 <= InvestmentFlowBlock_invest(storage_non_convex_electricityBus_0) <= +inf - 0 <= InvestmentFlowBlock_total(storage_non_convex_electricityBus_1) <= +inf - 0 <= InvestmentFlowBlock_invest(storage_non_convex_electricityBus_1) <= +inf - 0 <= InvestmentFlowBlock_old(storage_non_convex_electricityBus_1) <= +inf - 0 <= InvestmentFlowBlock_total(storage_non_convex_electricityBus_2) <= +inf - 0 <= InvestmentFlowBlock_invest(storage_non_convex_electricityBus_2) <= +inf - 0 <= InvestmentFlowBlock_old(storage_non_convex_electricityBus_2) <= +inf 0 <= InvestmentFlowBlock_total(electricityBus_storage_non_convex_0) <= +inf 0 <= InvestmentFlowBlock_invest(electricityBus_storage_non_convex_0) <= +inf 0 <= InvestmentFlowBlock_total(electricityBus_storage_non_convex_1) <= +inf @@ -484,20 +476,28 @@ bounds 0 <= InvestmentFlowBlock_total(electricityBus_storage_non_convex_2) <= +inf 0 <= InvestmentFlowBlock_invest(electricityBus_storage_non_convex_2) <= +inf 0 <= InvestmentFlowBlock_old(electricityBus_storage_non_convex_2) <= +inf - 0 <= InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_0) <= +inf - 0 <= InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_1) <= +inf - 0 <= InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_2) <= +inf + 0 <= InvestmentFlowBlock_total(storage_non_convex_electricityBus_0) <= +inf + 0 <= InvestmentFlowBlock_invest(storage_non_convex_electricityBus_0) <= +inf + 0 <= InvestmentFlowBlock_total(storage_non_convex_electricityBus_1) <= +inf + 0 <= InvestmentFlowBlock_invest(storage_non_convex_electricityBus_1) <= +inf + 0 <= InvestmentFlowBlock_old(storage_non_convex_electricityBus_1) <= +inf + 0 <= InvestmentFlowBlock_total(storage_non_convex_electricityBus_2) <= +inf + 0 <= InvestmentFlowBlock_invest(storage_non_convex_electricityBus_2) <= +inf + 0 <= InvestmentFlowBlock_old(storage_non_convex_electricityBus_2) <= +inf 0 <= InvestmentFlowBlock_old_end(electricityBus_storage_non_convex_0) <= +inf 0 <= InvestmentFlowBlock_old_end(electricityBus_storage_non_convex_1) <= +inf 0 <= InvestmentFlowBlock_old_end(electricityBus_storage_non_convex_2) <= +inf - 0 <= InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_0) <= +inf - 0 <= InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_1) <= +inf - 0 <= InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_2) <= +inf + 0 <= InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_0) <= +inf + 0 <= InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_1) <= +inf + 0 <= InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_2) <= +inf 0 <= InvestmentFlowBlock_old_exo(electricityBus_storage_non_convex_0) <= +inf 0 <= InvestmentFlowBlock_old_exo(electricityBus_storage_non_convex_1) <= +inf 0 <= InvestmentFlowBlock_old_exo(electricityBus_storage_non_convex_2) <= +inf - 0 <= InvestmentFlowBlock_old(storage_non_convex_electricityBus_0) <= +inf + 0 <= InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_0) <= +inf + 0 <= InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_1) <= +inf + 0 <= InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_2) <= +inf 0 <= InvestmentFlowBlock_old(electricityBus_storage_non_convex_0) <= +inf + 0 <= InvestmentFlowBlock_old(storage_non_convex_electricityBus_0) <= +inf 0 <= GenericInvestmentStorageBlock_total(storage_non_convex_0) <= +inf 0 <= GenericInvestmentStorageBlock_total(storage_non_convex_1) <= +inf 0 <= GenericInvestmentStorageBlock_old(storage_non_convex_1) <= +inf diff --git a/tests/lp_files/storage_invest_without_offset_multi_period_remaining_value.lp b/tests/lp_files/storage_invest_without_offset_multi_period_remaining_value.lp new file mode 100644 index 000000000..179c59847 --- /dev/null +++ b/tests/lp_files/storage_invest_without_offset_multi_period_remaining_value.lp @@ -0,0 +1,526 @@ +\* Source Pyomo model name=Model *\ + +min +objective: ++56 flow(electricityBus_storage_non_convex_0_0) ++56 flow(electricityBus_storage_non_convex_0_1) ++54.90196078431372 flow(electricityBus_storage_non_convex_1_2) ++54.90196078431372 flow(electricityBus_storage_non_convex_1_3) ++53.82545174932718 flow(electricityBus_storage_non_convex_2_4) ++53.82545174932718 flow(electricityBus_storage_non_convex_2_5) ++24 flow(storage_non_convex_electricityBus_0_0) ++24 flow(storage_non_convex_electricityBus_0_1) ++23.52941176470588 flow(storage_non_convex_electricityBus_1_2) ++23.52941176470588 flow(storage_non_convex_electricityBus_1_3) ++23.06805074971165 flow(storage_non_convex_electricityBus_2_4) ++23.06805074971165 flow(storage_non_convex_electricityBus_2_5) ++24.868005934029988 GenericInvestmentStorageBlock_invest(storage_non_convex_0) ++16.413989016710378 GenericInvestmentStorageBlock_invest(storage_non_convex_1) ++8.125737136985347 GenericInvestmentStorageBlock_invest(storage_non_convex_2) + +s.t. + +c_e_BusBlock_balance(electricityBus_0_0)_: +-1 flow(electricityBus_storage_non_convex_0_0) ++1 flow(storage_non_convex_electricityBus_0_0) += 0 + +c_e_BusBlock_balance(electricityBus_0_1)_: +-1 flow(electricityBus_storage_non_convex_0_1) ++1 flow(storage_non_convex_electricityBus_0_1) += 0 + +c_e_BusBlock_balance(electricityBus_1_2)_: +-1 flow(electricityBus_storage_non_convex_1_2) ++1 flow(storage_non_convex_electricityBus_1_2) += 0 + +c_e_BusBlock_balance(electricityBus_1_3)_: +-1 flow(electricityBus_storage_non_convex_1_3) ++1 flow(storage_non_convex_electricityBus_1_3) += 0 + +c_e_BusBlock_balance(electricityBus_2_4)_: +-1 flow(electricityBus_storage_non_convex_2_4) ++1 flow(storage_non_convex_electricityBus_2_4) += 0 + +c_e_BusBlock_balance(electricityBus_2_5)_: +-1 flow(electricityBus_storage_non_convex_2_5) ++1 flow(storage_non_convex_electricityBus_2_5) += 0 + +c_e_InvestmentFlowBlock_total_rule(storage_non_convex_electricityBus_0)_: ++1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_0) +-1 InvestmentFlowBlock_invest(storage_non_convex_electricityBus_0) += 0 + +c_e_InvestmentFlowBlock_total_rule(storage_non_convex_electricityBus_1)_: +-1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_0) ++1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_1) +-1 InvestmentFlowBlock_invest(storage_non_convex_electricityBus_1) ++1 InvestmentFlowBlock_old(storage_non_convex_electricityBus_1) += 0 + +c_e_InvestmentFlowBlock_total_rule(storage_non_convex_electricityBus_2)_: +-1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_1) ++1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_2) +-1 InvestmentFlowBlock_invest(storage_non_convex_electricityBus_2) ++1 InvestmentFlowBlock_old(storage_non_convex_electricityBus_2) += 0 + +c_e_InvestmentFlowBlock_total_rule(electricityBus_storage_non_convex_0)_: ++1 InvestmentFlowBlock_total(electricityBus_storage_non_convex_0) +-1 InvestmentFlowBlock_invest(electricityBus_storage_non_convex_0) += 0 + +c_e_InvestmentFlowBlock_total_rule(electricityBus_storage_non_convex_1)_: +-1 InvestmentFlowBlock_total(electricityBus_storage_non_convex_0) ++1 InvestmentFlowBlock_total(electricityBus_storage_non_convex_1) +-1 InvestmentFlowBlock_invest(electricityBus_storage_non_convex_1) ++1 InvestmentFlowBlock_old(electricityBus_storage_non_convex_1) += 0 + +c_e_InvestmentFlowBlock_total_rule(electricityBus_storage_non_convex_2)_: +-1 InvestmentFlowBlock_total(electricityBus_storage_non_convex_1) ++1 InvestmentFlowBlock_total(electricityBus_storage_non_convex_2) +-1 InvestmentFlowBlock_invest(electricityBus_storage_non_convex_2) ++1 InvestmentFlowBlock_old(electricityBus_storage_non_convex_2) += 0 + +c_e_InvestmentFlowBlock_old_rule_end(storage_non_convex_electricityBus_0)_: ++1 InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_0) += 0 + +c_e_InvestmentFlowBlock_old_rule_end(storage_non_convex_electricityBus_1)_: ++1 InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_1) += 0 + +c_e_InvestmentFlowBlock_old_rule_end(storage_non_convex_electricityBus_2)_: ++1 InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_2) += 0 + +c_e_InvestmentFlowBlock_old_rule_end(electricityBus_storage_non_convex_0)_: ++1 InvestmentFlowBlock_old_end(electricityBus_storage_non_convex_0) += 0 + +c_e_InvestmentFlowBlock_old_rule_end(electricityBus_storage_non_convex_1)_: ++1 InvestmentFlowBlock_old_end(electricityBus_storage_non_convex_1) += 0 + +c_e_InvestmentFlowBlock_old_rule_end(electricityBus_storage_non_convex_2)_: ++1 InvestmentFlowBlock_old_end(electricityBus_storage_non_convex_2) += 0 + +c_e_InvestmentFlowBlock_old_rule_exo(storage_non_convex_electricityBus_0)_: ++1 InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_0) += 0 + +c_e_InvestmentFlowBlock_old_rule_exo(storage_non_convex_electricityBus_1)_: ++1 InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_1) += 0 + +c_e_InvestmentFlowBlock_old_rule_exo(storage_non_convex_electricityBus_2)_: ++1 InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_2) += 0 + +c_e_InvestmentFlowBlock_old_rule_exo(electricityBus_storage_non_convex_0)_: ++1 InvestmentFlowBlock_old_exo(electricityBus_storage_non_convex_0) += 0 + +c_e_InvestmentFlowBlock_old_rule_exo(electricityBus_storage_non_convex_1)_: ++1 InvestmentFlowBlock_old_exo(electricityBus_storage_non_convex_1) += 0 + +c_e_InvestmentFlowBlock_old_rule_exo(electricityBus_storage_non_convex_2)_: ++1 InvestmentFlowBlock_old_exo(electricityBus_storage_non_convex_2) += 0 + +c_e_InvestmentFlowBlock_old_rule(storage_non_convex_electricityBus_0)_: +-1 InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_0) +-1 InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_0) ++1 InvestmentFlowBlock_old(storage_non_convex_electricityBus_0) += 0 + +c_e_InvestmentFlowBlock_old_rule(storage_non_convex_electricityBus_1)_: ++1 InvestmentFlowBlock_old(storage_non_convex_electricityBus_1) +-1 InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_1) +-1 InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_1) += 0 + +c_e_InvestmentFlowBlock_old_rule(storage_non_convex_electricityBus_2)_: ++1 InvestmentFlowBlock_old(storage_non_convex_electricityBus_2) +-1 InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_2) +-1 InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_2) += 0 + +c_e_InvestmentFlowBlock_old_rule(electricityBus_storage_non_convex_0)_: +-1 InvestmentFlowBlock_old_end(electricityBus_storage_non_convex_0) +-1 InvestmentFlowBlock_old_exo(electricityBus_storage_non_convex_0) ++1 InvestmentFlowBlock_old(electricityBus_storage_non_convex_0) += 0 + +c_e_InvestmentFlowBlock_old_rule(electricityBus_storage_non_convex_1)_: ++1 InvestmentFlowBlock_old(electricityBus_storage_non_convex_1) +-1 InvestmentFlowBlock_old_end(electricityBus_storage_non_convex_1) +-1 InvestmentFlowBlock_old_exo(electricityBus_storage_non_convex_1) += 0 + +c_e_InvestmentFlowBlock_old_rule(electricityBus_storage_non_convex_2)_: ++1 InvestmentFlowBlock_old(electricityBus_storage_non_convex_2) +-1 InvestmentFlowBlock_old_end(electricityBus_storage_non_convex_2) +-1 InvestmentFlowBlock_old_exo(electricityBus_storage_non_convex_2) += 0 + +c_u_InvestmentFlowBlock_max(storage_non_convex_electricityBus_0_0)_: ++1 flow(storage_non_convex_electricityBus_0_0) +-1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_0) +<= 0 + +c_u_InvestmentFlowBlock_max(storage_non_convex_electricityBus_0_1)_: ++1 flow(storage_non_convex_electricityBus_0_1) +-1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_0) +<= 0 + +c_u_InvestmentFlowBlock_max(storage_non_convex_electricityBus_1_2)_: ++1 flow(storage_non_convex_electricityBus_1_2) +-1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_1) +<= 0 + +c_u_InvestmentFlowBlock_max(storage_non_convex_electricityBus_1_3)_: ++1 flow(storage_non_convex_electricityBus_1_3) +-1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_1) +<= 0 + +c_u_InvestmentFlowBlock_max(storage_non_convex_electricityBus_2_4)_: ++1 flow(storage_non_convex_electricityBus_2_4) +-1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_2) +<= 0 + +c_u_InvestmentFlowBlock_max(storage_non_convex_electricityBus_2_5)_: ++1 flow(storage_non_convex_electricityBus_2_5) +-1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_2) +<= 0 + +c_u_InvestmentFlowBlock_max(electricityBus_storage_non_convex_0_0)_: ++1 flow(electricityBus_storage_non_convex_0_0) +-1 InvestmentFlowBlock_total(electricityBus_storage_non_convex_0) +<= 0 + +c_u_InvestmentFlowBlock_max(electricityBus_storage_non_convex_0_1)_: ++1 flow(electricityBus_storage_non_convex_0_1) +-1 InvestmentFlowBlock_total(electricityBus_storage_non_convex_0) +<= 0 + +c_u_InvestmentFlowBlock_max(electricityBus_storage_non_convex_1_2)_: ++1 flow(electricityBus_storage_non_convex_1_2) +-1 InvestmentFlowBlock_total(electricityBus_storage_non_convex_1) +<= 0 + +c_u_InvestmentFlowBlock_max(electricityBus_storage_non_convex_1_3)_: ++1 flow(electricityBus_storage_non_convex_1_3) +-1 InvestmentFlowBlock_total(electricityBus_storage_non_convex_1) +<= 0 + +c_u_InvestmentFlowBlock_max(electricityBus_storage_non_convex_2_4)_: ++1 flow(electricityBus_storage_non_convex_2_4) +-1 InvestmentFlowBlock_total(electricityBus_storage_non_convex_2) +<= 0 + +c_u_InvestmentFlowBlock_max(electricityBus_storage_non_convex_2_5)_: ++1 flow(electricityBus_storage_non_convex_2_5) +-1 InvestmentFlowBlock_total(electricityBus_storage_non_convex_2) +<= 0 + +c_e_GenericInvestmentStorageBlock_total_storage_rule(storage_non_convex_0)_: +-1 GenericInvestmentStorageBlock_invest(storage_non_convex_0) ++1 GenericInvestmentStorageBlock_total(storage_non_convex_0) += 0 + +c_e_GenericInvestmentStorageBlock_total_storage_rule(storage_non_convex_1)_: +-1 GenericInvestmentStorageBlock_invest(storage_non_convex_1) +-1 GenericInvestmentStorageBlock_total(storage_non_convex_0) ++1 GenericInvestmentStorageBlock_total(storage_non_convex_1) ++1 GenericInvestmentStorageBlock_old(storage_non_convex_1) += 0 + +c_e_GenericInvestmentStorageBlock_total_storage_rule(storage_non_convex_2)_: +-1 GenericInvestmentStorageBlock_invest(storage_non_convex_2) +-1 GenericInvestmentStorageBlock_total(storage_non_convex_1) ++1 GenericInvestmentStorageBlock_total(storage_non_convex_2) ++1 GenericInvestmentStorageBlock_old(storage_non_convex_2) += 0 + +c_e_GenericInvestmentStorageBlock_old_rule_end(storage_non_convex_0)_: ++1 GenericInvestmentStorageBlock_old_end(storage_non_convex_0) += 0 + +c_e_GenericInvestmentStorageBlock_old_rule_end(storage_non_convex_1)_: ++1 GenericInvestmentStorageBlock_old_end(storage_non_convex_1) += 0 + +c_e_GenericInvestmentStorageBlock_old_rule_end(storage_non_convex_2)_: ++1 GenericInvestmentStorageBlock_old_end(storage_non_convex_2) += 0 + +c_e_GenericInvestmentStorageBlock_old_rule_exo(storage_non_convex_0)_: ++1 GenericInvestmentStorageBlock_old_exo(storage_non_convex_0) += 0 + +c_e_GenericInvestmentStorageBlock_old_rule_exo(storage_non_convex_1)_: ++1 GenericInvestmentStorageBlock_old_exo(storage_non_convex_1) += 0 + +c_e_GenericInvestmentStorageBlock_old_rule_exo(storage_non_convex_2)_: ++1 GenericInvestmentStorageBlock_old_exo(storage_non_convex_2) += 0 + +c_e_GenericInvestmentStorageBlock_old_rule(storage_non_convex_0)_: +-1 GenericInvestmentStorageBlock_old_end(storage_non_convex_0) +-1 GenericInvestmentStorageBlock_old_exo(storage_non_convex_0) ++1 GenericInvestmentStorageBlock_old(storage_non_convex_0) += 0 + +c_e_GenericInvestmentStorageBlock_old_rule(storage_non_convex_1)_: ++1 GenericInvestmentStorageBlock_old(storage_non_convex_1) +-1 GenericInvestmentStorageBlock_old_end(storage_non_convex_1) +-1 GenericInvestmentStorageBlock_old_exo(storage_non_convex_1) += 0 + +c_e_GenericInvestmentStorageBlock_old_rule(storage_non_convex_2)_: ++1 GenericInvestmentStorageBlock_old(storage_non_convex_2) +-1 GenericInvestmentStorageBlock_old_end(storage_non_convex_2) +-1 GenericInvestmentStorageBlock_old_exo(storage_non_convex_2) += 0 + +c_e_GenericInvestmentStorageBlock_initially_empty(storage_non_convex_0)_: ++1 GenericInvestmentStorageBlock_storage_content(storage_non_convex_0) += 0 + +c_e_GenericInvestmentStorageBlock_balance(storage_non_convex_0_1)_: +-0.97 flow(electricityBus_storage_non_convex_0_1) ++1.1627906976744187 flow(storage_non_convex_electricityBus_0_1) +-0.87 GenericInvestmentStorageBlock_storage_content(storage_non_convex_0) ++1 GenericInvestmentStorageBlock_storage_content(storage_non_convex_1) += 0 + +c_e_GenericInvestmentStorageBlock_balance(storage_non_convex_1_2)_: +-0.97 flow(electricityBus_storage_non_convex_1_2) ++1.1627906976744187 flow(storage_non_convex_electricityBus_1_2) +-0.87 GenericInvestmentStorageBlock_storage_content(storage_non_convex_1) ++1 GenericInvestmentStorageBlock_storage_content(storage_non_convex_2) += 0 + +c_e_GenericInvestmentStorageBlock_balance(storage_non_convex_1_3)_: +-0.97 flow(electricityBus_storage_non_convex_1_3) ++1.1627906976744187 flow(storage_non_convex_electricityBus_1_3) +-0.87 GenericInvestmentStorageBlock_storage_content(storage_non_convex_2) ++1 GenericInvestmentStorageBlock_storage_content(storage_non_convex_3) += 0 + +c_e_GenericInvestmentStorageBlock_balance(storage_non_convex_2_4)_: +-0.97 flow(electricityBus_storage_non_convex_2_4) ++1.1627906976744187 flow(storage_non_convex_electricityBus_2_4) +-0.87 GenericInvestmentStorageBlock_storage_content(storage_non_convex_3) ++1 GenericInvestmentStorageBlock_storage_content(storage_non_convex_4) += 0 + +c_e_GenericInvestmentStorageBlock_balance(storage_non_convex_2_5)_: +-0.97 flow(electricityBus_storage_non_convex_2_5) ++1.1627906976744187 flow(storage_non_convex_electricityBus_2_5) +-0.87 GenericInvestmentStorageBlock_storage_content(storage_non_convex_4) ++1 GenericInvestmentStorageBlock_storage_content(storage_non_convex_5) += 0 + +c_e_GenericInvestmentStorageBlock_storage_capacity_inflow(storage_non_convex_0)_: ++1 InvestmentFlowBlock_total(electricityBus_storage_non_convex_0) +-0.16666666666666666 GenericInvestmentStorageBlock_total(storage_non_convex_0) += 0 + +c_e_GenericInvestmentStorageBlock_storage_capacity_inflow(storage_non_convex_1)_: ++1 InvestmentFlowBlock_total(electricityBus_storage_non_convex_1) +-0.16666666666666666 GenericInvestmentStorageBlock_total(storage_non_convex_1) += 0 + +c_e_GenericInvestmentStorageBlock_storage_capacity_inflow(storage_non_convex_2)_: ++1 InvestmentFlowBlock_total(electricityBus_storage_non_convex_2) +-0.16666666666666666 GenericInvestmentStorageBlock_total(storage_non_convex_2) += 0 + +c_e_GenericInvestmentStorageBlock_storage_capacity_outflow(storage_non_convex_0)_: ++1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_0) +-0.16666666666666666 GenericInvestmentStorageBlock_total(storage_non_convex_0) += 0 + +c_e_GenericInvestmentStorageBlock_storage_capacity_outflow(storage_non_convex_1)_: ++1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_1) +-0.16666666666666666 GenericInvestmentStorageBlock_total(storage_non_convex_1) += 0 + +c_e_GenericInvestmentStorageBlock_storage_capacity_outflow(storage_non_convex_2)_: ++1 InvestmentFlowBlock_total(storage_non_convex_electricityBus_2) +-0.16666666666666666 GenericInvestmentStorageBlock_total(storage_non_convex_2) += 0 + +c_u_GenericInvestmentStorageBlock_max_storage_content(storage_non_convex_0_0)_: +-0.9 GenericInvestmentStorageBlock_total(storage_non_convex_0) ++1 GenericInvestmentStorageBlock_storage_content(storage_non_convex_0) +<= 0 + +c_u_GenericInvestmentStorageBlock_max_storage_content(storage_non_convex_0_1)_: +-0.9 GenericInvestmentStorageBlock_total(storage_non_convex_0) ++1 GenericInvestmentStorageBlock_storage_content(storage_non_convex_1) +<= 0 + +c_u_GenericInvestmentStorageBlock_max_storage_content(storage_non_convex_1_2)_: +-0.9 GenericInvestmentStorageBlock_total(storage_non_convex_1) ++1 GenericInvestmentStorageBlock_storage_content(storage_non_convex_2) +<= 0 + +c_u_GenericInvestmentStorageBlock_max_storage_content(storage_non_convex_1_3)_: +-0.9 GenericInvestmentStorageBlock_total(storage_non_convex_1) ++1 GenericInvestmentStorageBlock_storage_content(storage_non_convex_3) +<= 0 + +c_u_GenericInvestmentStorageBlock_max_storage_content(storage_non_convex_2_4)_: +-0.9 GenericInvestmentStorageBlock_total(storage_non_convex_2) ++1 GenericInvestmentStorageBlock_storage_content(storage_non_convex_4) +<= 0 + +c_u_GenericInvestmentStorageBlock_max_storage_content(storage_non_convex_2_5)_: +-0.9 GenericInvestmentStorageBlock_total(storage_non_convex_2) ++1 GenericInvestmentStorageBlock_storage_content(storage_non_convex_5) +<= 0 + +c_u_GenericInvestmentStorageBlock_min_storage_content(storage_non_convex_0_0)_: ++0.1 GenericInvestmentStorageBlock_total(storage_non_convex_0) +-1 GenericInvestmentStorageBlock_storage_content(storage_non_convex_0) +<= 0 + +c_u_GenericInvestmentStorageBlock_min_storage_content(storage_non_convex_0_1)_: ++0.1 GenericInvestmentStorageBlock_total(storage_non_convex_0) +-1 GenericInvestmentStorageBlock_storage_content(storage_non_convex_1) +<= 0 + +c_u_GenericInvestmentStorageBlock_min_storage_content(storage_non_convex_1_2)_: ++0.1 GenericInvestmentStorageBlock_total(storage_non_convex_1) +-1 GenericInvestmentStorageBlock_storage_content(storage_non_convex_2) +<= 0 + +c_u_GenericInvestmentStorageBlock_min_storage_content(storage_non_convex_1_3)_: ++0.1 GenericInvestmentStorageBlock_total(storage_non_convex_1) +-1 GenericInvestmentStorageBlock_storage_content(storage_non_convex_3) +<= 0 + +c_u_GenericInvestmentStorageBlock_min_storage_content(storage_non_convex_2_4)_: ++0.1 GenericInvestmentStorageBlock_total(storage_non_convex_2) +-1 GenericInvestmentStorageBlock_storage_content(storage_non_convex_4) +<= 0 + +c_u_GenericInvestmentStorageBlock_min_storage_content(storage_non_convex_2_5)_: ++0.1 GenericInvestmentStorageBlock_total(storage_non_convex_2) +-1 GenericInvestmentStorageBlock_storage_content(storage_non_convex_5) +<= 0 + +c_l_GenericInvestmentStorageBlock_limit_max(storage_non_convex_0)_: +-1 GenericInvestmentStorageBlock_invest(storage_non_convex_0) ++244 GenericInvestmentStorageBlock_invest_status(storage_non_convex_0) +>= 0 + +c_l_GenericInvestmentStorageBlock_limit_max(storage_non_convex_1)_: +-1 GenericInvestmentStorageBlock_invest(storage_non_convex_1) ++244 GenericInvestmentStorageBlock_invest_status(storage_non_convex_1) +>= 0 + +c_l_GenericInvestmentStorageBlock_limit_max(storage_non_convex_2)_: +-1 GenericInvestmentStorageBlock_invest(storage_non_convex_2) ++244 GenericInvestmentStorageBlock_invest_status(storage_non_convex_2) +>= 0 + +c_l_GenericInvestmentStorageBlock_limit_min(storage_non_convex_0)_: ++1 GenericInvestmentStorageBlock_invest(storage_non_convex_0) +-12 GenericInvestmentStorageBlock_invest_status(storage_non_convex_0) +>= 0 + +c_l_GenericInvestmentStorageBlock_limit_min(storage_non_convex_1)_: ++1 GenericInvestmentStorageBlock_invest(storage_non_convex_1) +-12 GenericInvestmentStorageBlock_invest_status(storage_non_convex_1) +>= 0 + +c_l_GenericInvestmentStorageBlock_limit_min(storage_non_convex_2)_: ++1 GenericInvestmentStorageBlock_invest(storage_non_convex_2) +-12 GenericInvestmentStorageBlock_invest_status(storage_non_convex_2) +>= 0 + +bounds + 0 <= flow(electricityBus_storage_non_convex_0_0) <= +inf + 0 <= flow(electricityBus_storage_non_convex_0_1) <= +inf + 0 <= flow(electricityBus_storage_non_convex_1_2) <= +inf + 0 <= flow(electricityBus_storage_non_convex_1_3) <= +inf + 0 <= flow(electricityBus_storage_non_convex_2_4) <= +inf + 0 <= flow(electricityBus_storage_non_convex_2_5) <= +inf + 0 <= flow(storage_non_convex_electricityBus_0_0) <= +inf + 0 <= flow(storage_non_convex_electricityBus_0_1) <= +inf + 0 <= flow(storage_non_convex_electricityBus_1_2) <= +inf + 0 <= flow(storage_non_convex_electricityBus_1_3) <= +inf + 0 <= flow(storage_non_convex_electricityBus_2_4) <= +inf + 0 <= flow(storage_non_convex_electricityBus_2_5) <= +inf + 0 <= GenericInvestmentStorageBlock_invest(storage_non_convex_0) <= 244 + 0 <= GenericInvestmentStorageBlock_invest(storage_non_convex_1) <= 244 + 0 <= GenericInvestmentStorageBlock_invest(storage_non_convex_2) <= 244 + 0 <= InvestmentFlowBlock_total(storage_non_convex_electricityBus_0) <= +inf + 0 <= InvestmentFlowBlock_invest(storage_non_convex_electricityBus_0) <= +inf + 0 <= InvestmentFlowBlock_total(storage_non_convex_electricityBus_1) <= +inf + 0 <= InvestmentFlowBlock_invest(storage_non_convex_electricityBus_1) <= +inf + 0 <= InvestmentFlowBlock_old(storage_non_convex_electricityBus_1) <= +inf + 0 <= InvestmentFlowBlock_total(storage_non_convex_electricityBus_2) <= +inf + 0 <= InvestmentFlowBlock_invest(storage_non_convex_electricityBus_2) <= +inf + 0 <= InvestmentFlowBlock_old(storage_non_convex_electricityBus_2) <= +inf + 0 <= InvestmentFlowBlock_total(electricityBus_storage_non_convex_0) <= +inf + 0 <= InvestmentFlowBlock_invest(electricityBus_storage_non_convex_0) <= +inf + 0 <= InvestmentFlowBlock_total(electricityBus_storage_non_convex_1) <= +inf + 0 <= InvestmentFlowBlock_invest(electricityBus_storage_non_convex_1) <= +inf + 0 <= InvestmentFlowBlock_old(electricityBus_storage_non_convex_1) <= +inf + 0 <= InvestmentFlowBlock_total(electricityBus_storage_non_convex_2) <= +inf + 0 <= InvestmentFlowBlock_invest(electricityBus_storage_non_convex_2) <= +inf + 0 <= InvestmentFlowBlock_old(electricityBus_storage_non_convex_2) <= +inf + 0 <= InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_0) <= +inf + 0 <= InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_1) <= +inf + 0 <= InvestmentFlowBlock_old_end(storage_non_convex_electricityBus_2) <= +inf + 0 <= InvestmentFlowBlock_old_end(electricityBus_storage_non_convex_0) <= +inf + 0 <= InvestmentFlowBlock_old_end(electricityBus_storage_non_convex_1) <= +inf + 0 <= InvestmentFlowBlock_old_end(electricityBus_storage_non_convex_2) <= +inf + 0 <= InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_0) <= +inf + 0 <= InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_1) <= +inf + 0 <= InvestmentFlowBlock_old_exo(storage_non_convex_electricityBus_2) <= +inf + 0 <= InvestmentFlowBlock_old_exo(electricityBus_storage_non_convex_0) <= +inf + 0 <= InvestmentFlowBlock_old_exo(electricityBus_storage_non_convex_1) <= +inf + 0 <= InvestmentFlowBlock_old_exo(electricityBus_storage_non_convex_2) <= +inf + 0 <= InvestmentFlowBlock_old(storage_non_convex_electricityBus_0) <= +inf + 0 <= InvestmentFlowBlock_old(electricityBus_storage_non_convex_0) <= +inf + 0 <= GenericInvestmentStorageBlock_total(storage_non_convex_0) <= +inf + 0 <= GenericInvestmentStorageBlock_total(storage_non_convex_1) <= +inf + 0 <= GenericInvestmentStorageBlock_old(storage_non_convex_1) <= +inf + 0 <= GenericInvestmentStorageBlock_total(storage_non_convex_2) <= +inf + 0 <= GenericInvestmentStorageBlock_old(storage_non_convex_2) <= +inf + 0 <= GenericInvestmentStorageBlock_old_end(storage_non_convex_0) <= +inf + 0 <= GenericInvestmentStorageBlock_old_end(storage_non_convex_1) <= +inf + 0 <= GenericInvestmentStorageBlock_old_end(storage_non_convex_2) <= +inf + 0 <= GenericInvestmentStorageBlock_old_exo(storage_non_convex_0) <= +inf + 0 <= GenericInvestmentStorageBlock_old_exo(storage_non_convex_1) <= +inf + 0 <= GenericInvestmentStorageBlock_old_exo(storage_non_convex_2) <= +inf + 0 <= GenericInvestmentStorageBlock_old(storage_non_convex_0) <= +inf + 0 <= GenericInvestmentStorageBlock_storage_content(storage_non_convex_0) <= +inf + 0 <= GenericInvestmentStorageBlock_storage_content(storage_non_convex_1) <= +inf + 0 <= GenericInvestmentStorageBlock_storage_content(storage_non_convex_2) <= +inf + 0 <= GenericInvestmentStorageBlock_storage_content(storage_non_convex_3) <= +inf + 0 <= GenericInvestmentStorageBlock_storage_content(storage_non_convex_4) <= +inf + 0 <= GenericInvestmentStorageBlock_storage_content(storage_non_convex_5) <= +inf + 0 <= GenericInvestmentStorageBlock_invest_status(storage_non_convex_0) <= 1 + 0 <= GenericInvestmentStorageBlock_invest_status(storage_non_convex_1) <= 1 + 0 <= GenericInvestmentStorageBlock_invest_status(storage_non_convex_2) <= 1 +binary + GenericInvestmentStorageBlock_invest_status(storage_non_convex_0) + GenericInvestmentStorageBlock_invest_status(storage_non_convex_1) + GenericInvestmentStorageBlock_invest_status(storage_non_convex_2) +end diff --git a/tests/multi_period_constraint_tests.py b/tests/multi_period_constraint_tests.py index 0679a7681..e2992856f 100644 --- a/tests/multi_period_constraint_tests.py +++ b/tests/multi_period_constraint_tests.py @@ -147,6 +147,39 @@ def test_linear_converter_invest(self): self.energysystem.add(bgas, bel, converter) self.compare_lp_files("linear_converter_invest_multi_period.lp") + def test_linear_converter_invest_remaining_value(self): + """Constraint test of a Converter with Investment.""" + + bgas = solph.buses.Bus(label="gas") + + bel = solph.buses.Bus(label="electricity") + + converter = solph.components.Converter( + label="powerplant_gas", + inputs={bgas: solph.flows.Flow()}, + outputs={ + bel: solph.flows.Flow( + variable_costs=50, + investment=solph.Investment( + existing=50, + maximum=1000, + overall_maximum=10000, + overall_minimum=200, + ep_costs=[20, 19, 18], + age=5, + lifetime=40, + ), + ) + }, + conversion_factors={bel: 0.58}, + ) + self.energysystem.use_remaining_value = True + self.energysystem.add(bgas, bel, converter) + self.compare_lp_files( + "linear_converter_invest_multi_period_remaining_value.lp" + ) + self.energysystem.use_remaining_value = False + def test_linear_converter_invest_old_capacity(self): """Constraint test of a Converter with Investment.""" @@ -364,6 +397,42 @@ def test_storage_invest_1(self): self.energysystem.add(bel, storage) self.compare_lp_files("storage_invest_1_multi_period.lp") + def test_storage_invest_1_remaining_value(self): + """All invest variables are coupled. The invest variables of the Flows + will be created during the initialisation of the storage e.g. battery + """ + bel = solph.buses.Bus(label="electricityBus") + + storage = solph.components.GenericStorage( + label="storage1", + inputs={bel: solph.flows.Flow(variable_costs=56)}, + outputs={bel: solph.flows.Flow(variable_costs=24)}, + nominal_storage_capacity=None, + loss_rate=0.13, + max_storage_level=0.9, + min_storage_level=0.1, + invest_relation_input_capacity=1 / 6, + invest_relation_output_capacity=1 / 6, + lifetime_inflow=20, + lifetime_outflow=20, + inflow_conversion_factor=0.97, + outflow_conversion_factor=0.86, + investment=solph.Investment( + ep_costs=[145, 130, 115], + maximum=234, + lifetime=20, + interest_rate=0.05, + overall_maximum=1000, + overall_minimum=2, + ), + ) + self.energysystem.use_remaining_value = True + self.energysystem.add(bel, storage) + self.compare_lp_files( + "storage_invest_1_multi_period_remaining_value.lp" + ) + self.energysystem.use_remaining_value = False + def test_storage_invest_2(self): """All can be free extended to their own cost.""" bel = solph.buses.Bus(label="electricityBus") @@ -1633,6 +1702,44 @@ def test_dsm_module_DIW_invest(self): self.energysystem.add(b_elec, sinkdsm) self.compare_lp_files("dsm_module_DIW_invest_multi_period.lp") + def test_dsm_module_DIW_invest_remaining_value(self): + """Constraint test of SinkDSM with approach=DLR and investments""" + + b_elec = solph.buses.Bus(label="bus_elec") + sinkdsm = solph.components.experimental.SinkDSM( + label="demand_dsm", + inputs={b_elec: solph.flows.Flow()}, + demand=[1] * 6, + capacity_up=[0.5] * 6, + capacity_down=[0.5] * 6, + approach="DIW", + max_demand=[1, 2, 3], + delay_time=1, + cost_dsm_down_shift=1, + cost_dsm_up=1, + cost_dsm_down_shed=100, + shed_eligibility=True, + recovery_time_shed=2, + shed_time=2, + investment=solph.Investment( + ep_costs=[100, 90, 80], + existing=50, + minimum=33, + maximum=100, + age=1, + lifetime=20, + fixed_costs=20, + overall_maximum=1000, + overall_minimum=5, + ), + ) + self.energysystem.use_remaining_value = True + self.energysystem.add(b_elec, sinkdsm) + self.compare_lp_files( + "dsm_module_DIW_invest_multi_period_remaining_value.lp" + ) + self.energysystem.use_remaining_value = False + def test_dsm_module_DLR_invest(self): """Constraint test of SinkDSM with approach=DLR and investments""" @@ -1669,6 +1776,46 @@ def test_dsm_module_DLR_invest(self): self.energysystem.add(b_elec, sinkdsm) self.compare_lp_files("dsm_module_DLR_invest_multi_period.lp") + def test_dsm_module_DLR_invest_remaining_value(self): + """Constraint test of SinkDSM with approach=DLR and investments""" + + b_elec = solph.buses.Bus(label="bus_elec") + sinkdsm = solph.components.experimental.SinkDSM( + label="demand_dsm", + inputs={b_elec: solph.flows.Flow()}, + demand=[1] * 6, + capacity_up=[0.5] * 6, + capacity_down=[0.5] * 6, + approach="DLR", + max_demand=[1, 2, 3], + delay_time=2, + shift_time=1, + cost_dsm_down_shift=1, + cost_dsm_up=1, + cost_dsm_down_shed=100, + shed_eligibility=True, + recovery_time_shed=2, + shed_time=2, + n_yearLimit_shed=50, + investment=solph.Investment( + ep_costs=[100, 90, 80], + existing=50, + minimum=33, + maximum=100, + age=1, + lifetime=20, + fixed_costs=20, + overall_maximum=1000, + overall_minimum=5, + ), + ) + self.energysystem.use_remaining_value = True + self.energysystem.add(b_elec, sinkdsm) + self.compare_lp_files( + "dsm_module_DLR_invest_multi_period_remaining_value.lp" + ) + self.energysystem.use_remaining_value = False + def test_dsm_module_oemof_invest(self): """Constraint test of SinkDSM with approach=oemof and investments""" @@ -1703,6 +1850,44 @@ def test_dsm_module_oemof_invest(self): self.energysystem.add(b_elec, sinkdsm) self.compare_lp_files("dsm_module_oemof_invest_multi_period.lp") + def test_dsm_module_oemof_invest_remaining_value(self): + """Constraint test of SinkDSM with approach=oemof and investments""" + + b_elec = solph.buses.Bus(label="bus_elec") + sinkdsm = solph.components.experimental.SinkDSM( + label="demand_dsm", + inputs={b_elec: solph.flows.Flow()}, + demand=[1] * 6, + capacity_up=[0.5, 0.4, 0.5, 0.3, 0.3, 0.3], + capacity_down=[0.5, 0.4, 0.5, 0.3, 0.3, 0.3], + approach="oemof", + max_demand=[1, 2, 3], + shift_interval=2, + cost_dsm_down_shift=1, + cost_dsm_up=1, + cost_dsm_down_shed=100, + shed_eligibility=True, + recovery_time_shed=2, + shed_time=2, + investment=solph.Investment( + ep_costs=[100, 90, 80], + existing=50, + minimum=33, + maximum=100, + age=1, + lifetime=20, + fixed_costs=20, + overall_maximum=1000, + overall_minimum=5, + ), + ) + self.energysystem.use_remaining_value = True + self.energysystem.add(b_elec, sinkdsm) + self.compare_lp_files( + "dsm_module_oemof_invest_multi_period_remaining_value.lp" + ) + self.energysystem.use_remaining_value = False + def test_nonconvex_investment_storage_without_offset(self): """All invest variables are coupled. The invest variables of the Flows will be created during the initialisation of the storage e.g. battery @@ -1733,6 +1918,41 @@ def test_nonconvex_investment_storage_without_offset(self): self.energysystem.add(bel, storage) self.compare_lp_files("storage_invest_without_offset_multi_period.lp") + def test_nonconvex_investment_storage_without_offset_remaining_value(self): + """All invest variables are coupled. The invest variables of the Flows + will be created during the initialisation of the storage e.g. battery + """ + bel = solph.buses.Bus(label="electricityBus") + + storage = solph.components.GenericStorage( + label="storage_non_convex", + inputs={bel: solph.flows.Flow(variable_costs=56)}, + outputs={bel: solph.flows.Flow(variable_costs=24)}, + nominal_storage_capacity=None, + loss_rate=0.13, + max_storage_level=0.9, + min_storage_level=0.1, + invest_relation_input_capacity=1 / 6, + invest_relation_output_capacity=1 / 6, + inflow_conversion_factor=0.97, + outflow_conversion_factor=0.86, + lifetime_inflow=20, + lifetime_outflow=20, + investment=solph.Investment( + ep_costs=141, + maximum=244, + minimum=12, + nonconvex=True, + lifetime=20, + ), + ) + self.energysystem.use_remaining_value = True + self.energysystem.add(bel, storage) + self.compare_lp_files( + "storage_invest_without_offset_multi_period_remaining_value.lp" + ) + self.energysystem.use_remaining_value = False + def test_nonconvex_investment_storage_with_offset(self): """All invest variables are coupled. The invest variables of the Flows will be created during the initialisation of the storage e.g. battery @@ -1764,6 +1984,42 @@ def test_nonconvex_investment_storage_with_offset(self): self.energysystem.add(bel, storage) self.compare_lp_files("storage_invest_with_offset_multi_period.lp") + def test_nonconvex_investment_storage_with_offset_remaining_value(self): + """All invest variables are coupled. The invest variables of the Flows + will be created during the initialisation of the storage e.g. battery + """ + bel = solph.buses.Bus(label="electricityBus") + + storage = solph.components.GenericStorage( + label="storage_non_convex", + inputs={bel: solph.flows.Flow(variable_costs=56)}, + outputs={bel: solph.flows.Flow(variable_costs=24)}, + nominal_storage_capacity=None, + loss_rate=0.13, + max_storage_level=0.9, + min_storage_level=0.1, + invest_relation_input_capacity=1 / 6, + invest_relation_output_capacity=1 / 6, + inflow_conversion_factor=0.97, + outflow_conversion_factor=0.86, + lifetime_inflow=20, + lifetime_outflow=20, + investment=solph.Investment( + ep_costs=145, + minimum=19, + offset=5, + nonconvex=True, + maximum=1454, + lifetime=20, + ), + ) + self.energysystem.use_remaining_value = True + self.energysystem.add(bel, storage) + self.compare_lp_files( + "storage_invest_with_offset_multi_period_remaining_value.lp" + ) + self.energysystem.use_remaining_value = False + def test_nonconvex_invest_storage_all_nonconvex(self): """All invest variables are free and nonconvex.""" b1 = solph.buses.Bus(label="bus1") @@ -1830,6 +2086,34 @@ def test_nonconvex_invest_sink_without_offset(self): self.energysystem.add(bel, sink) self.compare_lp_files("flow_invest_without_offset_multi_period.lp") + def test_nonconvex_invest_sink_without_offset_remaining_value(self): + """Non convex invest flow without offset, with minimum.""" + bel = solph.buses.Bus(label="electricityBus") + + sink = solph.components.Sink( + label="sink_nonconvex_invest", + inputs={ + bel: solph.flows.Flow( + summed_max=2.3, + variable_costs=25, + max=0.8, + investment=solph.Investment( + ep_costs=500, + minimum=15, + nonconvex=True, + maximum=172, + lifetime=20, + ), + ) + }, + ) + self.energysystem.use_remaining_value = True + self.energysystem.add(bel, sink) + self.compare_lp_files( + "flow_invest_without_offset_multi_period_remaining_value.lp" + ) + self.energysystem.use_remaining_value = False + def test_nonconvex_invest_source_with_offset(self): """Non convex invest flow with offset, with minimum.""" bel = solph.buses.Bus(label="electricityBus") @@ -1855,6 +2139,35 @@ def test_nonconvex_invest_source_with_offset(self): self.energysystem.add(bel, source) self.compare_lp_files("flow_invest_with_offset_multi_period.lp") + def test_nonconvex_invest_source_with_offset_remaining_value(self): + """Non convex invest flow with offset, with minimum.""" + bel = solph.buses.Bus(label="electricityBus") + + source = solph.components.Source( + label="source_nonconvex_invest", + outputs={ + bel: solph.flows.Flow( + summed_max=2.3, + variable_costs=25, + max=0.8, + investment=solph.Investment( + ep_costs=500, + minimum=15, + maximum=20, + offset=34, + nonconvex=True, + lifetime=20, + ), + ) + }, + ) + self.energysystem.use_remaining_value = True + self.energysystem.add(bel, source) + self.compare_lp_files( + "flow_invest_with_offset_multi_period_remaining_value.lp" + ) + self.energysystem.use_remaining_value = False + def test_nonconvex_invest_source_with_offset_no_minimum(self): """Non convex invest flow with offset, without minimum.""" bel = solph.buses.Bus(label="electricityBus") diff --git a/tests/test_models.py b/tests/test_models.py index 4eabbd783..3ac3938eb 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -73,7 +73,10 @@ def test_multi_period_default_discount_rate(): warnings.filterwarnings("ignore", category=FutureWarning) timeindex = pd.date_range(start="2017-01-01", periods=100, freq="D") es = solph.EnergySystem( - timeindex=timeindex, periods={0: timeindex}, infer_last_interval=True + timeindex=timeindex, + timeincrement=[1] * len(timeindex), + periods=[timeindex], + infer_last_interval=False, ) bel = solph.buses.Bus(label="bus") es.add(bel) diff --git a/tests/test_scripts/test_solph/test_generic_caes/test_generic_caes.py b/tests/test_scripts/test_solph/test_generic_caes/test_generic_caes.py index 1b2b78590..335e30964 100644 --- a/tests/test_scripts/test_solph/test_generic_caes/test_generic_caes.py +++ b/tests/test_scripts/test_solph/test_generic_caes/test_generic_caes.py @@ -98,7 +98,6 @@ def test_gen_caes(): fuel_input={bgas: Flow()}, electrical_output={bel_sink: Flow()}, params=concept, - fixed_costs=0, ) ) diff --git a/tests/test_solph_network_classes.py b/tests/test_solph_network_classes.py index bce095289..287c6740c 100644 --- a/tests/test_solph_network_classes.py +++ b/tests/test_solph_network_classes.py @@ -96,13 +96,14 @@ def test_invest_attribute_warning(): def test_fixed_costs_warning(): msg = ( "Be aware that the fixed costs attribute is only\n" - "meant to be used for multi-period models.\n" + "meant to be used for multi-period models to depict " + "fixed costs that occur on a yearly basis.\n" "If you wish to set up a multi-period model, explicitly " "set the `periods` attribute of your energy system.\n" "It has been decided to remove the `fixed_costs` " "attribute with v0.2 for regular uses.\n" "If you specify `fixed_costs` for a regular model, " - "it will simply be ignored." + "this will simply be silently ignored." ) with warnings.catch_warnings(record=True) as w: solph.flows.Flow(fixed_costs=34)