\section{Stabilization with noise}
\label{sec:5}

In the previous sections we carried on the analysis of the behavior of the Price Market Mechanism under the strong assumption that the cost function
$c(x)$ for the producers and the utility function $v(x)$ for the consumers are both known by the two aggregate agents and constant in time. This
assumption is fairly reasonable in the case of large power plants such as a nuclear power plant, in which not only the production should be kept as
uniform as possible, but moreover there is no reason to assume that the cost function changes. Something similar, on the side of the consumers,
happens for large factories, in which the demand never drops (at least on a large time horizon) and the value function relates in a known and fixed
way the amount of energy with the amount of goods produced. However, in many other cases this time--invariance is a too strong assumption. In
particular, and this is the case we are going to analyze in this section, the consumer could be unable to perfectly estimate the value of the energy
unit at each instant, or could be forced by external reasons to change its value function. In other words, there exists a nominal value function for
the consumer, which he would follow in the ideal case. However, this is not the actual case, and, given the price $\lambda^r_t$ decided by the ISO, the customer chooses to consume an
amount of energy which is a corrupted version of the nominal $\dot{v}^{-1}(\lambda_t^r)$. This corruption could be, of course, of any type. For sake
of simplicity, we consider the easy case in which the corruption is modeled by an additive noise
    $$
        d_t = \dot{v}^{-1}(\lambda_t^r) + n_t
    $$
where the additive noise process $\{n_t\}_{t\geq 0}$ is a i.i.d. process with zero mean and variance $q < \infty$. By reducing to the essential the
equations, it is easy to see that the system is governed by
    \begin{equation}
        \label{eq:system_con_noise}
        \begin{cases}
            \lambda^r_{t+1} = \lambda^r_t + \gamma(c\dot{v}^{-1}(\lambda^r_t) + cn_t - \lambda^r_t) - \rho I_t                    \\
            I_{t+1} = I_t + (\dot{v}^{-1}(\lambda^r_t) + n_t)(\lambda^r_{t} - c\dot{v}^{-1}(\lambda^r_t) + cn_t)   \\
        \end{cases}
        .
    \end{equation}
A second order analysis to prove mean--square convergence is in this case quite difficult
even in the case $\dot c(x) = cx$, since in the equation for $I_{t+1}$ appear both a term
$\lambda_tn_t$ and $n_t^2$, which pose quite difficult problems for the computation of the variance of the process. We limit to a simulative example
which illustrates a typical trajectory of the system.

\subsubsection*{A numerical example}

The simulation has been carried on taking $c(x) = 0.5x^2$ and $v(x) = 20 \, \log(5x+1)$, $\gamma = 0.6$, $\rho = 0.03$ and $q = 0.05$. In Figure
\ref{fig:traj_con_cont_int_con_rumore} it is depicted a typical trajectory of the energy vs the prices, while Figure \ref{fig:ISO_revenue_con_rumore}
presents the trend of the total ISO revenue. A remark which arises from this and several other simulations is that the nonlinearity has a nontrivial
influence on the behavior of the price and the ISO revenue. If we consider, in fact, the sample expectation of the tail of both the processes
$\{\lambda^r_t\}_{t\geq 0}$ and $\{I_t\}_{t\geq0}$ (in order to \virg{forget} the initial conditions), one sees that they are both slightly lower
then the nominal equilibrium points $\lambda^*$ and $0$. However, this shift seems to be small and the algorithm is able to maintain the system in a
neighborhood of the nominal equilibria.

\begin{figure}[ht!]
    \begin{center}
        \includegraphics[width=10cm]{traj_con_cont_int_con_rumore}
    \end{center}
  \caption{Trajectory of the energy request vs the retail price in the case with noise.}\label{fig:traj_con_cont_int_con_rumore}
\end{figure}

\begin{figure}[ht!]
    \begin{center}
        \includegraphics[width=10cm]{ISO_revenue_con_rumore}
    \end{center}
  \caption{Trajectory of the total income/shortfall of the ISO with noise.}\label{fig:ISO_revenue_con_rumore}
\end{figure}
