Skip to content

Commit

Permalink
Add test for activity_costs
Browse files Browse the repository at this point in the history
  • Loading branch information
p-snft committed Aug 13, 2024
1 parent c51e725 commit 40ef8ea
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/test_flows/test_non_convex_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,20 @@ def test_initial_status_on():
assert (flow_result["flow"][:-1] == 3 * [5] + 7 * [0]).all()


def test_activity_costs_start_on():
# activity costs higher then revenue for first time steps
flow = solph.flows.Flow(
nominal_value=10,
min=0.1,
max=[i * 0.1 for i in range(10)],
nonconvex=solph.NonConvex(activity_costs=1),
variable_costs=9 * [-0.45] + [10],
)
flow_result = _run_model(flow)["flow"][:-1]

assert (flow_result == [0, 0, 0, 3, 4, 5, 6, 7, 8, 0]).all()


def test_startup_costs_start_off():
price_pattern = [1, 1, 1, -4, 1, 1, 1, -4, 1, 1]

Expand Down

0 comments on commit 40ef8ea

Please sign in to comment.