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
\(\zeta\) Total System Cost
\(\zeta_\text{inv}\) Investment Costs
\(\zeta_\text{fix}\) Fix Costs
\(\zeta_\text{var}\) Variable Costs
\(\zeta_\text{fuel}\) Fuel Costs
\(\zeta_\text{rev}\) Revenue Costs
\(\zeta_\text{pur}\) Purchase Costs
Commodity Variables
\(\rho_{yvct}\) MWh Stock Commodity Source Term
\(\varrho_{yvct}\) MWh Sell Commodity Source Term
\(\psi_{yvct}\) MWh Buy Commodity Source Term
Process Variables
\(\kappa_{yvp}\) MW Total Process Capacity
\(\hat{\kappa}_{yvp}\) MW New Process Capacity
\(\tau_{yvpt}\) MWh Process Throughput
\(\epsilon_{yvcpt}^\text{in}\) MWh Process Input Commodity Flow
\(\epsilon_{yvcpt}^\text{out}\) MWh Process Output Commodity Flow
Transmission Variables
\(\kappa_{yaf}\) MW Total transmission Capacity
\(\hat{\kappa}_{yaf}\) MW New Transmission Capacity
\(\pi_{yaft}^\text{in}\) MWh Transmission Input Commodity Flow
\(\pi_{yaft}^\text{out}\) MWh Transmission Output Commodity Flow
Storage Variables
\(\kappa_{yvs}^\text{c}\) MWh Total Storage Size
\(\hat{\kappa}_{yvs}^\text{c}\) MWh New Storage Size
\(\kappa_{yvs}^\text{p}\) MW Total Storage Power
\(\hat{\kappa}_{yvs}^\text{p}\) MW New Storage Power
\(\epsilon_{yvst}^\text{in}\) MWh Storage Input Commodity Flow
\(\epsilon_{yvst}^\text{out}\) MWh Storage Output Commodity Flow
\(\epsilon_{yvst}^\text{con}\) MWh Storage Energy Content
Demand Side Management Variables
\(\delta_{yvct}^\text{up}\) MWh DSM Upshift
\(\delta_{t,tt,yvc}^\text{down}\) MWh DSM Downshift

Cost Variables

