{prepare,solve}_network: Don't add a line volume limit for lv1.0
lv1.0 signifies lines being non-extendable!
This commit is contained in:
parent
de5916eb57
commit
8d70766e72
@ -45,6 +45,7 @@ def set_line_volume_limit(n, lv):
|
||||
n.lines['capital_cost'] = 0.
|
||||
n.links['capital_cost'] = 0.
|
||||
|
||||
if lv > 1.0:
|
||||
lines_s_nom = n.lines.s_nom.where(
|
||||
n.lines.type == '',
|
||||
np.sqrt(3) * n.lines.num_parallel *
|
||||
|
@ -181,7 +181,7 @@ def add_opts_constraints(n, opts=None):
|
||||
n.model.safe_peakdemand = pypsa.opt.Constraint(expr=sum(n.model.generator_p_nom[gen] for gen in ext_gens_i) >= peakdemand - exist_conv_caps)
|
||||
|
||||
def add_lv_constraint(n):
|
||||
line_volume = getattr(n, 'line_volume_limit')
|
||||
line_volume = getattr(n, 'line_volume_limit', None)
|
||||
if line_volume is not None and not np.isinf(line_volume):
|
||||
n.model.line_volume_constraint = pypsa.opt.Constraint(
|
||||
expr=((sum(n.model.passive_branch_s_nom["Line",line]*n.lines.at[line,"length"]
|
||||
|
Loading…
Reference in New Issue
Block a user