Skip to content

Commit

Permalink
Revise formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jokochems committed Oct 6, 2023
1 parent f29af6d commit bbe4d04
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
14 changes: 6 additions & 8 deletions src/oemof/solph/components/_generic_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -1740,7 +1740,7 @@ def _objective_expression(self):
)
investment_costs_increment = (
self.invest[n, p] * annuity * present_value_factor
) * ((1 + m.discount_rate) ** (-m.es.periods_years[p]))
) * (1 + m.discount_rate) ** (-m.es.periods_years[p])
investment_costs += investment_costs_increment
period_investment_costs[p] += investment_costs_increment

Expand Down Expand Up @@ -1768,7 +1768,7 @@ def _objective_expression(self):
investment_costs_increment = (
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]))
) * (1 + m.discount_rate) ** (-m.es.periods_years[p])
investment_costs += investment_costs_increment
period_investment_costs[p] += investment_costs_increment

Expand All @@ -1783,24 +1783,22 @@ def _objective_expression(self):
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],
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(
end_of_optimization, lifetime - age
)
range_limit = min(end_of_optimization, lifetime - age)
fixed_costs += sum(
n.investment.existing
* n.investment.fixed_costs[pp]
* ((1 + m.discount_rate) ** (-pp))
* (1 + m.discount_rate) ** (-pp)
for pp in range(range_limit)
)

Expand Down
10 changes: 4 additions & 6 deletions src/oemof/solph/flows/_investment_flow_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -936,24 +936,22 @@ def _objective_expression(self):
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],
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(
end_of_optimization, lifetime - age
)
range_limit = min(end_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))
* (1 + m.discount_rate) ** (-pp)
for pp in range(range_limit)
)

Expand Down

0 comments on commit bbe4d04

Please sign in to comment.