Set of Model Equations¶
The MVS is based on the programming framework oemof-solph and builds an energy system model based up on its nomenclature. As such, the energy system model can be described with a linear equation system. Below, the most important aspects are described in a genrealized way, as well as explained based on an example. This will ease the comparision to other energy system models.
Economic Dispatch¶
Linear programming is a mathematical modelling and optimization technique for a system of a linear objective function subject to linear constraints. The goal of a linear programming problem is to find the optimal value for the objective function, be it a maximum or a minimum. The MVS is based on oemof-solph, which in turn uses Pyomo to create a linear problem. The economic dispatch problem in the MVS has the objective of minimizing the production cost by allocating the total demand among the generating units at each time step. The equation is the following:

![CAP_i &\geq 0
E_i(t) &\geq 0 \qquad \forall t
i &\text{: asset}
a_i &\text{: asset annuity [currency/kWp/year, currency/kW/year, currency/kWh/year]}
CAP_i &\text{: asset capacity [kWp, kW, kWh]}
c_{var,i} &\text{: variable operational or dispatch cost [currency/kWh, currency/L]}
E_i(t) &\text{: asset dispatch [kWh]}](_images/math/0611883e907f4c2af8aebd8a3b66ca987d758108.png)
The annual cost function of each asset includes the capital expenditure (investment cost) and residual value, as well as the operating expenses of each asset. It is expressed as follows:

![capex_i &\text{: specific investment costs [currency/unit]}
n &\text{: number of replacements of an asset within project lifetime T}
t_a &\text{: asset lifetime [years]}
CRF &\text{: capital recovery factor}
c_{res,i} &\text{: residual value of asset i at the end of project lifetime T [currency/unit]}
opex_i &\text{: annual operational and management costs [currency/unit/year]}
d &\text{: discount factor}
T &\text{: project lifetime [years]}](_images/math/870e52ef14cabe6e737d1c68a0c9ac44f03373d0.png)
The CRF is a ratio used to calculate the present value of the the annuity. The discount factor can be replaced by the weighted average cost of capital (WACC), calculated by the user.
The lifetime of the asset
and the lifetime of the project
can be different from each other;
hence, the number of replacements n is estimated using the equation below:

The residual value is also known as salvage value and it represents an estimate of the monetary value of an asset at the end of the project lifetime T. The MVS considers a linear depreciation over T and accounts for the time value of money by using the following equation:

Energy Balance Equation¶
One main constraint that the optimization model is subject to is the energy balance equation. The latter maintains equality between the incoming energy into a bus and the outgoing energy from that bus. This balancing equation is applicable to all bus types, be it electrical, thermal, hydrogen or for any other energy carrier.


It is very important to note that assets i and j can be the same asset (e.g., battery).
oemof-solph allows both
or
to be larger zero in same time step t (see Infeasible bi-directional flow in one timestep).
Example: Sector Coupled Energy System¶
In order to understand the component models, a generic sector coupled example is shown in the next figure. It brings together the electricity and heat sector through Transformer 4 as it connects the two sector buses.
For the sake of simplicity, the following table gives an example for each asset type with an abbreviation to be used in the energy balance and component equations.
Asset Types and Examples¶ Asset Type
Asset Example
Abbreviation
Unit
Non-dispatchable source 1
Wind turbine
wind
kW
Non-dispatchable source 2
Photovoltaic panels
pv
kWp
Storage 1
Battery energy storage
bat
kWh
Transformer 1
Rectifier
rec
kW
Transformer 2
Solar inverter
inv
kW
Non-dispatchable source 3
Solar thermal collector
stc
kWth
Storage 2
Thermal energy storage
tes
kWth
Dispatchable source
Heat source (e.g., biogas)
heat
L
Transformer 3
Turbine
turb
kWth
Transformer 4
Heat pump
hp
kWth
All grids and dispatchable sources are assumed to be available 100% of the time with no consumption limits.
The MVS includes a sink component for excess energy, connected to each bus in the system and denoted by
in the equations.
This excess sink accounts for the extra energy in the system that has to be dumped.
Electricity Grid Equation¶
The electricity grid is modeled though a feed-in and a consumption node.
Transformers limit the peak flow into or from the local electricity line.
Electricity sold to the grid experiences losses in the transformer
.


Non-Dispatchable Source Equations¶
Non-dispatchable sources in our example are wind, pv and solar thermal plant.
Their generation is determined by the provided timeseries of instantaneous generation, providing
,
,
respectively.

![E_{wind} &\text{: energy generated from the wind turbine}
CAP_{wind} &\text{: wind turbine capacity [kW]}
\alpha_{wind} &\text{: instantaneous wind turbine performance metric [kWh/kW]}
E_{pv} &\text{: energy generated from the PV panels}
CAP_{pv} &\text{: PV panel capacity [kWp]}
\beta_{pv} &\text{: instantaneous PV specific yield [kWh/kWp]}
E_{stc} &\text{: energy generated from the solar thermal collector}
CAP_{stc} &\text{: Solar thermal collector capacity [kWth]}
\gamma_{stc} &\text{: instantaneous collector's production [kWh/kWth]}](_images/math/9177a11355788d9a6e22abebedf7264a84a8b8cf.png)
Storage Model¶
There are two storages in our system: An electrical energy storage (Storage 1,
) and a thermal energy storage (Storage 2,
).
Below, the equations for the Storage 1 are provided, but Storage 2 follows analogous equations for charge, discharge and bounds.


![E_{bat} &\text{: energy stored in the battery at time t}
E_{bat,in} &\text{: battery charging energy}
\eta_{bat,in} &\text{: battery charging efficiency}
E_{bat,out} &\text{: battery discharging energy}
\eta_{bat,out} &\text{: battery discharging efficiency}
\epsilon &\text{: decay per time step}
CAP_{bat} &\text{: battery capacity [kWh]}
SOC_{min} &\text{: minimum state of charge}
SOC_{max} &\text{: maximum state of charge}
C_{rate,in} &\text{: battery charging rate}
C_{rate,in} &\text{: battery discharging rate}](_images/math/0b4ab0953d6f92b6bb72f7c739bf6aa8f561c19a.png)
DC Electricity Bus Equation¶
This is an example of a DC bus with a battery, PV and a bi-directional inverter.


NDS3 Bus Equation¶
The NDS3 Bus is an example of a bus, which does not serve both as in- and output of a storage system. Instead, the thermal storage is charged from the NDS3 bus, but discharges into the heat bus.


DS Bus Equation¶
The DS Bus shows an example of a fuel source providing an energy carrier (biogas) to a transformer (turbine).





