Skip to content

Commit

Permalink
Remove internal interest rate
Browse files Browse the repository at this point in the history
  • Loading branch information
p-snft committed Dec 17, 2024
1 parent 7b4392e commit 3130ee5
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 30 deletions.
4 changes: 0 additions & 4 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1199,8 +1199,6 @@ but with a few minor additions and modifications in the investment object itself
free to reinvest or choose another option to fill up the missing capacity.
* You can define an initial `age` if you have `existing` capacity. If you do not specify anything, the default value 0 will be used,
meaning your `existing` capacity has just been newly invested.
* You can define an `interest_rate` that the investor you model has, i.e. the return he desires expressed as the weighted
average osts of capital (wacc) and used for calculating annuities in the model itself.
* You also can define `fixed_costs`, i.e. costs that occur every period independent of the plants usage.
Here is an example
Expand All @@ -1216,7 +1214,6 @@ Here is an example
maximum=1000,
ep_costs=1e6,
lifetime=30,
interest_rate=0.06,
fixed_costs=100,
),
variable_costs=3,
Expand Down Expand Up @@ -1250,7 +1247,6 @@ This would mean that for investments in the particular period, these values woul
maximum=1000,
ep_costs=[1e6, 1.1e6],
lifetime=30,
interest_rate=0.06,
fixed_costs=[100, 110],
),
variable_costs=3,
Expand Down
7 changes: 0 additions & 7 deletions src/oemof/solph/_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,6 @@ class Investment:
age : int, :math:`a`
Units start age, given in years at the beginning of the optimization;
only applicable for multi-period models
interest_rate : float, :math:`ir`
Interest rate for calculating annuities when investing in a particular
unit; only applicable for multi-period models.
If nothing else is specified, the interest rate is the same as the
model discount rate of the multi-period model.
fixed_costs : float or list of float, :math:`c_{fixed}(p)`
Fixed costs in each period (given in nominal terms);
only applicable for multi-period models
Expand Down Expand Up @@ -95,7 +90,6 @@ def __init__(
overall_minimum=None,
lifetime=None,
age=0,
interest_rate=0,
fixed_costs=None,
custom_attributes=None,
):
Expand All @@ -111,7 +105,6 @@ def __init__(
self.overall_minimum = overall_minimum
self.lifetime = lifetime
self.age = age
self.interest_rate = interest_rate
self.fixed_costs = sequence(fixed_costs)

for attribute in custom_attributes.keys():
Expand Down
6 changes: 2 additions & 4 deletions src/oemof/solph/components/_generic_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -1087,8 +1087,6 @@ class GenericInvestmentStorageBlock(ScalarBlock):
Lifetime for investments in storage capacity"
":math:`a`", "`flows[i, o].investment.age`", "
Initial age of existing capacity / energy"
":math:`ir`", "`flows[i, o].investment.interest_rate`", "
interest rate for investment"
":math:`\tau(t)`", "", "Duration of time step"
":math:`t_u`", "", "Time unit of losses :math:`\beta(t)`,
:math:`\gamma(t)`, :math:`\delta(t)` and timeincrement :math:`\tau(t)`"
Expand Down Expand Up @@ -1776,7 +1774,7 @@ def _objective_expression(self):
)
for n in self.CONVEX_INVESTSTORAGES:
lifetime = n.investment.lifetime
interest = n.investment.interest_rate
interest = 0
if interest == 0:
warn(
msg.format(m.discount_rate),
Expand Down Expand Up @@ -1816,7 +1814,7 @@ def _objective_expression(self):

for n in self.NON_CONVEX_INVESTSTORAGES:
lifetime = n.investment.lifetime
interest = n.investment.interest_rate
interest = 0
if interest == 0:
warn(
msg.format(m.discount_rate),
Expand Down
6 changes: 3 additions & 3 deletions src/oemof/solph/components/experimental/_sink_dsm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1369,7 +1369,7 @@ def _objective_expression(self):
for g in self.investdsm:
if g.investment.ep_costs is not None:
lifetime = g.investment.lifetime
interest = g.investment.interest_rate
interest = 0
if interest == 0:
warn(
msg.format(m.discount_rate),
Expand Down Expand Up @@ -3203,7 +3203,7 @@ def _objective_expression(self):
for g in self.investdsm:
if g.investment.ep_costs is not None:
lifetime = g.investment.lifetime
interest = g.investment.interest_rate
interest = 0
if interest == 0:
warn(
msg.format(m.discount_rate),
Expand Down Expand Up @@ -5675,7 +5675,7 @@ def _objective_expression(self):
for g in self.INVESTDR:
if g.investment.ep_costs is not None:
lifetime = g.investment.lifetime
interest = g.investment.interest_rate
interest = 0
if interest == 0:
warn(
msg.format(m.discount_rate),
Expand Down
4 changes: 2 additions & 2 deletions src/oemof/solph/flows/_investment_flow_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ def _objective_expression(self):
)
for i, o in self.CONVEX_INVESTFLOWS:
lifetime = m.flows[i, o].investment.lifetime
interest = m.flows[i, o].investment.interest_rate
interest = 0
if interest == 0:
warn(
msg.format(m.discount_rate),
Expand Down Expand Up @@ -964,7 +964,7 @@ def _objective_expression(self):

for i, o in self.NON_CONVEX_INVESTFLOWS:
lifetime = m.flows[i, o].investment.lifetime
interest = m.flows[i, o].investment.interest_rate
interest = 0
if interest == 0:
warn(
msg.format(m.discount_rate),
Expand Down
2 changes: 0 additions & 2 deletions tests/test_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ def test_nodes_with_none_exclusion(self):
"initial_storage_level": 0,
"investment_age": 0,
"investment_existing": 0,
"investment_interest_rate": 0,
"investment_nonconvex": False,
"investment_ep_costs": 0.4,
"investment_maximum": float("inf"),
Expand Down Expand Up @@ -206,7 +205,6 @@ def test_nodes_with_none_exclusion_old_name(self):
"initial_storage_level": 0,
"investment_age": 0,
"investment_existing": 0,
"investment_interest_rate": 0,
"investment_nonconvex": False,
"investment_ep_costs": 0.4,
"investment_maximum": float("inf"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ def test_multi_period_investment_model(solver="cbc"):
existing=0,
lifetime=20,
age=0,
interest_rate=0.02,
),
variable_costs=1,
)
Expand All @@ -172,7 +171,6 @@ def test_multi_period_investment_model(solver="cbc"):
existing=0,
lifetime=20,
age=0,
interest_rate=0.02,
),
variable_costs=2,
)
Expand All @@ -191,7 +189,6 @@ def test_multi_period_investment_model(solver="cbc"):
existing=0,
lifetime=20,
age=0,
interest_rate=0.02,
),
variable_costs=3,
)
Expand All @@ -210,7 +207,6 @@ def test_multi_period_investment_model(solver="cbc"):
existing=0,
lifetime=20,
age=0,
interest_rate=0.02,
fixed_costs=1000,
),
variable_costs=4,
Expand All @@ -231,7 +227,6 @@ def test_multi_period_investment_model(solver="cbc"):
existing=10,
lifetime=2,
age=1,
interest_rate=0.02,
),
)
},
Expand All @@ -245,7 +240,6 @@ def test_multi_period_investment_model(solver="cbc"):
existing=10,
lifetime=2,
age=1,
interest_rate=0.02,
),
)
},
Expand All @@ -265,7 +259,6 @@ def test_multi_period_investment_model(solver="cbc"):
existing=10,
lifetime=2,
age=1,
interest_rate=0.02,
fixed_costs=10,
),
)
Expand Down Expand Up @@ -335,7 +328,6 @@ def test_multi_period_investment_model(solver="cbc"):
ep_costs=10,
lifetime=2,
age=1,
interest_rate=0.02,
),
)

Expand Down

0 comments on commit 3130ee5

Please sign in to comment.