Skip to content

Latest commit

 

History

History
585 lines (507 loc) · 31.3 KB

variables.rst

File metadata and controls

585 lines (507 loc) · 31.3 KB

urbs

Variables

All the variables that the optimization model requires to calculate an optimal solution will be listed and defined in this section. A variable is a numerical value that is determined during optimization. Variables can denote a single, independent value, or an array of values. Variables define the search space for optimization. Variables of this optimization model can be separated into sections by their area of use. These Sections are Cost, Commodity, Process, Transmission, Storage and demand side management.

Table: Model Variables
Variable Unit Description
Cost Variables
ζ Total System Cost
ζinv Investment Costs
ζfix Fix Costs
ζvar Variable Costs
ζfuel Fuel Costs
ζrev Revenue Costs
ζpur Purchase Costs
ζstart Start Costs
Commodity Variables
ρyvct MWh Stock Commodity Source Term
𝜚yvct MWh Sell Commodity Source Term
ψyvct MWh Buy Commodity Source Term
Process Variables
κyvp MW Total Process Capacity
κ̂yvp MW New Process Capacity
βyvp
New Process Capacity Units
τyvpt MWh Process Throughput
ϵyvcptin MWh Process Input Commodity Flow
ϵyvcptout MWh Process Output Commodity Flow
$\omicron_{yvpt}$
Process On/Off Marker
σyvpt
Process Start-up Marker
Transmission Variables
κyaf MW Total transmission Capacity
κ̂yaf MW New Transmission Capacity
βyaf
New Transmission Capacity Units
πyaftin MWh Transmission Input Commodity Flow
πyaftout MWh Transmission Output Commodity Flow
DCPF Transmission Variables
θyvt deg. Voltage Angle
πyaftin MW Absolute Transmission Flow
Storage Variables
κyvsc MWh Total Storage Size
κ̂yvsc MWh New Storage Size
βyvsc
New Storage Size Units
κyvsp MW Total Storage Power
κ̂yvsp MW New Storage Power
βyvsc
New Storage Power Units
ϵyvstin MWh Storage Input Commodity Flow
ϵyvstout MWh Storage Output Commodity Flow
ϵyvstcon MWh Storage Energy Content
Demand Side Management Variables
δyvctup MWh DSM Upshift
δt, tt, yvcdown MWh DSM Downshift

Cost Variables

Total System Cost, ζ : the variable ζ represents the total expense incurred in reaching the satisfaction of the given energy demand in the entire modeling horizon. If only a fraction of a year is modeled in each support timeframe, the costs are scaled to the annual expenditures. The total cost is calculated by the sum total of all costs by type(ζr, r ∈ R) and defined as costs by the following code fragment:

m.costs = pyomo.Var(
    m.cost_type,
    within=pyomo.Reals,
    doc='Costs by type (EUR/a)')

System costs are divided into the 7 cost types invest, fix, variable, fuel, purchase, sell and environmental. The separation of costs by type, facilitates business planning and provides calculation accuracy. These cost types are hardcoded, which means they are not considered to be fixed or changed by the user.

For more information on the definition of these variables see section theory-min and for their implementation see section objective.

Commodity Variables

Stock Commodity Source Term, ρyvct, e_co_stock, MWh : The variable ρyvct represents the energy amount in [MWh] that is being used by the system of commodity c from type stock (c ∈ Cstock) in support timeframe y (y ∈ Y) in a site v (v ∈ V) at timestep t (t ∈ Tm). In script model.py this variable is defined by the variable e_co_stock and initialized by the following code fragment: :

m.e_co_stock = pyomo.Var(
    m.tm, m.com_tuples,
    within=pyomo.NonNegativeReals,
    doc='Use of stock commodity source (MWh) at a given timestep')

Sell Commodity Source Term, 𝜚yvct, e_co_sell, MWh : The variable 𝜚yvct represents the energy amount in [MWh] that is being used by the system of commodity c from type sell (c ∈ Csell) in support timeframe y (y ∈ Y) in a site v (v ∈ V) at timestep t (t ∈ Tm). In script model.py this variable is defined by the variable e_co_sell and initialized by the following code fragment: :

