From e27db0f462d02f9923d22d8346f648d46fc68709 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20H=C3=B6rsch?= Date: Fri, 9 Mar 2018 15:41:46 +0100 Subject: [PATCH] solve_network: Add noise to line and link capital costs --- scripts/solve_network.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/solve_network.py b/scripts/solve_network.py index 1ff68338..80b6f9ab 100644 --- a/scripts/solve_network.py +++ b/scripts/solve_network.py @@ -47,9 +47,12 @@ def prepare_network(n, solve_opts=None): if 'marginal_cost' in t.df: t.df['marginal_cost'] += 1e-2 + 2e-3*(np.random.random(len(t.df)) - 0.5) + for t in n.iterate_components(['Line', 'Link']): + t.df['capital_cost'] += (1e-1 + 2e-2*(np.random.random(len(t.df)) - 0.5)) * t.df['length'] + if solve_opts.get('nhours'): nhours = solve_opts['nhours'] - n = n[:solve_opts['nhours'], :] + n.set_snapshots(n.snapshots[:nhours]) n.snapshot_weightings[:] = 8760./nhours return n