zen_garden.model.technology.technology¶
Defines the parameters, variables and constraints that hold for all technologies. The class takes the abstract optimization model as an input, and returns the parameters, variables and constraints that hold for all technologies.
Classes
|
Defines parameters, variables and constraints holding for all technologies. |
|
Rules for the Technology class. |
- class zen_garden.model.technology.technology.Technology(technology: str, optimization_setup)¶
Defines parameters, variables and constraints holding for all technologies.
- __init__(technology: str, optimization_setup)¶
Init generic technology object.
- Parameters:
technology – technology that is added to the model
optimization_setup – The OptimizationSetup the element is part of
- add_new_capacity_addition_tech(capacity_addition: Series, capex: Series, step_horizon: list)¶
Adds the newly built capacity to the existing capacity.
- Parameters:
capacity_addition – pd.Series of newly built capacity of technology
capex – pd.Series of capex of newly built capacity of technology
step_horizon – current horizon step
- add_new_capacity_investment(capacity_investment: Series, step_horizon: list)¶
Adds the newly invested capacity to the list of invested capacity.
- Parameters:
capacity_investment – pd.Series of newly built capacity of technology
step_horizon – optimization time step
- calculate_capex_of_capacities_existing(storage_energy=False)¶
This method calculates the annualized capex of the existing capacities.
- Parameters:
storage_energy – boolean if energy storage
- Returns:
capex of existing capacities
- calculate_capex_of_single_capacity(*args)¶
Calculates annualized capex of existing capacity, implemented in child class.
- Parameters:
args – arguments
- calculate_fraction_of_year()¶
Calculate fraction of year.
- classmethod construct_constraints(optimization_setup)¶
Constructs the Constraints of the class <Technology>.
- Parameters:
optimization_setup – The OptimizationSetup
- classmethod construct_params(optimization_setup)¶
Constructs the pe.Params of the class <Technology>.
- Parameters:
optimization_setup – The OptimizationSetup
- classmethod construct_sets(optimization_setup)¶
Constructs the pe.Sets of the class <Technology>.
- Parameters:
optimization_setup – The OptimizationSetup
- classmethod construct_vars(optimization_setup)¶
Constructs the pe.Vars of the class <Technology>.
- Parameters:
optimization_setup – The OptimizationSetup
- classmethod get_available_existing_quantity(optimization_setup, tech, capacity_type, loc, year, type_existing_quantity)¶
Gets the existing quantity of ‘tech’ at investment time step ‘time’.
returns existing quantity of ‘tech’, that is still available at invest time step ‘time’. Either capacity or capex.
- Parameters:
optimization_setup – The OptimizationSetup the element is part of
tech – name of technology
capacity_type – type of capacity
loc – location (node or edge) of existing capacity
year – current yearly time step
type_existing_quantity – capex or capacity
- Returns:
existing_quantity: existing capacity or capex of existing capacity
- classmethod get_existing_quantity(optimization_setup, type_existing_quantity)¶
Get existing capacities of all technologies.
- Parameters:
optimization_setup – The OptimizationSetup the element is part of
type_existing_quantity – capacity or cost_capex_overnight
- Returns:
The existing capacities
- classmethod get_first_lifetime_time_step(optimization_setup, tech, year, use_depreciation_time=False)¶
Get first time step of active capacity of technology.
Returns the first time step within the lifetime or depreciation time of the technology, i.e., the earliest past time step whose installed capacity is still active at the given time step.
- Parameters:
optimization_setup – OptimizationSetup the technology is part of
tech – name of the technology
year – current yearly time step
use_depreciation_time – boolean indicating whether to use depreciation time instead of standard lifetime for capacity calculation
- Returns:
first time step where capacity or investment is still valid
- classmethod get_if_capacity_still_existing(optimization_setup, tech, year, loc, id_capacity_existing)¶
Returns boolean if capacity still exists at yearly time step ‘year’.
- Parameters:
optimization_setup – The optimization setup to add everything
tech – name of technology
year – yearly time step
loc – location
id_capacity_existing – id of existing capacity
- Returns:
boolean if still existing
- classmethod get_investment_time_step(optimization_setup, tech, year)¶
Returns investment time step of technology, considering construction time.
returns investment time step of technology, i.e., the time step in which the technology is invested considering the construction time.
- Parameters:
optimization_setup – The optimization setup to add everything
tech – name of technology
year – yearly time step
- Returns:
investment time step
- classmethod get_lifetime_range(optimization_setup, tech, year, use_depreciation_time=False)¶
Get active year range of technology: either lifetime or depreciation time.
- Parameters:
optimization_setup – OptimizationSetup the technology is part of
tech – name of the technology
year – yearly time step
use_depreciation_time – boolean indicating whether to use depreciation time instead of lifetime, namely for CAPEX calculation
- Returns:
lifetime or depreciation time range of technology
- store_carriers()¶
Retrieves and stores information on reference.
- store_input_data()¶
Retrieves and stores input data for element as attributes.
Each Child class overwrites method to store different attributes.
- class zen_garden.model.technology.technology.TechnologyRules(optimization_setup)¶
Rules for the Technology class.
- __init__(optimization_setup)¶
Inits the rules.
- Parameters:
optimization_setup – OptimizationSetup of the element
- constraint_carbon_emissions_technology_total()¶
Calculate total carbon emissions of each technology.
\[E_y^{\mathcal{H}} = \sum_{p\in\mathcal{P}} \sum_{t\in\mathcal{T}}\sum_{h\in\mathcal{H}} \theta_{h,p,t} \tau_{t}\]\(E_y^{\mathcal{H}}\): total carbon emissions of each technology in year \(y\)
\(\theta_{h,p,t}\): carbon emissions of technology \(h\) at location \(p\) in time step \(t\)
\(\tau_{t}\): duration of time step \(t\)
- constraint_cost_capex_yearly()¶
Aggregates the capex of built capacity and of existing capacity.
\[A_{h,p,y} = f_h (\sum_{\tilde{y} = \max(y_0,y-\lceil\frac{l_h} {\mathrm{dy}}\rceil+1)}^y \alpha_{h,y}\Delta S_{h,p,\tilde{y}} + \sum_{\hat{y}=\psi(\min(y_0-1,y-\lceil\frac{l_h} {\mathrm{dy}}\rceil+1))}^{\psi(y_0)} \alpha_{h,y_0} \Delta s^\mathrm{ex}_{h,p,\hat{y}})\]\(A_{h,p,y}\): annual capex of technology \(h\) at location \(p\) in year \(y\)
\(f_h\): annuity factor of technology \(h\)
\(\alpha_{h,y}\): unit cost of capital investment of technology \(h\) in year \(y\)
\(\Delta S_{h,p,y}\): size of built technology \(h\) (invested capacity after construction) at location \(p\) in year \(y\)
\(\Delta s^\mathrm{ex}_{h,p,y}\): size of the previously added capacities at location \(p\) in year \(y\)
\(l_h\): depreciation time of technology \(h\)
\(\mathrm{dy}\): interval between planning periods
- constraint_cost_capex_yearly_total()¶
Sums over all technologies to calculate total capex.
\[CAPEX_y = \sum_{h\in\mathcal{H}}\sum_{p\in\mathcal{P}}A_{h,p,y} + \sum_{k\in\mathcal{K}}\sum_{n\in\mathcal{N}}A^\mathrm{e}_{k,n,y}\]\(A_{h,p,y}\): annual capex of technology \(h\) at location \(p\) in year \(y\)
- constraint_cost_opex_yearly()¶
Yearly opex for a technology at a location in each year.
\[OPEX_{h,p,y} = \sum_{t\in\mathcal{T}}\tau_t O_{h,p,t}^t + \gamma_{h,y} S_{h,p,y} + \gamma_{k,y}^\mathrm{e} S_{k,n,y}^\mathrm{e}\]\(OPEX_{h,p,y}\): opex of operating technology \(h\) at location \(p\) in year \(y\)
\(\tau_t\): duration of time step \(t\)
\(O_{h,p,t}^t\): variable opex of operating technology \(h\) at location \(p\) in time step \(t\)
\(\gamma_{h,y}\): specific fixed opex of technology \(h\) in year \(y\)
\(S_{h,p,y}\): installed capacity of technology \(h\) at location \(p\) in year \(y\)
\(\gamma_{k,y}^\mathrm{e}\): specific fixed opex of storage technology \(k\) in year \(y\)
\(S_{k,n,y}^\mathrm{e}\): installed capacity of storage technology \(k\) at node \(n\) in year \(y\)
- constraint_cost_opex_yearly_total()¶
Sums over all technologies to calculate total opex.
\[OPEX_y = \sum_{h\in\mathcal{H}}\sum_{p\in\mathcal{P}} OPEX_{h,p,y}\]\(OPEX_{h,p,y}\): opex of operating technology \(h\) at location \(p\) in year \(y\)
- constraint_technology_capacity_limit()¶
Limited capacity_limit of technology.
\[\text{if existing capacities < capacity limit: } s^\mathrm{max}_{h,p,y} \geq S_{h,p,y}\]\[\text{else: } \Delta S_{h,p,y} = 0\]\(S_{h,p,y}\): installed capacity of technology \(h\) at location \(p\) in year \(y\)
\(s^\mathrm{max}_{h,p,y}\): capacity limit of technology \(h\) at location \(p\) in year \(y\)
\(\Delta S_{h,p,y}\): size of built technology \(h\) (invested capacity after construction) at location \(p\) in year \(y\)
- constraint_technology_construction_time()¶
Construction time of technology: time between investment and availability.
\[\text{if start time step in set time steps yearly: } \Delta S_{h,p,y} = \Delta S_{h,p,(y-dy^{\mathrm{construction}})}^\mathrm{invest}\]\[\text{elif start time step in set time steps yearly entire horizon:} \Delta S_{h,p,y} = \Delta s^\mathrm{ex,invest}_{h,p,(y-dy^{\mathrm{construction}})}\]\[\text{else: } \Delta S_{h,p,y} = 0\]\(\Delta S_{h,p,y}\): size of built technology \(h\) (invested capacity after construction) at location \(p\) in year \(y\)
\(\Delta S_{h,p,y}^\mathrm{invest}\): size of invested technology at location \(p\) in year \(y\)
\(\Delta s^\mathrm{ex,invest}_{h,p,y}\): size of the previously invested capacities at location \(p\) in year \(y\)
- constraint_technology_diffusion_limit()¶
Limits technology diffusion based on existing capacity in the previous year.
For storage and conversion technologies:
\[\Delta S_{k,n,y}\leq ((1+\vartheta_k)^{\mathrm{dy}}-1)(K_{k,n,y} + \omega \sum_{\tilde{n}\in\tilde{\mathcal{N}}}K_{k,\tilde{n},y}) +\mathrm{dy}(\xi\sum_{\tilde{k} \in\tilde{\mathcal{K}}}S_{\tilde{k},n,y} + \zeta_k)\]For transport technologies:
\[\Delta S_{j,e,y}\leq ((1+\vartheta_j)^{\mathrm{dy}}-1)K_{j,e,y} + \mathrm{dy}(\xi\sum_{\tilde{j}\in\tilde{\mathcal{J}}} S_{\tilde{j},e,y} + \zeta_j)\]\(\Delta S_{j,e,y}\): size of built technology \(j\) (invested capacity after construction) at location \(e\) in year \(y\)
\(\vartheta_j\): maximum diffusion rate of technology \(j\) which is the maximum increase in capacity between investment steps
\(K_{j,e,y}\): existing knowledge of how to install the technology \(j\) at location \(e\) in year \(y\)
\(\xi\): parameter which specifies the unbounded market share
\(\zeta_j\): parameter which specifies the unbounded capacity addition that can be added each year (only for delayed technology deployment)
\(dy\): interval between planning periods
\(\omega\): parameter which specifies the knowledge spillover rate
- constraint_technology_lifetime()¶
Calculates remaining capacity of technologies based on the lifetime.
limited lifetime of the technologies. calculates ‘capacity’, i.e., the capacity at the end of the year and ‘capacity_previous’, i.e., the capacity at the beginning of the year.
\[S_{h,p,y} = \sum_{\tilde{y}=\max(y_0,y-\lceil\frac{l_h} {\Delta^\mathrm{y}}\rceil+1)}^y \Delta S_{h,p,\tilde{y}} + \sum_{\hat{y}=\psi(\min(y_0-1,y-\lceil\frac{l_h} {\Delta^\mathrm{y}}\rceil+1))}^{\psi(y_0)} \Delta s^\mathrm{ex}_{h,p,\hat{y}}\]\(S_{h,p,y}\): installed capacity of technology \(h\) at location \(p\) in year \(y\)
\(\Delta S_{h,p,y}\): size of built technology \(h\) (invested capacity after construction) at location \(p\) in year \(y\)
\(\Delta s^\mathrm{ex}_{h,p,y}\): size of the previously invested capacities at location \(p\) in year \(y\)
- constraint_technology_max_capacity_addition()¶
Max capacity addition of technology.
\[s^\mathrm{max}_{h} g_{i,p,y} \ge \Delta S_{h,p,y}\]\(s^\mathrm{add, max}_{h}\): maximum capacity addition of technology \(h\)
\(g_{i,p,y}\): binary variable which equals 1 if technology is installed at location \(p\) in year \(y\)
\(\Delta S_{h,p,y}\): size of built technology \(h\) (invested capacity after construction) at location \(p\) in year \(y\)
- constraint_technology_min_capacity_addition()¶
Min capacity addition of technology.
\[\Delta s^\mathrm{min}_{h} g_{i,p,y} \le \Delta S_{h,p,y}\]\(\Delta s^\mathrm{min}_{h}\): minimum capacity addition of technology \(h\)
\(g_{i,p,y}\): binary variable which equals 1 if technology is installed at location \(p\) in year \(y\)
\(\Delta S_{h,p,y}\): size of built technology \(h\) (invested capacity after construction) at location \(p\) in year \(y\)
- constraint_technology_on_off()¶
If technology is on, the binary variable is 1, else 0.
The min load constraint is expressed as six constraints (here for conversion technologies):
\[ \begin{align}\begin{aligned}m^\mathrm{min}_{i,n,t}S^\mathrm{approx}_{i,n,t}\leq G^\mathrm{r}_{i,n,t} \leq S^\mathrm{approx}_{i,n,t}\\0 \leq S^\mathrm{approx}_{i,n,t} \leq s^\mathrm{max}_{i,n,y} B_{i,n,t}\\S_{i,n,y} - s^\mathrm{max}_{i,n,y}(1-B_{i,n,t}) \leq S^\mathrm{approx}_{i,n,t} \leq S_{i,n,y}\end{aligned}\end{align} \]\(m^\mathrm{min}_{i,n,t}\): minimum load parameter for technology \(i\), node \(n\), time step \(t\)
\(G_{i,n,t}^\mathrm{r}\): reference carrier flow of the technology \(i\) at node \(n\) in time step \(t\)
\(S_{h,p,y}\): installed capacity of technology \(h\) at location \(p\) in year \(y\)
\(B_{i,n,t}\): binary variable indicating whether the technology is on or off for technology \(i\), node \(n\), time step \(t\)
\(S^\mathrm{approx}_{i,n,t}\): helper variable that represents the product of \(S_{i,n,y}\) and \(B_{i,n,t}\)
\(s^\mathrm{max}_{i,n,y}\): Big-M limit on \(S_{h,p,y}\)