Total System Cost, \(\zeta\) : the variable \(\zeta\) 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(\(\zeta_r\), \(\forall r \in 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 Minimal optimization model and for their implementation see section Objective function.

Commodity Variables

Stock Commodity Source Term, \(\rho_{yvct}\), e_co_stock, MWh : The variable \(\rho_{yvct}\) represents the energy amount in [MWh] that is being used by the system of commodity \(c\) from type stock (\(\forall c \in C_\text{stock}\)) in support timeframe \(y\) (\(\forall y \in Y\)) in a site \(v\) (\(\forall v \in V\)) at timestep \(t\) (\(\forall t \in T_\text{m}\)). 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, \(\varrho_{yvct}\), e_co_sell, MWh : The variable \(\varrho_{yvct}\) represents the energy amount in [MWh] that is being used by the system of commodity \(c\) from type sell (\(\forall c \in C_\text{sell}\)) in support timeframe \(y\) (\(\forall y \in Y\)) in a site \(v\) (\(\forall v \in V\)) at timestep \(t\) (\(\forall t \in T_\text{m}\)). 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, \(\psi_{yvct}\), e_co_buy, MWh : The variable \(\psi_{yvct}\) represents the energy amount in [MWh] that is being used by the system of commodity \(c\) from type buy (\(\forall c \in C_\text{buy}\)) in support timeframe \(y\) (\(\forall y \in Y\)) in a site \(v\) (\(\forall v \in V\)) at timestep \(t\) (\(\forall t \in T_\text{m}\)). 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, \(\kappa_{yvp}\), cap_pro: The variable \(\kappa_{yvp}\) represents the total potential throughput (capacity) of a process tuple \(p_{yv}\) (\(\forall p \in P, \forall v \in 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, \(\hat{\kappa}_{yvp}\), cap_pro_new: The variable \(\hat{\kappa}_{yvp}\) represents the capacity of a process tuple \(p_{yv}\) (\(\forall p \in P, \forall v \in 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)')

Process Throughput, \(\tau_{yvpt}\), tau_pro : The variable \(\tau_{yvpt}\) represents the measure of (energetic) activity of a process tuple \(p_{yv}\) (\(\forall p \in P, \forall v \in V, \forall y \in Y\)) at a timestep \(t\) (\(\forall t \in T_{m}\)). 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, \(\epsilon_{yvcpt}^\text{in}\), e_pro_in: The variable \(\epsilon_{yvcpt}^\text{in}\) represents the commodity input flow into a process tuple \(p_{yv}\) (\(\forall p \in P, \forall v \in V, \forall y \in Y\)) caused by an input commodity \(c\) (\(\forall c \in C\)) at a timestep \(t\) (\(\forall t \in T_{m}\)). 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, \(\epsilon_{yvcpt}^\text{out}\), e_pro_out: The variable \(\epsilon_{vcpt}^\text{out}\) represents the commodity flow output out of a process tuple \(p_{yv}\) (\(\forall p \in P, \forall v \in V, \forall y \in Y\)) caused by an output commodity \(c\) (\(\forall c \in C\)) at a timestep \(t\) (\(\forall t \in T_{m}\)). 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')

Transmission Variables

Total Transmission Capacity, \(\kappa_{yaf}\), cap_tra: The variable \(\kappa_{yaf}\) represents the total potential transfer power of a transmission tuple \(f_{yca}\), where \(a\) represents the arc from an origin site \(v_\text{out}\) to a destination site \({v_\text{in}}\). 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 model.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, \(\hat{\kappa}_{yaf}\), cap_tra_new: The variable \(\hat{\kappa}_{yaf}\) represents the additional capacity, that needs to be installed, of a transmission tuple \(f_{yca}\), where \(a\) represents the arc from an origin site \(v_\text{out}\) to a destination site \(v_\text{in}\). This variable is expressed in the unit MW. In script model.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)')

Transmission Input Commodity Flow, \(\pi_{yaft}^\text{in}\), e_tra_in: The variable \(\pi_{yaft}^\text{in}\) represents the commodity flow input into a transmission tuple \(f_{yca}\) at a timestep \(t\), where \(a\) represents the arc from an origin site \(v_\text{out}\) to a destination site \(v_\text{in}\). 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, \(\pi_{yaft}^\text{out}\), e_tra_out: The variable \(\pi_{yaft}^\text{out}\) represents the commodity flow output out of a transmission tuple \(f_{ca}\) at a timestep \(t\), where \(a\) represents the arc from an origin site \(v_\text{out}\) to a destination site \(v_\text{in}\). 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')

Storage Variables

Total Storage Size, \(\kappa_{yvs}^\text{c}\), cap_sto_c: The variable \(\kappa_{yvs}^\text{c}\) represents the total load capacity of a storage tuple \(s_{yvc}\). 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, \(\hat{\kappa}_{yvs}^\text{c}\), cap_sto_c_new: The variable \(\hat{\kappa}_{yvs}^\text{c}\) represents the additional storage load capacity of a storage tuple \(s_{vc}\) 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)')

Total Storage Power, \(\kappa_{yvs}^\text{p}\), cap_sto_p: The variable \(\kappa_{yvs}^\text{p}\) represents the total potential discharge power of a storage tuple \(s_{vc}\). 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, \(\hat{\kappa}_{yvs}^\text{p}\), cap_sto_p_new: The variable \(\hat{\kappa}_{yvs}^\text{p}\) represents the additional potential discharge power of a storage tuple \(s_{vc}\) 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)')

Storage Input Commodity Flow, \(\epsilon_{yvst}^\text{in}\), e_sto_in: The variable \(\epsilon_{yvst}^\text{in}\) represents the input commodity flow into a storage tuple \(s_{yvc}\) 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, \(\epsilon_{yvst}^\text{out}\), e_sto_out: The variable \(\epsilon_{vst}^\text{out}\) represents the output commodity flow out of a storage tuple \(s_{yvc}\) 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, \(\epsilon_{yvst}^\text{con}\), e_sto_con: The variable \(\epsilon_{yvst}^\text{con}\) represents the energy amount that is loaded in a storage tuple \(s_{vc}\) 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, \(\delta_{yvct}^\text{up}\), dsm_up, MWh: The variable \(\delta_{yvct}^\text{up}\) 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, \(\delta_{t,tt,yvc}^\text{down}\), dsm_down, MWh: The variable \(\delta_{t,tt,yvc}^\text{down}\) 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')