Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
#optimisation results are stored here
state_of_charge = Series(default=np.nan, output=True)
#switch to disregard state_of_charge_initial; instead soc[-1] =
#soc[len(snapshots)-1]
cyclic_state_of_charge = Boolean(False)
#maximum state of charge capacity in terms of hours at full output capacity p_nom
max_hours = Float(1)
#the minimum power dispatch is negative
p_min_pu = Series(default=-1)
#in MW
inflow = Series()
spill = Series(output=True)
efficiency_store = Float(1)
efficiency_dispatch = Float(1)
#per hour per unit loss in state of charge
standing_loss = Float(0.)
class Store(Common):
"""Generic store, whose capacity may be optimised."""
list_name = "stores"
bus = String(default="")
sign = Float(default=1.)
#rated energy capacity
e_nom = Float(default=0.0)
#switch to allow energy capacity to be extended
e_nom_extendable = Boolean(False)
#technical potential
e_nom_max = Float(inf)
e_nom_min = Float(0.0)
#optimised capacity
e_nom_opt = Float(0.0)
e_max_pu = Series(default=1.)
e_min_pu = Series(default=0.)
e_cyclic = Boolean(False)
e_initial = Float(0.)
#cost of increasing e_nom
capital_cost = Float(0.0)
#cost of dispatching from the store
marginal_cost = Float(0.0)
#per hour per unit loss in state of charge
standing_loss = Float(0.)
#2-d location data (e.g. longitude and latitude; Spatial Reference System Identifier (SRID) set in network.srid)
x = Float(default=0.)
y = Float(default=0.)
p = Series(output=True)
q = Series(output=True)
v_mag_pu = Series(default=1., output=True)
v_ang = Series(output=True)
v_mag_pu_set = Series(default=1.)
v_mag_pu_min = Float(default=0.)
v_mag_pu_max = Float(default=inf)
#optimisation output for power balance constraint at bus
marginal_price = Series(output=True)
#energy carrier could be "AC", "DC", "heat", "gas"
carrier = String(default="AC")
sub_network = String(default="")
class SubStation(Common):
"""Placeholder for a group of buses."""
class Region(Common):
"""A group of buses such as a country or county."""
class OnePort(Common):
"""Object which attaches to a single bus (e.g. load or generator)."""
list_name = "buses"
v_nom = Float(default=1.)
#should be removed and set by program based on generators at bus
control = String(default="PQ",restricted=["PQ","PV","Slack"])
#2-d location data (e.g. longitude and latitude; Spatial Reference System Identifier (SRID) set in network.srid)
x = Float(default=0.)
y = Float(default=0.)
p = Series(output=True)
q = Series(output=True)
v_mag_pu = Series(default=1., output=True)
v_ang = Series(output=True)
v_mag_pu_set = Series(default=1.)
v_mag_pu_min = Float(default=0.)
v_mag_pu_max = Float(default=inf)
#optimisation output for power balance constraint at bus
marginal_price = Series(output=True)
#energy carrier could be "AC", "DC", "heat", "gas"
carrier = String(default="AC")
sub_network = String(default="")
class SubStation(Common):
class Bus(Common):
"""Electrically fundamental node where x-port objects attach."""
list_name = "buses"
v_nom = Float(default=1.)
#should be removed and set by program based on generators at bus
control = String(default="PQ",restricted=["PQ","PV","Slack"])
#2-d location data (e.g. longitude and latitude; Spatial Reference System Identifier (SRID) set in network.srid)
x = Float(default=0.)
y = Float(default=0.)
p = Series(output=True)
q = Series(output=True)
v_mag_pu = Series(default=1., output=True)
v_ang = Series(output=True)
v_mag_pu_set = Series(default=1.)
v_mag_pu_min = Float(default=0.)
v_mag_pu_max = Float(default=inf)
#optimisation output for power balance constraint at bus
marginal_price = Series(output=True)
#energy carrier could be "AC", "DC", "heat", "gas"
carrier = String(default="AC")
sub_network = String(default="")
efficiency_dispatch = Float(1)
#per hour per unit loss in state of charge
standing_loss = Float(0.)
class Store(Common):
"""Generic store, whose capacity may be optimised."""
list_name = "stores"
bus = String(default="")
sign = Float(default=1.)
p = Series(output=True)
q = Series(output=True)
e = Series(output=True)
p_set = Series()
q_set = Series()
#rated energy capacity
e_nom = Float(default=0.0)
#switch to allow energy capacity to be extended
e_nom_extendable = Boolean(False)
#technical potential
e_nom_max = Float(inf)
e_nom_min = Float(0.0)
#optimised capacity
s_nom = Float(0.)
s_nom_extendable = Boolean(False)
s_nom_max = Float(inf)
s_nom_min = Float(0.)
#optimised capacity
s_nom_opt = Float(0.)
#{p,q}i is positive if power is flowing from bus i into the branch
#so if power flows from bus0 to bus1, p0 is positive, p1 is negative
p0 = Series(output=True)
p1 = Series(output=True)
q0 = Series(output=True)
q1 = Series(output=True)
class Line(Branch):
"""Lines include distribution and transmission lines, overhead lines and cables."""
list_name = "lines"
#series impedance z = r + jx in Ohm
r = Float(0.)
x = Float(0.)
#shunt reactance y = g + jb in 1/Ohm
g = Float(0.)
b = Float(0.)
v_nom = Float(default=1.)
#should be removed and set by program based on generators at bus
control = String(default="PQ",restricted=["PQ","PV","Slack"])
#2-d location data (e.g. longitude and latitude; Spatial Reference System Identifier (SRID) set in network.srid)
x = Float(default=0.)
y = Float(default=0.)
p = Series(output=True)
q = Series(output=True)
v_mag_pu = Series(default=1., output=True)
v_ang = Series(output=True)
v_mag_pu_set = Series(default=1.)
v_mag_pu_min = Float(default=0.)
v_mag_pu_max = Float(default=inf)
#optimisation output for power balance constraint at bus
marginal_price = Series(output=True)
#energy carrier could be "AC", "DC", "heat", "gas"
carrier = String(default="AC")
sub_network = String(default="")
class SubStation(Common):
"""Placeholder for a group of buses."""
p_nom_max = Float(inf)
p_nom_min = Float(0.)
#optimised capacity
p_nom_opt = Float(0.)
#pi is positive if power is flowing from bus i into the branch
#so if power flows from bus0 to bus1, p0 is positive, p1 is negative
p0 = Series(output=True)
p1 = Series(output=True)
#limits per unit of p_nom
p_min_pu = Series(default=0.)
p_max_pu = Series(default=1.)
efficiency = Series(default=1.)
#The set point for p0.
p_set = Series()
length = Float(default=1.0)
terrain_factor = Float(default=1.0)
class ThreePort(Common):
"""Placeholder for 3-winding transformers."""
class ThreeTransformer(ThreePort):
pass
class LineType(Common):
"""Placeholder for future functionality to automatically generate line
parameters from standard parameters (e.g. r/km)."""
capital_cost = Float(0.)
s_nom = Float(0.)
s_nom_extendable = Boolean(False)
s_nom_max = Float(inf)
s_nom_min = Float(0.)
#optimised capacity
s_nom_opt = Float(0.)
#{p,q}i is positive if power is flowing from bus i into the branch
#so if power flows from bus0 to bus1, p0 is positive, p1 is negative
p0 = Series(output=True)
p1 = Series(output=True)
q0 = Series(output=True)
q1 = Series(output=True)
class Line(Branch):
"""Lines include distribution and transmission lines, overhead lines and cables."""
list_name = "lines"
#series impedance z = r + jx in Ohm
r = Float(0.)
x = Float(0.)
#shunt reactance y = g + jb in 1/Ohm
g = Float(0.)