## 1 Introduction
### Single Home-Sharing Energy
#### 1.4.4 Time-of-Use Tariff  
Electricity companies are introducing new tariff structures for their residential customers. Time-of-use rates, demand charges, and real-time pricing encourage consumers to use energy when electricity is cheap and discourage them from doing so when electricity is expensive [39]. Understanding how time-of-use tariffs work can help to reduce users' monthly energy bills. The conditions of use of the tariff policy vary according to location. Taking the province of Jeddah in Saudi Arabia as an example, the electricity purchase prices \(C^{\textit{purchase}}(t)\) and electricity selling prices \(C^{\textit{cetali}}(t)\) in 2021 for prosumers and commercial (see Equations (5) and (6)) and industrial consumers are as follows. The price of fixed-term contracts is described below.  
\[C^{\textit{purchase}}_{t}=\left\{\begin{array}{l}\{1.254(\$)\to t =[11:00,12:00]\cup[14:00,15:00]\leftrightarrow\textit{Sunny Days}\\ \{1.04(\$)\to t=[10:00,12:00]\cup[14:00,19:00]\\ \{0.904(\$)\to t=[00:00,08:00]\\ 0.204(\$)\to other-period\end{array}\right.}^{\textit{cetali}}_{t}=\left\{ \begin{array}{l}\{1.16(\$)\to t=[10:00,12:00]\cup[14:00,19:00]\\ \{0.804(\$)\to t=[00:00,08:00]\\ 0.304(\$)\to other-period\end{array}\right.}^{\textit{cetali}}_{t} \tag{6}\]  
Equations (7) and (8) describe the upper constraint on the amount of instantaneous electricity that can flow to/from the distribution network from/to the home system. In addition, buying and selling energy are complementary, as the above equation shows. As can be seen, the event value of the matrix will become zero if a network failure occurs at time t and in the scenarios. Therefore, due to the requirements in (9), the binary variables \(\delta_{1}\) and \(\delta_{2}\) must also have a value of zero. As a result, electricity flowing to/from the powergrid is constrained to zero, simulating the indecssibility of the power grid when it is not available.  
\[\left\{\begin{array}{l}P_{t}^{grid,\text{home}}=\delta_{1}P_{t,\text{max}}^{ grid,\text{home}}\\ P_{t}^{\text{home},grid}=\delta_{2}P_{t,\text{max},grid}^{\text{home},grid}\\ P_{t}^{\text{friend},\text{home}}\leq\delta_{1}P_{t,\text{max}}^{\text{friend} }\rightarrow\forall t\\ P_{t}^{\text{home},grid}\leq\delta_{2}P_{t,\text{max},grid}^{\text{friend} }\rightarrow\forall t\\ \delta_{1}+\delta_{2}\leq 1\rightarrow\forall t\\ \end{array}\right. \tag{7}\]  
If there is a problem with the electricity network, electricity cannot flow out or into it. Equation (8) represents this limitation in its modelled form. Blackouts are the most severe form of power supply interruption. They result from an imbalance between the production and use of electricity. Power cuts can last a few minutes to several days or weeks [42]. In the context of our work, simultaneous over-power, also known as over-power with or without outages, is represented by Equation (9).  
\[\left\{\begin{array}{l}\overline{\frac{P_{t,\text{max}}^{grid,\text{home}}}{ P_{t,\text{max}}^{grid,\text{home}}}}\leq O_{t}^{T}\rightarrow\forall t\\ \end{array}\right. \tag{8}\]  
\[\left|\begin{array}{l}P_{t}^{\text{{\tiny utility-Grid}}}=\text{max}(0,P_{t}^ {PV}-\sum\limits_{k=1}^{k=m}J_{a,k})\xrightarrow{Without}\\ P^{OT}(t,s)=\text{max}(0,P_{t}^{PV}+P_{t}^{RT,sh}-\sum\limits_{k=1}^{k=m}J_{a, k}-P_{t}^{RT,dis})\\ \xrightarrow{Blackouts}\end{array}\right. \tag{9}\]  
where \(O_{t}{}^{T}\) and \(P^{OT}(t,s)\) are outages and energy consumption in the grid, and \(P_{t}\) is the utility-grid power demand. \(P^{OT}(t,s)\) is the expected number of outages per year.