## 2 Mathematical Modelling of ME Applications
### Demand Response of \(Ev\)  
In economics, the price-elasticity of demand presents the relative variation of demand caused by the relative variation of the product price, which is the ratio of rate of demand increment over the rate of price increment [28]. The consumer's response to TOU pricing scheme belongs multi-period response, which means the electricity consumptions of most consumers in a period is not only related to the electricity price in the current period, but also related to the electricity prices in adjacent periods [25; 28; 29]. Therefore, the mathematical expression of electricity consumption in a certain period and the price in each period can be expressed as in (11):  
\[\rho_{i}=f\big{(}D_{\text{ev},1},\ D_{\text{ev},2},\ \ldots,\ D_{\text{ev},i}, \ldots,\ D_{\text{ev},j},\ldots,\ D_{\text{ev},N}\big{)}\quad i,j\in 1,2, \ldots,N. \tag{11}\]  
In (11), one day is divided into \(N\) periods, \(D_{\text{ev},i}\) is the electricity consumption in period \(i\), and \(\rho_{i}\) is the electricity price in period \(i\). \(N\) periods are categorized into three kinds: peak, flat, and valley. Figure 4: The diagram of accommodating wind power with P2H/G2P. Figure 3: Schematic of P2H/G2P concept. P2H/G2P: Power-to-Hydrogen and Gas-to-Power. Around the given equilibrium points in each period, Equation (11) can be linearized with the first order Taylor expansion:  
\[\rho_{i}=\rho_{0}+\sum\limits_{j=1}^{n}\frac{\partial\rho_{i}}{\partial D_{ \mathrm{ev},j}}\cdot(D_{\mathrm{ev},j}-D_{\mathrm{ev},j0})=\rho_{0}+\sum\limits _{j=1}^{n}\left(\frac{\partial\psi_{i}}{\partial D_{\mathrm{ev},j}}\cdot\frac{D _{\mathrm{ev},\beta}}{\rho_{0}}\right)\cdot\frac{\rho_{0}}{D_{\mathrm{ev}, \beta}}\cdot(D_{\mathrm{ev},j}-D_{\mathrm{ev},\beta})\quad i,j=1,2,\,\ldots \ldots\,N \tag{12}\]  
Define the self-elasticity coefficient \(\varepsilon_{ii}\) and cross-elasticity coefficient \(\varepsilon_{ij}\) as in (13):  
\[\varepsilon_{ii}=\frac{\partial\rho_{i}/\rho_{i0}}{\partial D_{\mathrm{ev},i}/ D_{\mathrm{ev},i0}}\quad,\quad\varepsilon_{ij}=\frac{\partial\rho_{i}/\rho_{i0}}{ \partial D_{\mathrm{ev},j}/D_{\mathrm{ev},j0}}. \tag{13}\]  
So the price-elasticity matrix of demand can be derived as in (14):  
\[\left[ \begin{array}{c}\Delta\rho_{1}/\rho_{10}\\ \Delta\rho_{2}/\rho_{20}\\ \ldots\\ \Delta\rho_{n}/\rho_{n}\end{array} \right]=\left[ \begin{array}{cccc}\varepsilon _{11}&\varepsilon_{12}&\ldots&\varepsilon_{1n}\\ \varepsilon_{21}&\varepsilon_{22}&\ldots&\varepsilon_{2n}\\ \ldots\\ \varepsilon_{n1}&\varepsilon_{n2}&\ldots&\varepsilon_{nn}\end{array} \right] \left[ \begin{array}{c}\Delta D_{\mathrm{ev},1}/D_{\mathrm{ev},10}\\ \Delta D_{\mathrm{ev},2}/D_{\mathrm{ev},20}\\ \ldots\\ \Delta D_{\mathrm{ev},n}/D_{\mathrm{ev},n}\end{array} \right] \tag{14}\]  
where \(\Delta D_{\mathrm{ev},i}\) denotes the electricity consumption increment during period \(i\), and \(\Delta\rho_{i}\) the price increment during period \(j\). According to (12), the linearized relations between electricity consumption and price around respective equilibrium points in peak, flat and, valley periods can be described with (15)-(17), where \(D_{\mathrm{ev},\mathrm{h}}\), \(D_{\mathrm{ev},\mathrm{f}}\), and \(D_{\mathrm{ev},\mathrm{v}}\) are the electricity consumption during peak period, flat period, and valley period respectively; \(\rho_{\mathrm{h}}\), \(\rho_{\mathrm{f}}\), and \(\rho_{\mathrm{v}}\) are the electricity price during peak period, flat period, and valley period respectively. \(k_{\mathrm{h}}\) and \(b_{\mathrm{h}}\), \(k_{\mathrm{f}}\) and \(b_{\mathrm{f}}\), and \(k_{\mathrm{v}}\) and \(b_{\mathrm{v}}\) define the linearized relations around the equilibrium points between the electricity consumption and price during each period. \(\Omega_{\mathrm{H}}\), \(\Omega_{\mathrm{F}}\), and \(\Omega_{\mathrm{V}}\) denote the peak, flat, and valley periods sets respectively. \[