m.e_co_sell = pyomo.Var(
    m.tm, m.com_tuples,
    within=pyomo.NonNegativeReals,
    doc='Use of sell commodity source (MWh) at a given timestep')

Buy Commodity Source Term, ψyvct, e_co_buy, MWh : The variable ψyvct represents the energy amount in [MWh] that is being used by the system of commodity c from type buy (c ∈ Cbuy) in support timeframe y (y ∈ Y) in a site v (v ∈ V) at timestep t (t ∈ Tm). In script model.py this variable is defined by the variable e_co_buy and initialized by the following code fragment: :

m.e_co_buy = pyomo.Var(
   m.tm, m.com_tuples,
   within=pyomo.NonNegativeReals,
   doc='Use of buy commodity source (MWh) at a given timestep')

Process Variables

Total Process Capacity, κyvp, cap_pro: The variable κyvp represents the total potential throughput (capacity) of a process tuple pyv (p ∈ P, ∀v ∈ V, forall y in Y`), that is required in the energy system. The total process capacity includes both the already installed process capacity and the additional new process capacity that needs to be installed. Since the costs of the process technologies are mostly directly proportional to the maximum possible output (and correspondingly to the capacity) of processes, this variable acts as a scale factor of process technologies. For further information see Process Capacity Rule. This variable is expressed in the unit (MW). In script model.py this variable is defined by the model variable cap_pro and initialized by the following code fragment: :

m.cap_pro = pyomo.Var(
    m.pro_tuples,
    within=pyomo.NonNegativeReals,
    doc='Total process capacity (MW)')

New Process Capacity, κ̂yvp, cap_pro_new: The variable κ̂yvp represents the capacity of a process tuple pyv (p ∈ P, ∀v ∈ V) that needs to be installed additionally to the energy system in support timeframe y in site v in order to provide the optimal solution. This variable is expressed in the unit MW. In script model.py this variable is defined by the model variable cap_pro_new and initialized by the following code fragment: :

m.cap_pro_new = pyomo.Var(
    m.pro_tuples,
    within=pyomo.NonNegativeReals,
    doc='New process capacity (MW)')

New Process Capacity Units, βyvp, pro_cap_unit: The variable βyvp represents the number of capacity blocks of a process tuple pyv (p ∈ P, ∀v ∈ V) that needs to be installed additionally to the energy system in support timeframe y in site v in order to provide the optimal solution. In script model.py this variable is defined by the model variable cap_pro_new and initialized by the following code fragment: :

m.pro_cap_unit = pyomo.Var(
    m.pro_tuples,
    within=pyomo.NonNegativeIntegers,
    doc='Number of newly installed capacity units')

Process Throughput, τyvpt, tau_pro : The variable τyvpt represents the measure of (energetic) activity of a process tuple pyv (p ∈ P, ∀v ∈ V, ∀y ∈ Y) at a timestep t (t ∈ Tm). Based on the process throughput amount in a given timestep of a process, flow amounts of the process' input and output commodities at that timestep can be calculated by scaling the process throughput with corresponding process input and output ratios. For further information see Process Input Ratio and Process Output Ratio. The process throughput variable is expressed in the unit MWh. In script model.py this variable is defined by the model variable tau_pro and initialized by the following code fragment: :

m.tau_pro = pyomo.Var(
    m.tm, m.pro_tuples,
    within=pyomo.NonNegativeReals,
    doc='Activity (MWh) through process')

Process Input Commodity Flow, ϵyvcptin, e_pro_in: The variable ϵyvcptin represents the commodity input flow into a process tuple pyv (p ∈ P, ∀v ∈ V, ∀y ∈ Y) caused by an input commodity c (c ∈ C) at a timestep t (t ∈ Tm). This variable is generally expressed in the unit MWh. In script model.py this variable is defined by the model variable e_pro_in and initialized by the following code fragment: :

m.e_pro_in = pyomo.Var(
    m.tm, m.pro_tuples, m.com,
    within=pyomo.NonNegativeReals,
    doc='Flow of commodity into process at a given timestep')

Process Output Commodity Flow, ϵyvcptout, e_pro_out: The variable ϵvcptout represents the commodity flow output out of a process tuple pyv (p ∈ P, ∀v ∈ V, ∀y ∈ Y) caused by an output commodity c (c ∈ C) at a timestep t (t ∈ Tm). This variable is generally expressed in the unit MWh (or tonnes e.g. for the environmental commodity 'CO2'). In script model.py this variable is defined by the model variable e_pro_out and initialized by the following code fragment: :

m.e_pro_out = pyomo.Var(
    m.tm, m.pro_tuples, m.com,
    within=pyomo.NonNegativeReals,
    doc='Flow of commodity out of process at a given timestep')

Process On/Off Marker, $\omicron_{yvpt}$, on_off: The boolean variable $\omicron_{yvpt}$ marks whether process tuple pyv (p ∈ Pon/off, ∀v ∈ V, ∀y ∈ Y) is on and producing ($\omicron_{yvpt}$ is 1) or it is not producing ($\omicron_{yvpt}$ is 0) at a timestep t. While not producing, the process is either turned off or it started, without reaching the minimum fraction $\underline{P}_{yvp}$. In the script AdvancedProcesses.py, this variable is defined by the model variable on_off and initialized by the following code fragment: :

m.on_off = pyomo.Var(
    m.t, m.pro_on_off_tuples,
    within=pyomo.Boolean,
    doc='Turn on/off a process with minimum working load')

Process Start-up Marker, σyvpt, start_ups: The boolean variable σyvpt marks whether process tuple pyv (p ∈ Pon/off, ∀v ∈ V, ∀y ∈ Y) is starting (σyvpt becomes 1) or not (σyvpt is 0) at a timestep t. The process is considered to start when its output e_pro_out becomes greater than 0. In the script AdvancedProcesses.py, this variable is defined by the model variable start_ups and initialized by the following code fragment: :

m.start_up = pyomo.Var(
        m.tm, m.pro_start_up_tuples,
        within=pyomo.Boolean,
        doc='Start-up marker')

Transmission Variables

Total Transmission Capacity, κyaf, cap_tra: The variable κyaf represents the total potential transfer power of a transmission tuple fyca, where a represents the arc from an origin site vout to a destination site vin. The total transmission capacity includes both the already installed transmission capacity and the additional new transmission capacity that needs to be installed. This variable is expressed in the unit MW. In script transmission.py this variable is defined by the model variable cap_tra and initialized by the following code fragment: :

m.cap_tra = pyomo.Var(
    m.tra_tuples,
    within=pyomo.NonNegativeReals,
    doc='Total transmission capacity (MW)')

New Transmission Capacity, κ̂yaf, cap_tra_new: The variable κ̂yaf represents the additional capacity, that needs to be installed, of a transmission tuple fyca, where a represents the arc from an origin site vout to a destination site vin. This variable is expressed in the unit MW. In script transmission.py this variable is defined by the model variable cap_tra_new and initialized by the following code fragment: :

m.cap_tra_new = pyomo.Var(
    m.tra_tuples,
    within=pyomo.NonNegativeReals,
    doc='New transmission capacity (MW)')

New Transmission Capacity Units, βyaf, tra_cap_unit: The variable βyaf represents the number of additional capacity blocks of a transmission tuple fyca that need to be installed , where a represents the arc from an origin site vout to a destination site vin. In script transmission.py this variable is defined by the model variable cap_tra_new and initialized by the following code fragment: :

m.tra_cap_unit =pyomo.Var(
    m.tra_block_tuples,
    within=pyomo.NonNegativeIntegers,
    doc='New transmission capacity blocks')

Transmission Input Commodity Flow, πyaftin, e_tra_in: The variable πyaftin represents the commodity flow input into a transmission tuple fyca at a timestep t, where a represents the arc from an origin site vout to a destination site vin. This variable is expressed in the unit MWh. In script urbs.py this variable is defined by the model variable e_tra_in and initialized by the following code fragment: :

m.e_tra_in = pyomo.Var(
    m.tm, m.tra_tuples,
    within=pyomo.NonNegativeReals,
    doc='Commodity flow into transmission line (MWh) at a given timestep')

Transmission Output Commodity Flow, πyaftout, e_tra_out: The variable πyaftout represents the commodity flow output out of a transmission tuple fca at a timestep t, where a represents the arc from an origin site vout to a destination site vin. This variable is expressed in the unit MWh. In script urbs.py this variable is defined by the model variable e_tra_out and initialized by the following code fragment: :

m.e_tra_out = pyomo.Var(
    m.tm, m.tra_tuples,
    within=pyomo.NonNegativeReals,
    doc='Power flow out of transmission line (MWh) at a given timestep')

DCPF Transmission Variables

If the DC Power Flow transmission modelling is activated, two new variables are introduced to the model.

Voltage Angle, θyvt, voltage_angle: The variable θyvt represents the voltage angle of a site v, which has a DCPF transmission line connection, at a timestep t. This variable is expressed in the unit degrees. In script urbs.py this variable is defined by the model variable voltage_angle and initialized by the following code fragment: :

m.voltage_angle = pyomo.Var(
        m.tm, m.stf, m.sit,
        within=pyomo.Reals,
        doc='Voltage angle of a site')

Absolute Value of Transmission Commodity Flow, πyaftin, e_tra_abs: The variable πyaftin represents the absolute value of the transmission commodity flow on a DCPF transmission tuple fyca at a timestep t, where a represents the arc from an origin site vout to a destination site vin. This variable is expressed in the unit MWh. In script urbs.py this variable is defined by the model variable e_tra_abs and initialized by the following code fragment: :

m.e_tra_abs = pyomo.Var(
    m.tm, m.tra_tuples_dc,
    within=pyomo.NonNegativeReals,
    doc='Absolute power flow on transmission line (MW) per timestep')

Transmission Commodity Flow Domain Changes :DC Power Flow transmission lines are represented by bidirectional single arcs instead of unidirectional symmetrical arcs as in the default transmission model. Consequently the power flow is allowed to be both positive or negative for DCPF transmission lines contrary to the transport transmission lines. For this reason, the domains of the variables transmission input commodity flow πyaftin and transmission output commodity flow πyaftout are defined with the :pye_tra_domain_rule function depending on the corresponding transmission tuple set. These variables are defined by the model variables e_tra_in and e_tra_out and intialized by the code fragment: :

m.e_tra_in = pyomo.Var(
    m.tm, m.tra_tuples,
    within=e_tra_domain_rule,
    doc='Power flow into transmission line (MW) per timestep')
m.e_tra_out = pyomo.Var(
    m.tm, m.tra_tuples,
    within=e_tra_domain_rule,
    doc='Power flow out of transmission line (MW) per timestep')

The function :pye_tra_domain_rule is given by the code fragment: :

def e_tra_domain_rule(m, tm, stf, sin, sout, tra, com):
    # assigning e_tra_in and e_tra_out variable domains for transport and DCPF
    if (stf, sin, sout, tra, com) in m.tra_tuples_dc:
        return pyomo.Reals
    elif (stf, sin, sout, tra, com) in m.tra_tuples_tp:
        return pyomo.NonNegativeReals

Storage Variables

Total Storage Size, κyvsc, cap_sto_c: The variable κyvsc represents the total load capacity of a storage tuple syvc. The total storage load capacity includes both the already installed storage load capacity and the additional new storage load capacity that needs to be installed. This variable is expressed in unit MWh. In script model.py this variable is defined by the model variable cap_sto_c and initialized by the following code fragment: :

m.cap_sto_c = pyomo.Var(
    m.sto_tuples,
    within=pyomo.NonNegativeReals,
    doc='Total storage size (MWh)')

New Storage Size, κ̂yvsc, cap_sto_c_new: The variable κ̂yvsc represents the additional storage load capacity of a storage tuple svc that needs to be installed to the energy system in order to provide the optimal solution. This variable is expressed in the unit MWh. In script model.py this variable is defined by the model variable cap_sto_c_new and initialized by the following code fragment: :

m.cap_sto_c_new = pyomo.Var(
    m.sto_tuples,
    within=pyomo.NonNegativeReals,
    doc='New storage size (MWh)')

New Storage Size Units, βyvsc, sto_cap_c_unit: The variable κ̂yvsc represents the number of additional storage load capacity blocks of a storage tuple svc that needs to be installed to the energy system in order to provide the optimal solution. In script storage.py this variable is defined by the model variable cap_sto_c_unit and initialized by the following code fragment: :

m.sto_cap_c_unit = pyomo.Var(
    m.sto_block_c_tuples,
    within=pyomo.NonNegativeIntegers,
    doc='New storage size units')

Total Storage Power, κyvsp, cap_sto_p: The variable κyvsp represents the total potential discharge power of a storage tuple svc. The total storage power includes both the already installed storage power and the additional new storage power that needs to be installed. This variable is expressed in the unit MW. In script model.py this variable is defined by the model variable cap_sto_p and initialized by the following code fragment: :

m.cap_sto_p = pyomo.Var(
    m.sto_tuples,
    within=pyomo.NonNegativeReals,
    doc='Total storage power (MW)')

New Storage Power, κ̂yvsp, cap_sto_p_new: The variable κ̂yvsp represents the additional potential discharge power of a storage tuple svc that needs to be installed to the energy system in order to provide the optimal solution. This variable is expressed in the unit MW. In script model.py this variable is defined by the model variable cap_sto_p_new and initialized by the following code fragment: :

m.cap_sto_p_new = pyomo.Var(
    m.sto_tuples,
    within=pyomo.NonNegativeReals,
    doc='New  storage power (MW)')

New Storage Power Units, βyvsc, sto_cap_p_unit: The variable βyvsc represents the number of additional potential discharge power blocks of a storage tuple svc that needs to be installed to the energy system in order to provide the optimal solution. In the script storage.py this variable is defined by the model variable sto_cap_p_unit and initialized by the following code fragment: :

m.sto_cap_p_unit = pyomo.Var(
    m.sto_block_p_tuples,
    within=pyomo.NonNegativeIntegers,
    doc='New storage power units')

Storage Input Commodity Flow, ϵyvstin, e_sto_in: The variable ϵyvstin represents the input commodity flow into a storage tuple syvc at a timestep t. Input commodity flow into a storage tuple can also be defined as the charge of a storage tuple. This variable is expressed in the unit MWh. In script model.py this variable is defined by the model variable e_sto_in and initialized by the following code fragment: :

m.e_sto_in = pyomo.Var(
    m.tm, m.sto_tuples,
    within=pyomo.NonNegativeReals,
    doc='Commodity flow into storage (MWh) at a given timestep')

Storage Output Commodity Flow, ϵyvstout, e_sto_out: The variable ϵvstout represents the output commodity flow out of a storage tuple syvc at a timestep t. Output commodity flow out of a storage tuple can also be defined as the discharge of a storage tuple. This variable is expressed in the unit MWh. In script model.py this variable is defined by the model variable e_sto_out and initialized by the following code fragment: :

m.e_sto_out = pyomo.Var(
    m.tm, m.sto_tuples,
    within=pyomo.NonNegativeReals,
    doc='Commodity flow out of storage (MWh) at a given timestep')

Storage Energy Content, ϵyvstcon, e_sto_con: The variable ϵyvstcon represents the energy amount that is loaded in a storage tuple svc at a timestep t. This variable is expressed in the unit MWh. In script urbs.py this variable is defined by the model variable e_sto_out and initialized by the following code fragment: :

m.e_sto_con = pyomo.Var(
    m.t, m.sto_tuples,
    within=pyomo.NonNegativeReals,
    doc='Energy content of storage (MWh) at a given timestep')

Demand Side Management Variables

DSM Upshift, δyvctup, dsm_up, MWh: The variable δyvctup represents the DSM upshift in time step t in support timeframe y in site v for commodity c. It is only defined for all dsm_site_tuples. The following code fragment shows the definition of the variable: :

m.dsm_up = pyomo.Var(
    m.tm, m.dsm_site_tuples,
    within=pyomo.NonNegativeReals,
    doc='DSM upshift (MWh) of a demand commodity at a given timestap')

DSM Downshift, δt, tt, yvcdown, dsm_down, MWh: The variable δt, tt, yvcdown represents the DSM downshift in timestep tt caused by the upshift in time t in support timeframe y in site v for commodity c. The special combinations of timesteps t and tt for each (support timeframe, site, commodity) combination is created by the dsm_down_tuples. The definition of the variable is shown in the code fragment: :

m.dsm_down = pyomo.Var(
    m.dsm_down_tuples,
    within=pyomo.NonNegativeReals,
    doc='DSM downshift (MWh) of a demand commodity at a given timestep')