\section{ Introduction}
The Standard Model (SM) of particle physics so far provides an excellent description of a wide
variety of  experimental observations, nevertheless, it must be extended because it fails at least in explaining two cosmological puzzles: it does not provide a dark matter (DM) candidate and it is not possible to generate the observed baryon asymmetry of the universe (BAU).
The later one requires a strongly first order electroweak phase transition (EWPT) to provide a non-equilibrium environment if the BAU is generated via the electroweak baryogenesis mechanism~\cite{Kuzmin:1985mm,Shaposhnikov:1986jp,Shaposhnikov:1987tw,Morrissey:2012db}.
Since the 125 GeV Higgs boson is too heavy to give rise to a first order EWPT~\cite{Bochkarev:1987wf,Kajantie:1995kf}, new ingredients beyond the SM Higgs interactions may be needed.
On the other hand, how DM interacts with the SM particles remains unknown.
 The Higgs portal turns to be attractive since it may kill two birds (DM and the strongly first order EWPT~\cite{Espinosa:2011ax}) with one stone.

The characteristics of a scalar DM triggered strongly first order EWPT are twofold: (i)~It is a two-step phase transition~\cite{Cheung:2013dca,Patel:2012pi,Inoue:2015pza,Patel:2013zla,Chala:2016ykx,Vaskonen:2016yiu,Huber:2015znp} and the barrier between electroweak symmetric and broken phases arises at the tree-level, which may avoid the problem of gauge-dependence~\cite{Patel:2011th}; (ii)~The parameter space of the model is strongly constrained by the exclusion limits of direct detections and can not explain the observed relic density.
It was pointed out in Ref.~\cite{Cline:2012hg} that, for the  SM plus a real scalar DM $S$ scenario, $S$ could only constitute up to $3\%$ of the total DM relic density, while still be relevant for the direct detection because of its sizable coupling with the SM Higgs as required by the two-step EWPT.

In this paper, we  revisit this type of EWPT by extending the SM with a scalar singlet DM $S$ and another scalar singlet $\Phi$ which can mix with the SM-like Higgs boson.
Due to the mixing of $\Phi$ with the SM Higgs,  there are two separate contributions to DM nucleon scattering, which may cancel with each other and leads to a negligible cross section.
It results in a mechanism to suppress the direct detection signal and evade the currently most stringent experimental constraints from the direct detection experiments~\cite{Akerib:2016vxi,Tan:2016zwf}.
Furthermore,  the quartic interaction $\Phi^2S^2$ may contribute to the mass of $S$, which can lead to a relatively small quartic coupling of $S$ with the SM-like Higgs and result in a sizable relic density.
As a result the tension between the DM relic density and direct detection which occurs for the SM plus singlet case~\cite{Feng:2014vea,deSimone:2014pda} can be highly loosed in this scenario.

For the thermal history of the universe, the presence of the two additional scalars allows a two step EWPT.
This happens as follows:
As the universe cools down, $S$ gets vacuum expectation value (VEV) first and the universe transits to this phase;
As the temperature gets lower, a second minimum occurs in the SM-like Higgs and $\Phi$ subspace.
The universe then tunnels to this electroweak minimum resulting in a strongly first order EWPT with gravitational waves (GW) generated.
GW signals coming from this two-step EWPT are calculated using one benchmark point of the parameter space and our results show that the corresponding GW signals are testable in the Evolved Laser Interferometer Space Antenna (eLISA),  DECi-hertz Interferometer Gravitational wave Observatory (DECIGO), Ultimate-DECIGO and Big Bang Observer (BBO).

The remaining of this paper is organized as follows.
 Conventions of the model are defined in Sec. \ref{sec:model}.
We then study the DM phenomenology in Sec.~\ref{sec:dm} and the capability of a strongly first order EWPT in Sec.~\ref{sec:ewpt}.
The GW calculations and discovery prospects are explored in Sec.~\ref{sec:gw}, after which we present a brief summary in Sec.~\ref{sec:summary}.

\section{\label{sec:model}The model}
We present the model for two-step phase transition and scalar DM in this section.
The model extends the SM with two real scalar singlets: $S$ and $\Phi$, where $S$ is the DM candidate, while $\Phi$ gets non-zero VEV at the zero temperature and thus mixes with the SM Higgs~\footnote{Our particle settings are similar to these in Ref.~\cite{Patel:2013zla} where color breaking from two-step phase transition was proposed.}.
The Higgs potential can be written as
\begin{eqnarray}
V_0&=&-{1\over 2 }\mu_\Phi^2 \Phi^2 + {1\over 4 }\lambda_\Phi \Phi^4  - {1\over 2 }\mu_S^2 S^2 + {1\over 4}\lambda_S^{} S^4 \nonumber \\
&& -\mu^2 H^\dagger H + \lambda ( H^\dagger H )^2+\lambda_1^{} S^2 H^\dagger H + \lambda_2^{} \Phi^2 H^\dagger H \nonumber\\
&&+\lambda_3^{} S^2 \Phi^2 ,
\label{potential}
\end{eqnarray}
where $H$ is the SM Higgs doublet.
The effective potential, critical for the EWPT, can be written as: $V_{\rm eff} =V_0+ V_{\rm CW}+V_{\rm T}$, where  $V_0$ is the tree-level potential, $V_{\rm CW}$ is known as the Coleman-Weinberg term~\cite{Coleman:1973jx},
$V_{\rm T} $ includes finite temperature contributions from loops~\cite{Quiros:1999jp} and bosonic
ring~\cite{Parwani:1991gq,Gross:1980br}.
For one-step phase transition, where Higgs potential contains no tree-level cubic term, the  barrier between the electroweak symmetric and broken phases usually
arises from  loop corrections and
according to the Nielsen identity~\cite{Nielsen:1975fs}, the resulting effective potential is gauge dependent.
For the two step phase transition,  the barrier arises at the tree-level.
So we include in the effective potential the standard one-loop $T\neq 0$ corrections, but only retain terms proportional to ${\cal O} (T^2)$ for the consideration of gauge invariance.
Thermal masses of scalars take the following forms:
\begin{eqnarray}
\Pi_{h}&=& \left\{ {3 g^2 +g^{\prime 2 } \over 16} + {\lambda \over 2 } + {h_t \over 4 } + {\lambda_1+\lambda_2 \over 12 } \right\} T^2 ,  \\
\Pi_{s}&=&\left\{{\lambda_S \over 4}  + {\lambda_1 \over 3} + {\lambda_3 \over 6}  \right\}T^2 ,  \\
\Pi_{\phi} &=& \left\{ {\lambda_\Phi \over 4} + {\lambda_2\over 3} + {\lambda_3\over 6 } \right\} T^2   \; .
\end{eqnarray}
We require $S$ to have zero VEV at $T=0$ for the stability of the DM and parametrize the other two fields by
$H = (0, (v_{\text{EW}} + h)/\sqrt{2})$ and $\phi = v_{\Phi} + \phi$ with
here $v_{\text{EW}} \approx 246~\text{GeV}$ and $h_t \approx 1$.
Minimization conditions around $(v_{\text{EW}}, v_{\Phi}, 0)$
in the $(h,\phi,s)$ space allow us to trade the two VEVs $v_{\text{EW}}$ and $v_{\Phi}$ for $\mu^2$ and
$\mu^2_{\Phi}$ by
\begin{eqnarray}
\mu^2 = \lambda_h v_{\text{EW}}^2 + \lambda_{2} v_{\Phi}^2, \quad
\mu_{\Phi}^2 = \lambda_2 v_{\text{EW}}^2 + \lambda_{\Phi} v_{\Phi}^2 \; .
\end{eqnarray}
We also replace $\mu_S^2$ by the physical DM mass $m_S^2$,
\begin{eqnarray}
  \mu_S^2 = \lambda_1 v_{\text{EW}}^2 + 2 \lambda_3 v_{\Phi}^2 - m_S^2.
\end{eqnarray}
With these substitutions, the mass matrix for $(h,\phi)$ is then given by
\begin{eqnarray}
  \mathcal{M}^2 =
  2 \left(
  \begin{array}{c c}
    v_{\text{EW}}^2 \lambda          & v_{\text{EW}} v_{\Phi} \lambda_2 \\
    v_{\text{EW}} v_{\Phi} \lambda_2 & v_{\Phi}^2 \lambda_{\Phi}
  \end{array}
\right),
\end{eqnarray}
which can be diagonalized by a $2\times 2$ orthogonal matrix parametrized by a rotation angle
$\theta$.
The mass eigenstate $( \hat h, \hat s)$ can then be written as
\begin{eqnarray}
    \hat h =\ \ \  c_{\theta} h + s_{\theta} \phi,
    \quad \quad
    \hat \phi=-s_{\theta} h + c_{\theta} \phi.
\end{eqnarray}
where $c_\theta =\cos \theta $ and $s_\theta=\sin \theta$.
We define $\hat h$ as the SM-like Higgs boson and therefore when $\theta \rightarrow0$,  $\hat h$ is purely the SM Higgs.
With this definition, three of the parameters in the potential $\lambda,\lambda_2, \lambda_\Phi$
can be replaced by the physical masses $m_{\hat h}^2$, $m_{\hat s}^2$ and $\theta$:
\begin{eqnarray}
&&  \lambda     = \frac{m_{\hat h}^2 c^2_ \theta + m_{\hat \phi}^2 s^2_\theta}{2 v_{\text{EW}}^2},   \\
&&  \lambda_2   = \sin(2\theta) \frac{m_{\hat h}^2 - m_{\hat \phi}^2}{4 v_{\text{EW}} v_{\Phi}}, \label{eq:lam2} \\
&&  \lambda_\Phi = \frac{m_{\hat h}^2 s^2_ \theta + m_{\hat \phi}^2 c^2_\theta}{2 v_{\Phi}^2}.
\label{eq:lams}
\end{eqnarray}
In summary, we have a total of 7 free parameters:
\begin{equation}
  v_{\Phi}, \quad m_{\hat{\phi}}, \quad m_S, \quad \lambda_S, \quad \theta, \quad \lambda_1, \quad \lambda_3 ,
\end{equation}
where $\lambda_1$ and $\lambda_3$ are relevant for the DM phenomenology.

Before proceeding to study EWPT and DM phenomenology, we discuss constraints on the mixing angle $\theta$ from Higgs measurements and electroweak precision measurements.
 %
Couplings of the SM-like Higgs to all SM particles are rescaled by the factor $c_\theta$ due to the mixing.
As a result,  signal rates, the ratio of Higgs measurements relative to the SM-like Higgs measurements, equal to $c_\theta^2$.
Performing a universal Higgs fit to the data given by the ALTAS and CMS collaborations, one has $|\theta|\leq 0.526$ at the $95\%$~CL~\cite{Chao:2016vfq}.
It was shown in Ref.~\cite{Profumo:2014opa} that the constraint of electroweak precision is closely related to the mass of $\hat \phi$,  which is weaker than that of Higgs measurements for a light $\hat \phi$ and turns to be much strong as $m_{\hat \phi}$ gets heavier.
For constraints of vacuum stability and perturbativity, we refer the reader to Refs.~\cite{Gonderinger:2009jp,Chao:2012mx} for detail.

\begin{figure*}[t]
  \includegraphics[width=0.4\textwidth]{fig/lamH-mS-EWPT-Omega-Larger.eps} \quad \quad \quad
  \includegraphics[width=0.4\textwidth]{fig/alpha-lamSH-EWPT-Omega-Larger.eps}
\caption{Results from a scan over the parameter space in plane
  $(m_S, \lambda_1)$ for the left panel and $(\theta, \lambda_1)$ for the right panel.
  Every point in these plots generates the desired EWPT pattern and leads to vanishing DM
  nucleon scattering cross section at tree level. The green points
  further gives DM relic density within the interval $\Omega_c h^2\in (0.03, 0.12)$.
  The red points, in addition to generating relic density falling into this interval, also
  satisfy the strong first order EWPT condition $v_h(T_C)/T_C \gtrsim 1$.
\label{fig:scan}
}
\end{figure*}

\section{\label{sec:dm}Dark Matter}
The fact that about $26.8\%$ of the universe is made of DM, whose relic abundance is about
$\Omega_c h^2=0.1189$~\cite{Ade:2015xua}, has been well established, while the nature of the DM is still unknown.
The Higgs potential in Eq. (\ref{potential}), has $Z_2\times Z_2$ discrete symmetry for $S$ and $\Phi$ respectively.  At the zero temperature, $\Phi$ gets non-zero VEV and thus its corresponding $Z_2$ is broken.
On the other hand, we require that the global minimum at $T=0$ forbids a nonzero VEV in the $s$ direction.
As a result $s$ can serve as a DM candidate, which interacts with the SM particles via the Higgs
portal interactions.
The couplings between the DM and the physical scalars are
\begin{eqnarray}
  &&s^2\hat h^{~~}~~:    2 \lambda_3 v_\phi s_\theta +\lambda_1 v_{\text{EW}} c_\theta \; ,   \label{dd1}  \\
  &&s^2 \hat \phi^{~~}~~ : 2\lambda_3 v_\phi c_\theta -  \lambda_1 v_{\text{EW}} s_\theta  \; ,    \label{dd2} \\
&&s^2  \hat h^{2}~~ : {1\over 2 }  \lambda_1  c_\theta^2  +  \lambda_3  s_\theta^2  \; ,      \\
&&s^2 \hat \phi^2 ~~: {1\over 2 } \lambda_1 s_\theta^2 + \lambda_3 c_\theta^2  \; ,      \\
&&s^2 \hat h^{~} \hat \phi :   c_\theta s_\theta (2 \lambda_3-\lambda_1) \; . \label{interactions}
 \end{eqnarray}
The relic density of the DM is governed by the Boltzmann equation:
\begin{eqnarray}
\dot{n} + 3 H n = -\langle  \sigma v \rangle (n^2 -n_{\rm EQ}^2) \; ,
\end{eqnarray}
where $H$ is the Hubble constant, $\langle \sigma v \rangle$ is the thermal average of the reduced annihilation cross section.
For our model, the DM can annihilate into $\bar{f}f$,  $ZZ/WW$, $\hat h \hat h$,
$\hat \phi \hat \phi$  and $\hat h  \hat \phi$ final states  via s-channel Higgs mediations, where di-scalar processes also receive contribution from four point interactions in Eq.~(\ref{interactions}) .
Compared with the most simple Higgs portal, here there are more annihilation channels for a heavy DM.
Couplings in Eqs. (\ref{dd1}) and (\ref{dd2}) are both relevant to the DM direct detections,  while the contribution of $\hat \phi$ mediated processes is suppressed by the factor $s_\theta^2$ and thus is negligible for a small $\theta $.
For numerical simulations we implement the model in  LanHEP~\cite{Semenov:1996es,Semenov:2010qt} and use  MicrOMEGAs~\cite{Belanger:2001fz,Belanger:2013oya} to calculate the  relic density.

For direct detections, the spin independent scattering cross section off nucleon is given by
\begin{eqnarray}
\sigma_n = {\mu^2  m_n^2\over  \pi  v_{\rm EW}^2  m_S^2 } \left| { c_\theta a_{\hat h} \over  m_{\hat h}^2} - {s_\theta a_{\hat \phi } \over m_{\hat \phi}^2 } \right|^2   \left( {2\over 9} + {7\over 9}\sum_{q=u,d,s} f_{T_q}^n \right)^2
\end{eqnarray}
where $a_{\hat h}$, $a_{\hat \phi}$ are effective couplings in Eqs.~(\ref{dd1})~and~(\ref{dd2}) respectively and $f^n_{T_q}$ are nucleon form factors for light quarks~\cite{Cheng:2012qr}.
The inclusion of $\Phi$ that mixes with the SM Higgs can lead to a complete cancellation in contributions to $\sigma_n$ at tree level.
This occurs when the effective coupling of DM with quarks vanishes, that is, when the expression in $|\cdots|$ vanishes.
Imposing this condition would allow us to eliminate one more parameter $\lambda_3$,
\begin{eqnarray}
  \lambda_{3} = \frac{v_{\text{EW}} \lambda_1(m_{\hat{h}}^2 \tan\theta + m_{\hat{\phi}}^2 \cot\theta)}
  {2 v_{\Phi}(m_{\hat{h}}^2 - m_{\hat{\phi}}^2)} ,
\end{eqnarray}
which will be adopted in the following numerical analysis for simplicity.

For a detailed survey of the parameter space, we perform a parameter scan and show the results in
Fig.~\ref{fig:scan} in the plane $(m_S,\lambda_1)$ (left panel) and in the plane
$(\theta, \lambda_1)$ (right panel).
In these plots, the green points give the relic density within the range
$\Omega_c h^2 \in (0.03,0.12)$ allowed by the current results from Planck~\cite{Ade:2015xua},
in addition to being able to induce a two-step EWPT pattern as discussed later.
From the plot in the left panel, we can see the coupling
$\lambda_1$ that can give a relic density within this range is of magnitude $(0.005,0.02)$ for a relatively
heavy DM, while it can be larger $\approx 0.06$ for a relatively light DM.
For the right plot, the mixing angle is mostly negative since most of the scanned points are for $m_{\hat{\phi}} > m_{\hat{h}}$ and
therefore a negative $\theta$ is needed to give a positive $\lambda_2$ according to Eq.~\ref{eq:lam2}.
The red points in both plots also give a strongly first order EWPT condition $v_h(T_C)/T_C \gtrsim 1$.

\begin{figure}[t]
  \includegraphics[width=\columnwidth]{fig/Two_Step_EWPT.eps}
\caption{
This figure gives an illustrative picture of the two step EWPT
with the first step in the $s$ direction and the subsequent one from $s$ direction to the $(h,\phi)$
direction.
\label{fig:EWPT-Pattern}
}
\end{figure}

\section{Electroweak Phase Transition\label{sec:ewpt}}
The barrier between the electroweak symmetric and broken phases emerges at the tree-level in our two-step phase transition scenario.
As a result, the effective potential, which includes the standard one-loop $T\neq 0$ corrections but only retain the leading terms( thermal mass terms) in the high $T$ expansion so as to avoid problems relating to the gauge dependence, can be written as
\begin{eqnarray}
V_{\rm eff}^{} &=&  -{1\over 2 }(\mu_\Phi^2 -\Pi_\phi ) \phi^2 - {1\over 2 }(\mu_S^2  -\Pi_s) s^2 \nonumber \\ &&
 -{1\over 2 } (\mu^2 -\Pi_h) h^2 + {1\over 4} \lambda h^4+ {1\over 2 }\lambda_1^{} s^2 h^2+ {1\over 2 }\lambda_2^{} \phi^2  h^2
 \nonumber \\
 && +\lambda_3^{} s^2 \phi^2   + {1\over 4 }\lambda_\Phi \phi^4  + {1\over 4}\lambda_S^{} s^4  \label{thermal}
 ,
\end{eqnarray}
in terms of background fields $h,~\phi$ and $s$.

Given Eq. (\ref{thermal}), one can trace the evolution of the universe phase as temperature drops and our
desired pattern of EWPT is illustrated in Fig.~\ref{fig:EWPT-Pattern}.
At sufficiently high temperature, the universe sits at the global minimum $(0,0,0)$ where the electroweak
symmetry is restored.
As temperature drops to $T_s$, a minimum develops in the $s$ direction and due to an
absence of a barrier with the one at the origin, the universe transits to this minimum through a second
order phase transition.
As $T$ continues decreasing to $T_h$, a second minimum develops in the $(h,\phi)$ direction but its free energy is initially higher than the one in the $s$ direction.
As $T$ further decreases, the free energy of the minimum in the $(h,\phi)$ direction  drops
faster than the one in the $s$ direction, and at the critical temperature $T_C$, these two minima become degenerate.
Slightly below $T_C$, the universe makes a second transition to the global minimum in the $(h,\phi)$
direction.
Due to the existence of the barrier between these two minima, the transition may occur as a
first order EWPT by a tunneling process and proceeds through nucleations of electroweak
bubbles~\cite{Coleman:1977py,Linde:1980tt,Linde:1981zj} which expand, collide and coalesce, leaving eventually the universe in the electroweak broken phase.
To avoid washing out of the generated baryons by the sphaleron process inside the electroweak bubble,
the sphaleron process needs to be sufficiently suppressed inside the bubble and this translates into the following
generally adopted criterion~\cite{Shaposhnikov:1986jp,Shaposhnikov:1987tw,Cline:2006ts}:
\begin{eqnarray}
{v_h(T_C) \over T_C}  \gtrsim 1 \; .
\label{eq:strength}
\end{eqnarray}
Note that due to the reflection symmetry of the effective potential under $h\rightarrow -h$,
$\phi \rightarrow -\phi$ or $s\rightarrow -s$, there are identical phase structures and we focus on the
region with $h,\phi,s>0$.

\begin{figure*}[t]
  \includegraphics[width=0.44\textwidth]{fig/BM-Phase.eps} \quad \quad \quad
  \includegraphics[width=0.4\textwidth]{fig/BM_mim_evolution.eps}
\caption{
The left panel shows the evolution of $V$ at the two minima in $s$(blue) and in $(h,\phi)$(magenta dashed)
directions as $T$ drops from right to left. The right panel shows the tracks of the minimum
(blue dotted line) in the $(h,\phi)$ direction for the thermal history with the contours denoting the
values of $V$ at $T=0$. In these plots, the magenta, blue, black and red dots represent
the temperatures at $T_s=150\text{GeV}$, $T_h=108\text{GeV}$, $T_C=78.8\text{GeV}$ and $T=0$ respectively.
The parameters are chosen as: $v_{\Phi} = 65\text{GeV}$, $m_{\hat{\phi}}=82\text{GeV}$,
$m_S=71\text{GeV}$, $\lambda_S=0.015$, $\theta=0.12$, $\lambda_1=0.046$ and $\lambda_{3} = 0.57$
which gives $v_h(T_C)/T_C = 2.6$.
\label{fig:EWPT}
}
\end{figure*}

The VEV of the SM Higgs at the finite temperature can be written as
\begin{eqnarray}
v_h(T) = \sqrt{ v_{\rm EW  }^2+ {\lambda_2 \Pi_\phi - \lambda_\Phi \Pi_h  \over \lambda \lambda_\Phi -\lambda_2^2} } ,
\end{eqnarray}
The critical temperature $T_C$ can be calculated analytically from the following equation:
\begin{eqnarray}
{ \lambda (\mu_\Phi^2 -\Pi_\phi )^2   -2 \lambda_2 (\mu^2 -\Pi_h ) (\mu_\Phi^2 -\Pi_\phi) + \lambda_\Phi (\mu^2 -\Pi_h)^2 \over \lambda \lambda_\Phi -\lambda_2^2 } \nonumber \\
={ (\mu_S^2 -\Pi_s)^2  \over \lambda_S} \; . \hspace{6.2cm}   \nonumber
\end{eqnarray}
where $\mu^2$, $\mu^2_{\Phi}$ and $\mu^2_S$ can be written in terms of physical parameters.

As a concrete example, we show in the left panel of Fig.~\ref{fig:EWPT}, the evolution of $V$ at these
two minima as the temperature drops from right to the left, for the parameter choice
$v_{\Phi} = 65\text{GeV}$, $m_{\hat{\phi}}=82\text{GeV}$,
$m_S=71\text{GeV}$, $\lambda_S=0.015$, $\theta=0.12$, $\lambda_1=0.046$ and $\lambda_{3} = 0.57$.
Here the horizontal green line on the far right
denotes the symmetric phase at high temperature when the universe sits at the origin, the magenta dashed
line represents the minimum in the $s$ direction
and the blue line is the minimum in the $(h,\phi)$ direction which eventually evolves to the electroweak
minimum at the zero temperature labeled by a red dot.
The $s$ direction phase appears at $T_s=150\text{GeV}$ continuously away from the origin while
the $(h,\phi)$ direction phase starts from $(159\text{GeV},9.15\text{GeV},0)$ at $T_h = 108\text{GeV}$ above which
it is a saddle point. The $T$ at which the blue and magenta lines intersect is the critical
temperature $T_C=78.8\text{GeV}$ and is labeled by a black dot.
At $T_C$, the two minima are
$(205\text{GeV},45\text{GeV},0)$ and $(0,0,352\text{GeV})$.
For more details on the evolution
of the minimum in the $(h,\phi)$ direction, we plot in the right panel the track of this minimum in
blue dotted line for the whole thermal history with here the red arrow denoting the direction
as temperature drops. The contours in this plot gives an measure of the value $V$
at $T=0$ and the electroweak vacuum labelled by the red point sits at the deepest location.
For this parameter choice, the strongly first order EWPT criterion~Eq.(\ref{eq:strength}) is achieved
since $v_h(T_C)/T_C=2.6$.

A more comprehensive survey of the model is given by a scan over the parameter space as shown in
Fig.~\ref{fig:scan} where all plotted points give above described pattern of EWPT by
imposing various conditions during the scan. These conditions include:
(i) there are two minima in the field space with one in the $s$ direction and the other in $(h,\phi)$
direction;
(ii) the electroweak minimum needs to be lower than the one in the $s$ direction at $T=0$ should the $s$
direction minimum persist at $T=0$;
(iii) the minimum in the $s$ direction occurs earlier than the one in the $(h,\phi)$ direction, that is,
$T_s > T_h$.
After imposing these conditions, the points are further filtered to give a relic density in the
range $(0.03,0.12)$ with the remaining plotted using green color.
At this step, these points can give a
two-step EWPT and a sizable amount of relic density but the second step EWPT is not necessarily strongly
first order.
As such, we further calculate the critical temperature $T_C$
and $v_h(T_C)$ corresponding to the black intersection point of the blue and magenta lines for each above
green point. The points which satisfy the condition in Eq.~(\ref{eq:strength}) are shown
with red color in Fig.~\ref{fig:scan} .
So we can see there are sufficient parameter space in this model where the desired strongly
first order EWPT pattern can be realized.
We note in passing that the second order phase transition for the first
step could also be strongly first order, should a more complete effective potential be adopted.

\section{Gravitational Waves\label{sec:gw}}
The calculation of the GWs generated during the second step EWPT needs a numerical
analysis of the tunneling process at finite temperature and in particular involves solving the critical bubble profiles.
As mentioned in previous section,
after the universe cools down to a temperature below $T_C$, the second transition from
$(0,~0,~v_s)$ to the true
vacuum $(v_h, ~v_\phi,~0)$ takes place by the nucleation of true vacuum bubbles.
This tunneling rate per unit time per unit volume reads~\cite{Moore:1995si}
\begin{eqnarray}
\Gamma \sim A(T) e^{-S_3/T} ,
\end{eqnarray}
where $S_3$ is the Euclidean action of the critical bubble which minimizes the action
\begin{eqnarray}
S_3(\vec{\phi},T) = 4\pi \int r^2 dr \left[ \frac{1}{2} \left(\frac{d \vec{\phi}(r) }{d r}\right)^2 + V(\vec{\phi},T) \right],
\end{eqnarray}
and the prefactor  $A(T)$ is roughly of  ${\cal O} (T^4)$, whose
precise evaluation needs integrating out fluctuations around the bounce solution~\cite{Dunne:2005rt}.
From this rate formula, the bubble nucleation temperature $T_n$ is defined as the probability for a
single bubble to be nucleated within one horizon volume being ${\cal O}(1)$, i.e.
\begin{eqnarray}
\int_0^{t_n}  {\Gamma V_{H} (t)}  dt= \int_{T_n}^{\infty} {d T \over T }  \left( 2 \zeta M_{\rm pl}  \over T  \right)^4 e^{{-S_3/T}} ={\cal O} (1) , \
\label{nucleation}
\end{eqnarray}
where $V_H (t)$ is the horizon volume, $M_{\rm pl}$ is the Planck mass and $\zeta \sim 3 \times 10^{-2}$.
This equation implies numerically $S_3(T_n)/T_n\approx 140$~\cite{Apreda:2001us} and serves as
our definition of $T_n$.
\begin{figure*}[t]
  \includegraphics[width=0.4\textwidth]{fig/TST.eps} \quad \quad \quad
  \includegraphics[width=0.42\textwidth]{fig/gw_two_step_allexp.eps}
  \caption{
    The left panel shows changes of $S(T)/T$ in the neighborhood of $T_n$ and the right panel shows
    the
    GWs generated during the first order EWPT as a function of frequency
    from three sources: sound waves(blue dotdashed line), collision(red dotted line),
    turbulence(green dashed line) and total contribution(cyan solid line).
  The color shaded regions fall within the experimental sensitivities of
    eLISA(four configurations with notation NiAjMkLl), ALIA(gray), BBO(green), DECIGO(yellow) and
Ultimate-DECIGO(purple).
\label{fig:gw}
  }
\end{figure*}
From the bounce solutions, two other important parameters $\alpha$ and $\beta$, that are directly
relevant for the calculation of GWs, are defined by:
\begin{eqnarray}
\alpha \equiv {\rho_{\rm vac} \over \rho^*_{\rm rad}} \; , \hspace{1cm} \beta \equiv H_nT_n \left.{d S_3 \over d T} \right |_{T_n} \; ,
\end{eqnarray}
where $\rho_{\rm vac} $ is the vacuum energy density released in the phase transition, $H_n$ is the Hubble parameter at $T_n$, $\rho_{\rm rad}^* =g_* \pi^2 T_n^4 /30$ with $g_*$ the relativistic
degrees of freedom in the plasma at
$T_n$.
A small $\beta/H_n$ will trigger strong phase transition and consequently a significant stochastic background of GWs.

The observable characterizing the GW background is the energy spectrum $h^2 \Omega_{\text{GW}}(f)$
and is given by~\cite{Apreda:2001us}
\begin{eqnarray}
h^2 \Omega_{\text{GW}}(f)=\frac{h^2}{\rho_c}\,\frac{d\rho_{\rm gw}}{d\log f}\, ,
\end{eqnarray}
where $\rho_{\rm gw}$ is the energy density of GWs with $f$ its frequency and
$\rho_c$ is the critical energy density today.
The sources of stochastic GW signals arising from first order EWPT can be classified into three categories: (1) collisions of bubble walls and shocks in the plasma; (2) sound waves in the plasma after the bubble collision; (3) Magnetohydrodynamic (MHD) turbulence in the plasma~\cite{Caprini:2015zlo}.
The total energy spectrum is given approximately by the sum of these three sources,
\begin{eqnarray}
h^2 \Omega_{\rm GW} \approx h^2 \Omega_{\rm coll}^{} + h^2 \Omega_{\rm sw}^{} + h^2 \Omega_{\rm turb}^{}  \; .
\end{eqnarray}
The GW contribution from bubble collisions can be calculated using the envelope approximation~\cite{Hawking:1982ga,Caprini:2007xq,Jinno:2016vai}, which numerically results in the following GW contribution to the spectrum~\cite{Huber:2008hg}:
\begin{eqnarray}
h^2 \Omega_{\rm coll} (f) &=& 1.67\times 10^{-5} \left({ H_n \over \beta } \right)^2
\left( {   \kappa \alpha \over 1+ \alpha }\right)^2 \left( { 100 \over g_*} \right)^{1\over 3 }  \nonumber \\ &&  \times \left( {0.11 v_w^3 \over 0.42 + v_w^2  }\right) \left[  { 3.8 (f /f_{\rm coll})^{2.8} \over 1+ 2.8 (f/f_{\rm coll})^{3.8}} \right] ,
\end{eqnarray}
where $v_w$ is bubble wall velocity, $\kappa$ characterizes  the fraction of latent heat deposited in a thin shell and $f_{\rm coll}$ is the peak frequency produced by the bubble collisions.
At the time of the phase transition $f^n_{\rm coll} =0.62\beta /(1.8-0.1v_w+v_w^2)$, which is
red-shifted to give the peak frequency today:
$f_{\rm coll} = f^n_{\rm coll} \times a (T_n)/a_0=16.5\times
10^{-6}~\text{Hz} ~(f^n_{\rm coll}/H_n)(T_n/100~{\rm GeV}) (g_*/100)^{1/6}$.
Both $v_w$ and $\kappa$ are functions of $\alpha$, which read as~\cite{Kamionkowski:1993fg}:
\begin{eqnarray}
v_w = \frac{1/\sqrt{3} + \sqrt{\alpha^2+2\alpha/3} }{1+\alpha}, \quad \quad
\kappa \simeq \frac{0.7\alpha + 0.2 \sqrt{\alpha} }{1+0.7\alpha} .
\end{eqnarray}
The sound wave contribution of the GW intensity is numerically fitted by
\begin{eqnarray}
h^2 \Omega_{\rm sw} (f) &=&2.65\times 10^{-6} \left(  {H_n \over \beta }\right) \left( { \kappa_v \alpha \over 1+ \alpha} \right)^2  \left( {100 \over g_* } \right)^{1\over 3} \nonumber \\&& \times v_w  \left( {f \over f_{\rm sw}} \right)^{3} \left[{7 \over 4+ 3 (f/f_{\rm sw})^2} \right]^{7/2} \; ,
\end{eqnarray}
where $\kappa_v$ denotes the faction of latent heat transformed into bulk motion of the fluid, $f_{\rm sw}$ is the peak frequency that can be given from the rescaling of its value at the phase transition, i.e. $f_{\rm sw}^{} = f_{\rm sw}^n \times a(T_n)/a_0 = (2/\sqrt{3}) (\beta/v_w) \times a(T_n)/a_0 $.
We refer the reader to Refs.~\cite{Espinosa:2010hh,Caprini:2015zlo} for the value of $\kappa_v$ in the small and large $v_w$ limit.
The MHD turbulence contribution to the GW spectrum can be written as
\begin{eqnarray}
h^2 \Omega_{\rm turb} (f)& = &3.35 \times 10^{-4} \left(  {H_n \over \beta }\right) \left(  { \kappa_{\rm tu } \alpha \over 1+ \alpha }\right)^{3/2}\left( {100 \over g_* } \right)^{1\over 3 } \nonumber \\ && \times v_w { ( f/f_{\rm tu})^3 \over (1+ f/f_{\rm tu})^{11/3} (1+8\pi f/h_n)} \ ,
\end{eqnarray}
where $\kappa_{\rm tu} \approx 0.1 \kappa_v$~\cite{Hindmarsh:2015qta}, $h_n$ is the Hubble parameter today, and $f_{\rm tu} \approx (3.5/2) (\beta /v_w ) \times a(T_n)/a_0$.

We use the package CosmoTransitions~\cite{Wainwright:2011kj} to solve for profiles of the
critical bubble and the nucleation temperature for the benchmark point used earlier.
This parameter choice gives $\Omega_c h^2 = 0.04$ constituting about
$34\%$ of the total DM relic density.
For this benchmark parameter point, we show in the left panel of Fig.~\ref{fig:gw} the quantity
$S(T)/T$ as a function of $T$ and we found $T_n = 41.2\text{GeV}$.
The resulting GW signals are shown in the right panel of Fig.~\ref{fig:gw} where the three
contributions are shown with details in the caption.
As can be seen from this figure, the blue sound wave
contribution dominates and is almost indistinguishable from the sum of the three sources which is denoted
by the cyan line.
For a comparison with experiment, we show firstly four sensitive regions corresponding to four configurations of the eLISA detector. These four regions are labelled in the format
NiAjMkLl and are plotted as the red shaded regions at the top following conventions of Ref.~\cite{Caprini:2015zlo,Klein:2015hvg}. We can see for this parameter set, the GWs can be detected by the configuration N2A5M5L6 while unreachable by the others.
We further add the sensitivitive regions of several other proposed decihertz GW experiments:
Advanced Laser Interferometer Antenna (ALIA)~\cite{Gong:2014mca}\footnote{The ALIA program is the upgraded version of the Chinese Taiji Program in space of gravitational wave physics.}, BBO, DECIGO and Ultimate-DECIGO~\cite{Kudoh:2005as}. The data are taken from Ref.~\cite{Moore:2014lga,Yagi:2011wg,Artymowski:2016tme} and are plotted as gray, green, yellow and purple regions respectively~\footnote{The ALIA, BBO and DECIGO data are taken from the website~\url{http://rhcole.com/apps/GWplotter/} where these
sensitivity curves are collected in one place. We also checked that these curves
are consistent with those used in
Ref.~\cite{Artymowski:2016tme}.}.
From the plot, we can see the GW signals from the benchmark point fall within the detectable ranges of BBO,
DECIGO and Ultimate-DECIGO.
It should be noted that there might be other points in the model parameter space where the generated GWs can have much larger energy density spectrum and are
therefore within reach of the other three eLISA configurations as well as ALIA, and give a sufficiently large DM relic density in the meanwhile.
This however needs a dedicated survey of the parameter space including all  the considerations and we leave it to future works.
For GWs from one-step EWPT in SM extended with scalar singlet(s)~\footnote{GWs can be generated from EWPT in SM extended with dimension-six operators~\cite{Huang:2016odd,Baldes:2017rcu,Addazi:2016fbj}, where no scalar singlet is needed. }, we refer the reader to Refs.~\cite{Jinno:2016knw,Huang:2016cjm,Hashino:2016xoj,Kakizaki:2015wua,Balazs:2016tbi,Jinno:2015doa} as well as references cited in these papers for detail.
Alternatively, first order phase transition may lead to originations of primordial black holes.  They can be captured by neutron stars or astrophysical black holes~\cite{Davoudiasl:2016mwf}, resulting in GWs that may be detected by Advanced LIGO or Advanced Virgo.

\section{Summary\label{sec:summary}}
Working in a simple model with the SM extended by a scalar singlet DM and another scalar singlet which mixes with the SM-like Higgs boson, we studied a possible connection between the DM phenomenology and the EWPT, in particular the detectability of the GW signals generated during the DM assisted  EWPT.
Through both analytical and numerical studies, we find this model may admit strongly first order two-step EWPT in certain parameter space, which may also give rise to a viable the DM relic density and a negligible direct detection cross section.
We further exemplified, using one representative benchmark point, the discovery possibility of the EWPT with the generated GW signals during the second step EWPT and found that the GW signals can be detected by the eLISA in the configuration N2A5M5L6, BBO, DECIGO and Ultimate-DECIGO.
This scenario can readily be generalized to other  models where DM can have nontrivial effect in the baryon number generation and is helpful in understanding and testing the origin of these two cosmological puzzles.

\section{Acknowledgements}
This work is supported by the National Natural Science Foundation of China under grant
No.11647601, No.11690022 and No.11675243
and also supported by the Strategic Priority Research Program of the Chinese Academy of Sciences under
grant No.XDB23030100. Part of the results described in this paper are
obtained on the HPC Cluster of SKLTP/ITP-CAS.

\bibliographystyle{utphys}
\begingroup\raggedright


\section{Introduction}

The increased use of devices for monitoring and controlling power networks poses several coordination challenges to assure a robust operation~\citep{Kok2016,Cherukuri2016}. Thus, control theory and optimization algorithms have become one of the main tools to deal with these challenges \citep{Hale2017,Nedic2015,uribe2017a,uribe2017b}. Centralized approaches often suffer from computation and communication overheads. These communication requirements are evident in large-scale systems. Distributed control approaches eases the communication costs of large-scale systems. Several approaches in distributed control for economic dispatch problems have been used to achieve optimal power flow and voltage control \citep{Cherukuri2017,Mojica-Nava2016}. However, these algorithms are subject to several technical requirements.  For example, the coordination
of devices/agents (e.g., generators and loads) is required to maintain the stability of the power system, i.e., maintain equilibria between power generated and power demanded.

Recently, some strategies has been proposed for design decentralized feedback controllers that steer the system to the optimal solution without explicitly solving the economic dispatch problem \citep{Li2017}, there are also some approaches that consider a more complete power flow problem in a distributed fashion with communications constraints and losses of control signals \citep{Simonetto2016}. Furthermore, several demand-response strategies have been proposed to solve the economic dispatch problem with changes in the load and the generation \citep{Knudsen2016,Shiltz2016,Bejestani2014}. In this context, transactive control has been shown effective to assure coordination of a vast number of devices, including smart loads \citep{Kok2016}. Transactive control uses a market mechanism that allows agents to interact through an economic signal to properly distribute the available resources \citep{Kok2016}.

In this paper, we propose a distributed transactive control method based on consensus-based constrained optimization~\citep{Ozdaglar2010}. Particularly, we use the distributed Minimum Diameter Spanning Tree (MDST) algorithm \citep{Bui2004} to share some required global network parameters in a distributed way (e.g., equality between the load demanded and power generated). Then, we use the projected distributed consensus method to optimize the social welfare. This approach does not need confidential information to be shared, such as the gradient of local utility functions or incremental costs. This allows the implementation of the proposed algorithm on power systems with various proprietary network infrastructure agents. An example of these systems are distribution systems with microgrids where a distribution system usually has an independent system operator (ISO) as owner and microgrids are users' property. Contrary to recent literature~\citep{Cortes2016,Mojica-Nava2014}, the main contribution of this paper is to remove the assumption that all agents have immediate and global access to the {power demand, the power generation and the number of agents} beforehand. Our proposed method allows all agents to obtain these global parameters and achieve the correct operation of the power system, minimize the local cost of each agent and satisfy the local constraints.

The rest of the paper is organized as follows. Section~\ref{sec:problem} presents the problem statement, where we formulate the distributed transactive optimization problem. Section~\ref{sec:DED} describes the proposed transactive control algorithm. Section~\ref{sec:cases} presents experimental results to test the behavior of the proposed algorithm. Finally, Section~\ref{sec:conclusions} shows conclusions and future work.

\section{Problem Formulation}\label{sec:problem}

We consider a transactive grid, where there are two classes of agents, generators and consumers, seeking to optimize its utility function. The network of agents is represented as a set of nodes in a graph, where edges indicate the communication links among agents.

\subsection{Preliminaries: Graph Theory}\label{sec:graph}

Let $\mathcal{G}=(\mathcal{V},\mathcal{E})$ be a connected, undirected and unweighted graph \cite[Section 3.4]{Bullo2018}, where $\mathcal{V}=\{1,2,3,...,M+N\} $, and $M$ and $N$ are the number of generators and loads respectively. In addition, $\mathcal{E}$ is the set of communication links between agents, i.e., $(a,b) \in \mathcal{E}$ if there is a link between $a \in \mathcal{V}$ and $b \in \mathcal{V}$. Besides, the neighbors of an agent $a \in \mathcal{V}$ are denoted by $\mathcal{N}_a=\{ b | (a,b) \in \mathcal{E}\}$. The graph $\mathcal{G}$ is connected, which means that there exists at least one path between any two distinct nodes \cite[Section 2.2]{west2000}. Additionally, connectedness implies the existence of at least one spanning tree \cite[subsection 3.2]{Bullo2018}.

\subsection{Generators and Consumers Model}

Generators are considered as distributed energy resources. We assume that all generators are dispatchable. A dispatchable generator can change the power that it is generating by taking into account the system requirements (i.e., the generation-demand balance), and respond dynamically to changes in the power demanded by consumers. The set of generators is denoted as $G=\{1,2,3,...,N\}$. Moreover, the cost of generation is assumed quadratic \citep{Shiltz2016}, i.e.,

\begin{align*}
C(P_{g_i})= \rho_{g_i} P_{g_i}+\frac{\beta_{g_i}}{2} P_{g_i}^2,
\end{align*}

where $\rho_g\in \mathbb{R}^{N}$ and $\beta_g\in \mathbb{R}^{N}$ are cost coefficients, $P_{g}(k)\in \mathbb{R}^{N}$ is a vector that contains the power delivered by each generator at time instant $k$, $P_{g}(k)=[ P_{g_1}(k), P_{g_2}(k), ..., P_{g_N}(k)]^{\top}$. Moreover, each generator has local constraints given by

\begin{subequations}
        \begin{align}
        \overline{P_{g_i}} \geq P_{g_i}\geq\underline{P_{g_i}},
        \label{eqn:gen_constraints}
        \end{align}
        \begin{align}
        \overline{T_{g_{i}}}\geq P_{g_i}(k) - P_{g_i}(k-1)\geq\underline{T_{g_{i}}},
        \label{eqn:Tc_gen_constraints}
        \end{align}
    \end{subequations}
where $\underline{P_{g_i}}$ and $\overline{P_{g_i}}$ are the minimum and maximum power delivered by the $i$-th generator, respectively. Additionally, $\underline{T_{g_{i}}}$ and $\overline{T_{g_{i}}}$ are the rate constraints for the $i$-th generator. Rate constraints impose a limit on the rate of change in power generated due to physical limitations. In order to include the power cost of each generator and maximum power capacity we rewrite the cost function as

\begin{align}
    C(P_{g_i})=  \frac{1}{c_i}\left(P_{g_i}-\frac{P_{g_i}^2}{\overline{P_{g_i}}}  \right),
    \label{eqn:costgen}
    \end{align}
 where $\beta_{g_i} ={-1}/{\overline{P_{g_i}}c_i}$, $\rho_{g_i}={1}/{c_i}$, and ${c_i}$ is the power cost. The set of consumers is denoted as $ {D}=\{1,2,3,...,M\}$. Consumers are assumed to be agents that can obtain the system power cost through demand response devices. These devices are capable of making decisions about the amount of power demanded by each consumer with the objective of maximizing its utility. Consumers are assumed to have controllable loads. The base load is the amount of power that each user consume and can change in time without any explanation. The power consumption that is adapted according to the system parameters is called the variable load. The consumers utility function is defined as

 \begin{align*}
 U(P_{d_j})= \rho_{d_i} P_{d_j}+\frac{\beta_{d_i}}{2} P_{d_j}^2,
 \end{align*}

where $\rho_d\in \mathbb{R}^{M}$ and $\beta_d\in \mathbb{R}^{M}$ are utility coefficients, $P_{d}(k)\in \mathbb{R}^{M}$ is the vector that contains the load demanded by each smart consumer at time instant $k$, $P_{d}(k)=[ P_{d_1}(k), P_{d_2}(k), ..., P_{d_M}(k)]^\top$.  The agent $j$ has local constraints given by
	%

\begin{subequations}
		\begin{align}
		 \overline{P_{d_j}} \geq P_{d_j}\geq \underline{P_{d_j}}, \quad
		\label{eqn:con_constraints}
		\end{align}
		\begin{align}
		\overline{T_{d_{j}}}\geq P_{d_j}(k) - P_{d_j}(k-1)\geq \underline{T_{d_{j}}},
		\label{eqn:Tc_con_constraints}
		\end{align}
	\end{subequations}
	%
where $\underline{P_{d_j}}$ and $\overline{P_{d_j}}$ are the minimum and maximum power demanded by the load $j$-th. $\underline{T_{d_{j}}}$ and $\overline{T_{d_{j}}}$ are the rate constraints for the $j$-th load, these constraints limit the rate of load change due to physical restrictions in power consumption devices. To include the power cost in the system and the maximum power load between the utility function, we transform the cost function as

\begin{align}
    U(P_{d_j})=  \frac{V_{d_j}}{c_\Omega}\left(P_{d_j}-\frac{P_{d_j}^2}{\overline{P_{d_j}}}  \right),
    \label{eqn:uticonsumers}
    \end{align}
    %
    where $\beta_{d_j} ={-V_{d_j}}/{\overline{P_{d_j}}}$, $\rho_{d_j}={V_{d_j}}/{c_\Omega}$, and $V_{d_j}$ is the value of the power for the agent $j$. These values can change as a function of the power consumption preferences of each consumer. $c_\Omega$ is a global variable that indicates the power cost in the system and it is defined as $c_\Omega={\sum_{i=0}^{N} P_{g_i}(k)c_i}/{\sum_{j=1}^M P_{d_j}(k)}$, where $c_i$ is the power cost of agent $i$.

Note that the utility functions in \eqref{eqn:costgen} and \eqref{eqn:uticonsumers} are chosen as the integral of logistic-type function. If the power consumed is not at the set point, the gradient obtained from the utility function will have a larger magnitude.  However, if the power consumed is close to the set point, the gradient will have a lower magnitude \citep{Britton2003}.

\subsection{Social Welfare Optimization Problem} \label{subsec:SWO}

The social welfare problem is related to optimizing the state for each agent in the power system, i.e., to maximize the utility of the consumers and to minimize the cost of the generators, and it is obtained from \eqref{eqn:costgen} and \eqref{eqn:uticonsumers} as

\begin{align}
    S_W&=\sum_{j=1}^{M}U(P_{d_j})-\sum_{i=1}^{N}C(P_{g_i}).
    \label{eqn:SW}
\end{align}

The main goal is maximize \eqref{eqn:SW} as it is shown in \eqref{eqn:opt}, taking into account constraints \eqref{eqn:gen_constraints}, \eqref{eqn:con_constraints}.

\begin{maxi!}[2]
        {P_{d_j}, P_{g_i} {i\in G, j\in D}}{S_W}
        {\label{eqn:opt}}{}
        \addConstraint{\sum_{j=1}^M P_{d_j}-\sum_{i=0}^{N} P_{g_i}}{=0} \label{eqn:global_cons
        \addConstraint{\overline{P_{g_i}}\geq P_{g_i} \geq \underline{ P_{g_i}}}{\quad \forall i  \in G}
        \addConstraint{\overline{P_{d_j}}\geq P_{d_j} \geq \underline{ P_{d_j}}}{\quad \forall j  \in D}.
        \end{maxi!}

{Constraints \eqref{eqn:Tc_gen_constraints} and \eqref{eqn:Tc_con_constraints} are addressed with the stepsize of the Algorithm \ref{alg:distributed_transactive_control} explained in subsection \ref{subsec:convergence}.} We assume that the local objective function and the local constraint set are known to an agent only. Problem \eqref{eqn:opt} is strongly convex and local constraints are closed convex sets. Finally, it is assumed that the feasible set is non-empty. In the following section, we present the preliminary concepts for solving the optimization problem proposed in this section in a distributed way.

	\section{Distributed Transactive Control}\label{sec:DED}
	We propose a distributed transactive control method based on the projected distributed gradient descent method \citep{Ozdaglar2010}. In order to find a solution the following assumptions are made. These assumptions are related to graph properties, communications and agents initial knowledge.

 \begin{assumption}
The set of feasible points for problem the \eqref{eqn:opt} is non-empty.
\label{as:op_set_ne}
\end{assumption}

\begin{assumption}
	The graph $\mathcal{G}$ is connected, static, undirected, and unweighted. Links are assumed lossless, without delays and synchronous.\label{as:graph}
\end{assumption}

\begin{assumption}
The agents know their set of neighbors and hence their own cardinality, $r_a$, where $r_a= |\mathcal{N}_a|$.
\label{as:neighbors}
\end{assumption}

To solve \eqref{eqn:opt}, it is necessary that all agents have information about the global state of the network. Agents need the following data: total power demanded ($P_D$), total power delivered ($P_G$), power cost in the system ($c_\Omega$) and finally the number of generators and consumers in the network ($N$) and ($M$) respectively. Where ($P_D$) is calculated such as $P_D=\sum_{j=1}^M P_{d_j}(k)$ and ($P_G$) is calculated such as $P_G=\sum_{i=1}^N P_{g_i}(k)$. Previous results in the literature assume that global parameters can be obtained \textit{a priori} by agents. This implies that a central entity obtains the global parameters and sends them to all the agents in the network agents as in \cite{Cortes2016,Mojica-Nava2014}. To avoid the requirement of the central entity and construct a fully distributed algorithm, we use an efficient algorithm to find the global parameters in a distributed way. We use the {Minimum Diameter Spanning Tree} (MDST) algorithm to reach consensus in a finite number of steps, those algorithms are explained in subsection \ref{subsec:DAMDST} and \ref{subsec:FTDA} respectively.

The MDST algorithm is used to share the global parameters with all the agents in the system by using a spanning tree of the graph $\mathcal{G}$. Later, the same spanning tree is used to execute the distributed projection gradient algorithm to compute the iterations of the optimization variables.

\subsection{Distributed Algorithm for the MDST} \label{subsec:DAMDST}

We use the finite time consensus algorithm to achieve common knowledge of the global system's parameters at every node \citep{Mou2014}. However, this algorithm only works on spanning tree graphs. Finding a spanning tree in a graph is a problem heavily studied in recent years \citep{Elkin2006,Gfeller2011,Bui2004}. We use the approach in \cite{Bui2004} to guarantee the best convergence time for the finite-time distributed algorithm, because this algorithm converges in maximum $d$ steps, being $d$ the graph diameter.

    \begin{lem}\label{lemma:MDST}
        \cite[Theorem 5]{Bui2004}: Consider a graph $\mathcal{G}$ and let Assumptions \ref{as:graph} and \ref{as:neighbors} hold on $\mathcal{G}$. Then, the distributed algorithm for the MDST proposed in \cite[Theorem 5]{Bui2004} finds a MDST of $\mathcal{G}$, in $O(n)$ iterations.
    \end{lem}

\begin{pf}
The distributed algorithm for the MDST has to calculate the All-Pairs Shortest Path (APSP) of the network. The time of execution of APSP is $O(n)$ \cite[Lemma 4]{Bui2004}. Then, each node knows which node is the shortest path to another node. After that, the absolute center of the graph is calculated, given a node with the lowest {eccentricity} $a_{min}$, the information about which node is the center of the graph is sent to another nodes in at most $O(n)$. Now consider the collection of all paths produced by APSP that begins in any node in the network and end in $a_{min}$, the set of path forms a tree rooted in $a_{min}$, which is the MDST of $\mathcal{G}$. Therefore each node knows a route to $a_{min}$ and the MDST is built through of knowledge of the shortest path to $a_{min}$ for all nodes~\cite[Subsection 2.1.5]{Bui2004}. $\blacksquare$
     \end{pf}

Once the MDST is created the global parameters are calculated through the distributed algorithm for the MDST as described in the following subsection.

\subsection{Finite-time Distributed Averaging} \label{subsec:FTDA}

The algorithm proposed in \cite{Mou2014} is used to calculate the global parameters $P_D$, $P_G$, $N$ and $M$. This algorithm can achieve consensus in finite time for spanning trees graphs. Initially, each agent has initial values for the global parameters as follows:

\begin{subequations} \label{eqn:GV_ini}
		\begin{align}\label{eqn:PG_ini}
		P_{G_a}(0)=
		\begin{cases}
		P_{g_{a}}(0),& \text{if } a {\in G},\\
		0,              & \text{otherwise},
		\end{cases}
		\end{align}
		\begin{align}\label{eqn:PD_ini}
		P_{D_a}(0)=
		\begin{cases}
		P_{d_{a}}(0),& \text{if } a {\in D},\\
		0,              & \text{otherwise},
		\end{cases}
		\end{align}
		\begin{align}\label{eqn:N_ini}
		N_a(0)=
		\begin{cases}
		1,& \text{if } a {\in G},\\
		0,              & \text{otherwise},
		\end{cases}
		\end{align}
        \begin{align}\label{eqn:M_ini}
		M_a(0)=
		\begin{cases}
		1,& \text{if } a {\in D},\\
		0,              & \text{otherwise},
		\end{cases}
		\end{align}
\end{subequations}

where $N_a$ and $M_a$ are the number of generators and consumers respectively known to the agent $a$ before starting the algorithm. Let $x_a$ be any global parameter previously presented in \eqref{eqn:GV_ini}, for each of previous values each agent, performs in parallel the following update action:

\begin{align}\label{eqn:update_GV}
		\begin{split}
				x_a(q+1)\hspace{6cm}\\=
			\begin{cases}
				x_a(0)+ \sum_{b\in \mathcal{N}_{a}}x_b(0),			& \text{if } q=0;\\
				\sum_{b\in \mathcal{N}_{a}}x_b(q)+(1-r_a)x_a(q-1),  & \text{if } q \geq 1.
			\end{cases}
		\end{split}
	\end{align}

   Variable $q$ is used to represent steps. Algorithm \ref{alg:global-average} explains how \eqref{eqn:update_GV} is used to calculate the global parameters.

 \begin{algorithm}
 \begin{algorithmic}[1]
 	\State \textbf{Executed by:}  Agents $a \in \mathcal{V}=\{1,...,N+M\}$
 	\Require Spanning Tree Neighbors
    \State \textbf{Initialize:} $P_{D_a}(0)$, $P_{G_a}(0)$, $N_{a}(0)$, $M_{a}(0)$ and Set $q=0$
    \State $P_{D_a}(1)=P_{D_a}(0)+ \sum_{b\in \mathcal{N}_{a}}P_{D_b}(0)$
                \State $P_{G_a}(1)=P_{G_a}(0)+ \sum_{b\in \mathcal{N}_{a}}P_{G_b}(0)$
                \State $N_{a}(1)=N_{a}(0)+ \sum_{b\in \mathcal{N}_{a}}N_{b}(0)$
                \State $M_{a}(1)=M_{a}(0)+ \sum_{b\in \mathcal{M}_{a}}M_{b}(0)$

 		\While{$q \leq d$}
 		\State Send $P_{D_a}(q)$, $P_{G_a}(q)$,$N_{a}(q)$ and $M_{a}(q)$ to Spanning Tree neighbors
             	\State $P_{D_a}(q+1)=\sum_{b\in \mathcal{N}_{a}}P_{D_b}(q)+(1-r_a)P_{D_a}(q-1)$
                \State $P_{G_a}(q+1)=\sum_{b\in \mathcal{N}_{a}}P_{G_b}(q)+(1-r_a)P_{G_a}(q-1)$
                \State $N_{a}(q+1)=\sum_{b\in \mathcal{N}_{a}}N_{b}(q)+(1-r_a)N_{a}(q-1)$
                \State $M_{a}(q+1)=\sum_{b\in \mathcal{N}_{a}}M_{b}(q)+(1-r_a)M_{a}(q-1)$
        \State Set $q=q+1$;
 		\EndWhile
 \State \textbf{return} $P_{D_a}(q)$, $P_{G_a}(q)$, $N_a(q)$  and $M_a(q)$
 \State \Comment{ $P_{D_a}(q)$=$P_D$, $P_{G_a}(q)$=$P_G$, $N_{a}(q)$=$N$, $M_{a}(q)$=$M$}
 \end{algorithmic}
\caption{Finite-time Distributed Averaging}
\label{alg:global-average}
\end{algorithm}

\begin{lem}\label{lemma:convergence}
		\cite[Theorem 1]{Mou2014}: Suppose $\mathcal{G}$ is a tree graph with diameter equal to $d$. Algorithm \ref{alg:global-average} makes it possible for each agent $a$ to get the global {parameters} at a maximum of $d$ steps.
	\end{lem}

The maximum path between two agents in the MDST obtained will be the maximum number of iterations in which the algorithm converges to global values ($P_D$, $P_G$, $N$ and $M$).

\subsection{Distributed Projected Consensus Gradient} \label{subsec:DPG}

To solve the problem presented in \eqref{eqn:opt} we use the projected consensus algorithm proposed in \cite{Ozdaglar2010}. Our algorithm does not require private information from the neighboring agents such as its incremental cost. We only need the power estimates of generators and loads in iteration $k$ to estimate $k+1$.

 \begin{assumption}
$P_{g_{i}}(0)$ and $P_{d_{j}}(0)$ for all {$i \in {G}$ and $j\in {D}$} are feasible points, i.e., $P_{g_{i}}(0)$ and $P_{d_{j}}(0)$ satisfy \eqref{eqn:gen_constraints} and \eqref{eqn:con_constraints}.
\label{as:initial_values}
\end{assumption}

For the initialization step we let Assumption \ref{as:op_set_ne}, \ref{as:graph}, \ref{as:neighbors}  and \ref{as:initial_values} hold. {The $a$-th agent updates its estimate by using the information produced by Algorithm \ref{alg:global-average},  then taking a gradient step to minimize the cost or maximize the utility function, and then projecting the result onto its constraint set $X_a$, where $\mathit{X_{a}}$ is the set of feasible solutions for each agent (cf. Eqs. \eqref{eqn:gen_constraints} and \eqref{eqn:con_constraints}).}
Initially, we seek for reach an average consensus, for this we use the Algorithm \ref{alg:global-average}. We define the stacked vector of power (generated and demanded) as $P^\top=[P_{g}, P_{d}]^\top$, $P_a$ is the power of agent $a \in \mathcal{V}$, $P_b$ is the power of the neighbors of agent $a$, with $b\in \mathcal{N}_a$, we use the variable $v_a$ to store the sum of the powers in the iterative system as follows

\begin{align}
	\left\{
    \begin{array}{ll}
	v_a(1)= & P_{a}(0)+ \sum_{b\in \mathcal{N}_{a}}P_{b}(0)\\
	v_a(2)= & \sum_{b\in \mathcal{N}_{a}}P_{b}(1)+(1-r_a)P_{a}(0)\\
	 	    & \vdots					\\
    v_a(d)= & \sum_{b\in \mathcal{N}_{a}}P_{b}(d-1)+(1-r_a)P_{D_a}(d-2).\\
	\end{array}
	\right.
    \label{eqn:sum_P}
\end{align}

When \eqref{eqn:sum_P} has been executed, every agent $a \in \mathcal{V}$ has a value  $v_a(d)=  \sum_{a\in \mathcal{V}}P_{a}$. Once $v_a(d)$ is obtained, it is possible to take the gradient step. For this step, we use $z(k)$ which contains the power average consensus minus the gradient of cost or utility function such as

\begin{align}
	z(k)=\frac{v_a(d)}{N_a+M_a}-\alpha_k d_a(k),
    \label{eqn:updatelaw}
\end{align}

where $\alpha_{k} > 0$ is the stepsize, $d_a(k)$ is the gradient of $U(P_{d_j}(k))$ and $C(P_{g_i}(k))$ depending on each agent. Finally, $z(k)$ is projected onto the feasible sets $X_a$,  The projection vector is denoted as $\mathbb{P}_{X_a}[\cdot]$ and it is defined as $\mathbb{P}_{\mathit{X_a}}[Y]= \argmin_{x \in \mathit{X_a}}  \Vert x-Y \Vert $. Each agent makes projections taking into account the constraints to which it is subjected. Consumers and generators are subject to constraints associated to its maximum and minimum load and generation, respectively. The projection onto the feasible set is defined as follows:

\begin{align}\label{eqn:projections}
	\begin{split}
	\mathbb{P}_{X_a}[z(k)]=z_1(k)=
	\begin{cases}
	\overline{P_{a}},	& \text{if}\qquad  z(k)>\overline{P_{a}},\\
	\underline{P_{a}},	& \text{if}\qquad  z(k)<\underline{P_{a}},\\
	z(k) & \text{Otherwise.}
	\end{cases}
	\end{split}
\end{align}

Furthermore, generators have to maintain the global constraint shown in \eqref{eqn:global_cons}, the projection onto the feasible set $X_g$, where $X_{g}$ is the constraint set where constraint \eqref{eqn:global_cons} is held, is shown in \eqref{eqn:projection_generators}.

\begin{align}\label{eqn:projection_generators}
	\begin{split}
	\mathbb{P}_{X_g}[z_1(k)]= \hspace{5cm}\\
	\begin{cases}
	z_1(k),	& \text{if \eqref{eqn:global_cons} is hold},\\
	z_1(k)-\dfrac{P_{G_a}(k)-P_{D_a}(k)}{N_a} & \text{Otherwise}.
	\end{cases}
	\end{split}
\end{align}

Finally, the power update law $P_a(k+1)$ is given by for consumers and generator agents as follows

\begin{align}
\begin{split}
	P_{a}(k+1)=
    \begin{cases}
    \mathbb{P}_{X_a}[z(k)] & \text{if } a \in D \\
    \mathbb{P}_{X_g}[z_1(k)] &  \text{if } a \in G \label{eqn:p(k+1)_gen}
	\end{cases}
\end{split}
\end{align}

 \subsection{ Distributed Transactive Algorithm}

We now state the distributed transactive algorithm, that is, the main contribution on this paper. We use $k$ to denote the iterations in the algorithm.

\begin{algorithm}
 \begin{algorithmic}[1]
 	\State \textbf{Executed by:}  Agents $a \in \mathcal{V}= \{1,...,N+M\}$
 	\State \textbf{Require:} $d_a$, $\alpha_k$ and $r_a$
    \State \textbf{Initialize:} Assumption \ref{as:initial_values} is hold $\forall$ $a$.  Set $k=0$
    \State \textbf{Execute} Algorithm MDST in Subsection \ref{subsec:DAMDST}.
 		\While{$k\geq0$}
        \State \textbf{Send} $P_{a}(k)$ to all $b \in \mathcal{N}_a$
 		\State \textbf{Execute} Algorithm \ref{alg:global-average}
        \State \textbf{Obtain} $P_G(k)$, $P_D(k)$, $M(k)$ and $N(k)$
 		\State \textbf{Execute} For all $a \in \mathcal{V}$\\
        				\hspace{3cm}Equation \eqref{eqn:sum_P} and then \eqref{eqn:updatelaw}
   		\State \textbf{Execute} For all $a \in \mathcal{V}$\\
        				\hspace{3cm}Equation \eqref{eqn:projections}
        \State \textbf{Execute} For all $i \in G$\\
        				\hspace{3cm}Equation \eqref{eqn:projection_generators}
        \State \textbf{Obtain} $P_a(k+1)$
        \State\textbf{Set} $k=k+1$;
 		\EndWhile
 \end{algorithmic}
\caption{Distributed Transactive Control Algorithm}
\label{alg:distributed_transactive_control}
\end{algorithm}

\subsection{Convergence}\label{subsec:convergence}

In this subsection, we analyze and prove the convergence of the proposed distributed transactive algorithm.

\begin{thm}\label{thm:optimum}
Assume that the stepsize $\alpha$ satisfies that $\sum_k \alpha_k = \infty $ and $\sum_k \alpha^{2}_{k} \geq \infty $.
Furthermore, let ${P_a(k)}$, with $a \in \mathcal{V}$, be the set points generated by Algorithm \ref{alg:distributed_transactive_control} and $X = \cap^{N+M}_{a=1}X_a$ be the intersection set between all feasible sets of the agents. Then, $P_a(k)$ with $a \in \mathcal{V}$ converges to the optimal solution $P_{a}^{*}$ with $P_{a}^{*} \in X$, that is

\begin{align*}
		\lim_{k\to\infty} P_a(k) = P_{a}^{*}.
		\end{align*}
\end{thm}

\begin{pf}
		Without loss of generality, all agents can be listed such as in \eqref{eqn:opt_generalized}. The optimization problem defined in \eqref{eqn:opt} can be generalized as

		\begin{mini!}[2]
			{P_{a}}{\sum_{a=1}^W -U_{a}(P_{a})}
			{\label{eqn:opt_generalized}}{}
			\addConstraint{\sum_{a=1}^W P_{a}}{=0} \label{eqn:global_cons_generalized
			\addConstraint{\overline{P_{a}}\geq P_{a} \geq \underline{ P_{a}}}{\quad \forall a  \in W}\label{eqn:limits_generalization}
		\end{mini!}

where $W=N+M$, and

\begin{subequations}
			\begin{align}
			P_a(k)=
			\begin{cases}
			P_{d_j},	&  j=1,..., M\\
			-P_{g_{i+M}}, 	&  i=M+1,...,W
			\end{cases}
			\end{align}
			\begin{align}
			U_a(\cdot)=
			\begin{cases}
			U_j(\cdot),		&  j=1,..., M\\
			-C_i(\cdot), 		&  i=M+1,...,W
			\end{cases}
			\end{align}
		\end{subequations}

 The constraints \eqref{eqn:Tc_gen_constraints} and \eqref{eqn:Tc_con_constraints} are satisfied through the stepsize $\alpha_k$. Let $X_{t_{a}}$ be the set where \eqref{eqn:Tc_gen_constraints} and \eqref{eqn:Tc_con_constraints} are feasible.  Let $\mathcal{D}$ be the diameter of the set $X_{t_{a}}$, i.e., $\mathcal{D}=\max_{x,y}||x-y||$, where $x, y\in X_{t_{a}}$. Then, there exists an $\alpha_k$ such that $\alpha_k d_a(k) \in \mathcal{D}\hspace{0.15cm} \forall \hspace{0.15cm} k$ and thus satisfying restrictions \eqref{eqn:Tc_gen_constraints} and \eqref{eqn:Tc_con_constraints}. Moreover, constraints \eqref{eqn:global_cons_generalized} and \eqref{eqn:limits_generalization} can be written such as $X = \cap^{W}_{a=1}X_a \cap X_g$, where $X_g$ is the set of feasible solutions for \eqref{eqn:global_cons_generalized}. It is possible to write \eqref{eqn:opt_generalized} such as

		\begin{mini!}[2]
			{P_{a}}{\sum_{a=1}^W -U_{a}(P_{a})}
			{\label{eqn:theorem_Nedic}}{}
			\addConstraint{X = \cap^{W}_{a=1}X_a \cap X_g}{}
		\end{mini!}

It is assumed that $X_a$ and $X_g$ are compact sets. Given that all utility functions $U_{a}(P_{a})$ are continuous, and based on Weierstrass' Theorem \eqref{eqn:theorem_Nedic} has an optimal solution $P_{a}^{*} \in X$. { Considering that $\frac{v_a(d)}{N_a+M_a}$ in \eqref{eqn:updatelaw} is equal to $\lim_{k\to\infty}\frac{1}{N+M}\sum_{a\in M+N}P_a$ and} according to   \cite[Proposition 5]{Ozdaglar2010} agents executing Algorithm \ref{alg:distributed_transactive_control} converges to $P_{a}^{*} \in X$. $\blacksquare$
        \end{pf}

\begin{figure}[tb]
			\centering

            \input{algorithm.tex}
			\caption{Flowchart of distributed transactive algorithm}
			\label{fig:c}
\end{figure}
    \section{Case Studies}\label{sec:cases}

In this section, we simulate a distribution system with five distributed generators and five consumers able to change its loads, depending on the system state. We seek to maximize the social welfare of the population of generator and consumers. Agents have limited power generation and demand, and consumers and generators satisfy Assumption 2. In order to simplify $\underline{T_{a}}$ and $\overline{T_{a}}$ for all agent, they are assumed as $-100$ and $100$ respectively.

	\begin{table}[htb]
		\caption{System Parameters in Simulation}
\begin{center}
		\label{table:Agents_data}
		\begin{tabular}{@{}ccc|ccc@{}}
\toprule
\multicolumn{1}{l}{\textbf{Generator}} & \multicolumn{1}{l}{$\mathbf{\overline{P_{g_i}}}$} & \multicolumn{1}{l|}{$\mathbf{\underline{P_{g_i}}}$} & \multicolumn{1}{l}{\textbf{Consumers}} & \multicolumn{1}{l}{$\mathbf{\overline{P_{d_j}}}$} & \multicolumn{1}{l}{$\mathbf{\underline{P_{d_j}}}$} \\ \midrule
1                     & 4000                & 100                      & 1                                      & 4100                                & 3000                                 \\
2                    & 6000               & 100                       & 2                                      & 5200                                & 4000                                 \\
3                   & 7000                 & 100                     & 3                                      & 6300                                & 5000                                \\
4                & 8000                 & 100                        & 4                                      & 6400                                & 5000                                \\
5                   & 9000                  & 100               & 5                                      & 7500                                & 6000                                \\
                  &                  &                            & 6                                      & 2000                                & 0                                \\ \bottomrule
\end{tabular}
	\end{center}
\end{table}

\subsection{Simulation with Smart Loads}

    \begin{figure*}[ht]
        \begin{subfigure}{.3\textwidth}
			\centering

            \input{generators.tex}
			\caption{Power generation in the system }
			\label{fig:case2_generation}
		\end{subfigure}
		\begin{subfigure}{.3\textwidth}
			\centering

            \input{loads.tex}
			\caption{Power consumed in the system}
			\label{fig:case2_demanded}
		\end{subfigure}
		\begin{subfigure}{.3\textwidth}
			\centering

            \input{globalcost.tex}
			\caption{Power cost in the system}
			\label{fig:case2_cost}
		\end{subfigure}
        \centering
		\caption{Simulations of system with Smart Loads}
		\label{fig:Case_2}
	\end{figure*}

We use five generators and five smart loads and the parameters in Table \ref{table:Agents_data} for each agent. Smart loads and generators are connected indistinctly, i.e., it is not necessary that the system has a specific topology. Each $750$ iterations the base load changes in the simulation, it is considered the case where loads $4$ and $5$ rise up its base loads to $1000$ W. We refer to time instant $k$ as iterations. Figure \ref{fig:case2_generation}  shows the  power delivered by each generator, it is possible to see that instead of the changes in the load, generators can supply the exact power demanded. Figure \ref{fig:case2_demanded} shows the simulation results for the power demanded by Smart Loads. Figure \ref{fig:case2_demanded} shows that smart loads lower their consumption when the power cost in the system rises as a result of the increase in fixed load. The cost power is shown in Figure \ref{fig:case2_cost}. Figure \ref{fig:case2_cost} shows clearly that the price increases as more power is required by the loads, therefore adjustable loads reduce its consumption as is shown in Figure \ref{fig:case2_demanded}.

    \subsection{Adding a New Agent to the System: Smart Load}

In this subsection we add a smart load to the system, the new agent is the consumer $6$. When we add this agent to the system, we assume that the system can recognize it and execute Algorithm MDST in subsection \ref{subsec:DAMDST}. It is possible observe in Figure \ref{fig:case_P} and Figure \ref{fig:case2_P_na} that we add the new agent at $750$ iterations since the new agent is configured in the system and demand power, the cost of the energy in the system will increase, it is possible to observe that generation matches exactly the power demanded.  We remove at $1500$ iterations two agents to the system, consumers $5$ and $6$, leaving the system with $5$ generators and $4$ consumers, for this reason, power cost decreases and variable loads of agent $1$, $2$ and $4$ rise its load. Despite the rise of load, the total load demanded by the system when two agents are removed is lower than the load in the previous state. Therefore, in Figure \ref{fig:case_P} power generated decreases matching the demanded power.

	\begin{figure*}[ht]
		\centering
		\begin{subfigure}{.45\textwidth}
			\centering

			\input{gen_1.tex}
			\caption{Power generation when other agent is added}
			\label{fig:case_P}
		\end{subfigure}
		\begin{subfigure}{.45\textwidth}
			\centering

            \input{loads_1.tex}
			\caption{Power consumed when other agent is added}
			\label{fig:case2_P_na}
		\end{subfigure}
		\caption{System simulations when other agent consumer is added to the system}
		\label{fig:Case_32}
	\end{figure*}

\section{Conclusion and Future Work}\label{sec:conclusions}

We proposed a new control strategy in the dispatch of distributed generators and demand of the users in power systems based on a transactive control framework. We consider some constraints in the generators and consumers with satisfactory results. Besides, we demonstrate that distributed transactional controllers are capable of addressing problems with distributed information in power systems. The simulation results show that the distributed transactional control algorithm achieves optimal social welfare in a dynamic way while maintaining system constraints in a power network. The study of adversarial agents in the power system for transactive control requires future study.


\section{Introduction}
The Ritt problem is an algebraic treatment of the following phenomenon
occurring with differential equations. One can show that the solution set
to the differential equation $y'^2-4y=0$ consists of a family of parabolae
and the zero special solution. The solution set to the equation $y'^2-4y^3 =0$
consists of hyperbolae and the zero solution as well. The major difference between
these two solution sets is that in the first case the zero solution is not a limit
of the family while in the second case it is. In the algebraic language, the first
equation does not generate a prime differential ideal, while the second one
does. The Ritt problem is a generalisation of this phenomenon to the case
of several non-linear algebraic PDEs.

 More precisely, consider a differential polynomial ring over a differential
  field of characteristic zero.
  J.F.~Ritt has shown that every radical differential ideal
  can be uniquely represented as a finite intersection of its
  essential prime components, which are the minimal prime
  differential ideals containing it.
  We call the problem of computing the characteristic sets of
  the essential prime components, given a finite set of
  generators of a radical differential idea, the generalised
  Ritt problem.
  As of today, the problem remains largely unsolved, with some
  important special cases having been treated by J.F.~Ritt,
  H.~Levi, E.R.~Kolchin, and R.M.~Cohn \cite{Kol,Levi,Rit,Cohn1,Cohn2}.

  We give a precise formulation of this problem as a
  computational problem, emphasise its dependence on the
  differential field, and then reformulate the problem
  to make it field-independent. One of the versions of the Ritt problem
  that we discuss here is given in terms of zero-divisors modulo an
  ideal. In particular, when we test primality by definition for a
  pair of polynomials each not in the ideal we need to determine whether
  their product is in the ideal. This sentence has two universal
  quantifiers, one for each polynomial. We show that it
  is sufficient to quantify with respect to just one polynomial.

  To illustrate these ideas
  we also exhibit an algorithm whose input is a finite set $F$ of differential polynomials
  and the output is a collection of prime differential ideals given by their characteristic
  sets such that:
  \begin{itemize}
  \item the radical differential ideal $I$ generated by $F$ is the intersection of the prime differential ideals and
  \item this set of prime differential ideals is uniquely determined just by the ideal $I$
  and does not depend on the chosen set of generators $F$.
  \end{itemize}   We hope that the
  approach we propose in this paper will bring us closer to determining decidability of the Ritt problem.

\section{Basic definitions}
Let ${\mathbf k}$ be a differential field of characteristic zero
with derivations $\Delta=\{\delta_1,\ldots,\delta_m\}$.
Let $Y=\{y_1,\ldots,y_n\}$ be a finite set of differential
indeterminates and $$\Theta Y := \left\{\delta_1^{i_1}\cdot\ldots\cdot\delta_m^{i_m}y_j\:|\:i_k\geqslant 0, 1\leqslant k\leqslant m;\: 1\leqslant j\leqslant n\right\}.$$ The ring
of differential polynomials ${\mathbf k}\{Y\}$ is the ring of commutative
polynomials ${\mathbf k}[\Theta Y]$ with the natural structure of a $\Delta$-ring.

Let $I$ be a radical differential ideal in ${\mathbf k}\{Y\}$, that is,
a radical ideal stable under the action of $\Delta$.
A prime differential ideal $P$ is called an
{\it essential prime component}
of $I$ if $I\subseteq P$ and there is no prime differential
ideal $Q$ satisfying $I\subseteq Q\subsetneq P$.
According to \cite{Rit}, every radical differential ideal $I$
has finitely many essential prime components and equals
their intersection; every prime differential ideal containing $I$
must contain an essential prime component of $I$; and every
set of prime differential ideals whose intersection equals $I$
contains the set of essential prime components of $I$ as
a subset. The {\it generalised Ritt problem} is: given a
radical differential ideal, find its essential prime components.

To formulate it as a computational problem, we need to
fix an encoding of the input (a radical differential ideal in
${\mathbf k}\{Y\}$), and of the output (a finite set of prime differential
ideals in ${\mathbf k}\{Y\}$).
A radical differential ideal is usually given by a finite
generating set of differential polynomials. To be able
to compute with them, we have to assume that ${\mathbf k}$ is a computable
differential field. The following definition is directly derived
from \cite[Definition 5]{Rabin}, see \cite{Miller08}:

\begin{defi}
   A differential ring $R$ is called computable, if
   there exists an embedding
   $$i: R \to {\mathbb N}$$
   such that
   \begin{enumerate}
      \item The image $i(R)$ is a recursive subset of ${\mathbb N}$
      \item The addition, multiplication, and derivation
        functions induced on this image by the addition,
        multiplication, and derivations on $R$ are
        computable functions.
   \end{enumerate}
\end{defi}

The embedding $i$ in the above definition is called
an {\it admissible indexing} of $R$.
If ${\mathbf k}$ is a computable differential field, then the ring of
differential polynomials ${\mathbf k}\{Y\}$ is a computable differential
ring: the value of an admissible indexing $j:{\mathbf k}\{Y\}\to {\mathbb N}$ can
be effectively computed for each differential polynomial
$f\in{\mathbf k}\{Y\}$, given the indices of its coefficients w.r.t.
the indexing $i:{\mathbf k}\to{\mathbb N}$ \cite{Rabin}.

Having fixed such an indexing $j$, we can unambiguously
say that a differential polynomial $f\in{\mathbf k}\{Y\}$
is {\it given}, meaning that actually $j(f)$ is given.
A prime differential ideal can be given either by
a generating set (since it is radical), or by a
characteristic set. The latter is defined as follows.
Define a ranking on
$\Theta Y$
as a total
order relation $\le$ satisfying:
$$u\le\delta u,\;\;\;u\le v\;\Rightarrow\delta u\le\delta v$$
for all $u,v\in\Theta Y$, $\delta\in\Delta$.
For a differential polynomial $f\in{\mathbf k}\{Y\}\setminus{\mathbf k}$,
call the derivative of the highest rank effectively present
in $f$ the leader of $f$, denoted $u=\mathop{\rm ld}\nolimits_\le f$.
If the degree of $f$ w.r.t. $u$ is $d$, then $u^d$ is
called the rank of $f$, denoted $\mathop{\rm rk}\nolimits_\le f$.
The ranking then extends to the set of ranks:
$$u_1^{d_1}\le u_2^{d_2}\;\iff\;u_1<u_2\;{\rm or}\;(u_1=u_2\;{\rm and}\:d_1\le d_2)$$
and to the set of all finite sets of ranks:
$R_1\le R_2$ iff either $R_1=R_2$, or else the minimal element
of the symmetric difference
$(R_1\setminus R_2)\cup (R_2\setminus R_1)$ belongs to $R_1$.
All three relations: $\le$ on the set of derivatives,
$\le$ on the set of ranks, and $\le$ on the set of finite sets
of ranks, are well-orderings.

Rankings are introduced, in order to be able to effectively represent
prime differential ideals by their characteristic sets, which allow
to test membership and solve other algorithmic problems. The latter
are defined as follows.

A differential polynomial $f$ is said to be reduced w.r.t. a differential
polynomial $g$, if for any derivative operator $\theta\in\Theta$, the degree
of $f$ w.r.t. to the the leader of $\theta g$ is less than that of $\theta g$.
A set of differential polynomials is called autoreduced, if each element
of this set is reduced w.r.t. the rest. Every autoreduced set is finite.
Among all autoreduced subsets of a given set of differential polynomials
$X$, choose one with the least set of ranks (which exists, because
$\le$ is a well-ordering on the set of finite sets of ranks).
This set is called a characteristic set of $X$. Note that the characteristic
set may not be unique, but its set of ranks is.

Consider a differential polynomial $f$ as a polynomial in its leader $u$. Then
the leading coefficient of $f$ is called its initial, and the initial
of any proper derivative $\theta f$, where $\theta\in\Theta\setminus\{1\}$,
is called the separant of $f$. For a finite set ${\mathcal C}$ of differential polynomials,
denote by $H_{\mathcal C}$ the product of the initials and separants of its elements.
It is a well-known fact (see e.g. \cite{Kol}) that every prime differential
ideal $P$ can be represented by its characteristic set ${\mathcal C}$ as
$$P=[{\mathcal C}]:H_{\mathcal C}^\infty,$$
that is, as the differential ideal generated by ${\mathcal C}$ and saturated by
the initials and separants of ${\mathcal C}$. We will extensively exploit this
representation in the paper.

\section{Main result}

\subsection{Different ways of posing the Ritt problem}
We give a list of equivalent formulations of the Ritt problem below and will use
one of them to attack the problem. We note that the equivalence takes place only
for the fields ${\mathbf k}$ with a {\it splitting algorithm}, that is, an algorithm
which, given a univariate polynomial $f\in {\mathbf k}[x]$, determines whether $f$ is
irreducible. This requirement is usually imposed in the context of polynomial
factorisation problems over ${\mathbf k}$ (see, e.g., \cite{Winkler, MillerGalois}).
Examples of computable fields with splitting algorithm include the fields of
rational numbers and rational functions, and their algebraic closures. An
example of a computable field without splitting algorithm is given in
\cite{MillerGalois}: take a computably enumerable but non-computable
subset $S$ of the natural numbers, and consider the field ${\mathbb Q}[\sqrt{p_n}: n\in S]$,
where $p_n$ is the $n$-th prime. By considering the field of fractions over
this field, we obtain a non-trivial differential field without splitting
algorithm. As in \cite[Section 5]{Miller08}, we suggest to think of the Ritt
problem, especially of its third and fourth formulations in the theorem below,
as a generalisation of the polynomial factorisation problem.

\begin{theorem}
  The following problems are equivalent over a computable differential field
  of characteristic zero with a splitting algorithm (an algorithmic
  solution for any one of them will also provide algorithms for the rest):
\begin{enumerate}
  \item Given a characteristic set of a prime differential
    ideal, find a set of its generators.
  \item Given the characteristic sets of two prime differential
    ideals $I_1$ and $I_2$, determine whether $I_1\subset I_2$.
  \item Compute a non-redundant prime decomposition of
    a radical differential ideal.
  \item Given a radical differential ideal specified by
    a set of generators, determine whether it is prime.
  \item Given a radical differential ideal specified by
    a set of generators, compute its prime decomposition together
    with the generators of the prime components as radical
    differential ideals.
  \item Given a radical differential ideal $I$ specified by
    a set of generators and a differential polynomial $f$,
    determine whether $f$ is a zero-divisor modulo $I$.
\end{enumerate}
\end{theorem}
\begin{proof}
  \begin{enumerate}
    \item[$1\Rightarrow 2$] Assume that we have an algorithm for
      finding generators of a prime differential ideal specified
      by its characteristic set. Applying this algorithm to the
      characteristic set of $I_1$, compute its generator
      system $F_1$, i.e., $I_1=\{F_1\}$. Then $I_1\subset I_2$
      if and only if $F_1\subset I_2$.
    \item[$2\Rightarrow 3$] Given a radical differential ideal
      $\{F\}$, one can apply the Ritt-Kolchin algorithm~\cite[Section IV.9]{Kol},
      \cite[Algorithm 5.5.15]{Pan}, \cite[Section 10]{Sit} to compute
      its prime decomposition $$\{F\}=P_1\cap\ldots\cap P_k,$$
      where each prime component is represented by its
      characteristic set.

      Note that the Ritt-Kolchin algorithm requires to test whether
      algebraic ideals of the form $({\mathcal C}):H_{\mathcal C}^\infty$,
      where ${\mathcal C}$ is a coherent~\cite[Section III.8]{Kol}
      autoreduced set, are prime and, if not, to find two polynomials
      not from the ideal, whose product
      belongs to the ideal. Apart from this test, the Ritt-Kolchin
      algorithm can be executed over any computable differential
      field of characteristic zero.

      The special case of ${\mathcal C}$ consisting of a single univariate
      polynomial shows that the existence of a splitting algorithm
      over ${\mathbf k}$ is necessary for the above primality test.
      We will show that it is also sufficient. For the proof
      of sufficiency of slightly stronger requirements see
      \cite[Section 5.5]{Pan}.

      Indeed, if ${\mathcal C}$ is coherent autoreduced, then the ideal $({\mathcal C}):H_{\mathcal C}^\infty$
      is radical \cite{Bou1,Fac}.
      A basis of this ideal can be computed over any computable field
      using Gr\"obner bases \cite[Section 4.4]{Cox}. Then, the generators of the
      associated primes of the ideal can be computed over any computable
      field with the splitting algorithm \cite{EHV}. If there is only one
      associated prime, the ideal is prime. Otherwise, by picking in each
      associated prime a polynomial that does not belong to the other associated
      primes (which can be done with Gr\"obner bases over any computable field),
      we can find the required product.

      Assume that we have an algorithm for checking inclusion
      of prime differential ideals. Then in the above decomposition
      we can remove all redundant components, i.e., those $P_i$
      that contain another $P_j$. The resulting components will
      be essential, since any prime decomposition of a radical
      ideal contains all essential components. Hence, we obtain
      the non-redundant (essential) decomposition of $\{F\}$.
    \item[$3\Rightarrow 4$] Assume that we have an algorithm
      for computing a non-redundant (=essential) prime decomposition
      of a radical differential ideal $\{F\}$. Then $\{F\}$ is
      prime if and only if this decomposition consists of one
      component.
    \item[$4\Rightarrow 1$] Given a characteristic set ${\mathcal C}$ of a prime
      differential ideal $P$. Consider the algebraic ideals
      $J_i=\left({\mathcal C}^{(i)}\right):H_{\mathcal C}^\infty$, $i=0,1,2,\ldots$, where
      $${\mathcal C}^{(i)}=\{\theta f\;|\;\ord\theta\le i,\;f\in {\mathcal C}\}.$$
      Let $F_i$ be a system of generators of $J_i$ (e.g., its
      Gr\"obner basis). By the basis theorem, there exists an index
      $i$ such that $\{F_i\}=P$.

      Assume that we have an algorithm for determining whether
      a radical differential ideal $\{F\}$ is prime. Applying
      this algorithm to $\{F_i\}$, $i=0,1,2,\ldots$, find
      the least $i$ such that $\{F_i\}$ is prime. Then, since
      ${\mathcal C}$ is a characteristic set of $\{F_i\}$, we will have
      $\{F_i\}=P$, hence $F_i$ generates $P$ as a radical differential
      ideal.
    \item[$1\Rightarrow 5$] Given a radical differential ideal, one
      can apply the Ritt-Kolchin algorithm to compute its prime decomposition,
      where each prime component is represented by its characteristic
      set. Assuming that we have an algorithm for computing generators
      of a prime differential ideal, given its characteristic set,
      we obtain the generators of the components.
    \item[$5\Rightarrow 3$] Assume that we have an algorithm for
      computing a prime decomposition of a radical differential
      ideal together with the generators of the prime components.
      Then we can check inclusion of the components as in the proof
      $1\Rightarrow 2$ and thus exclude redundant components
      as in $2\Rightarrow 3$.
    \item[$3\Rightarrow 6$] Assume that we have an algorithm for
      computing an essential prime decomposition $I=P_1\cap\ldots\cap P_k$
      of a radical differential ideal $I=\{F\}$.

      \begin{lemma}
         A differential polynomial $f$ is a zero-divisor modulo $I$
         if and only if it belongs to an essential prime component of $I$.
      \end{lemma}
      \begin{proof}
      Let $f$ be a zero-divisor modulo $I$. Then by definition
      there exists a differential polynomial $g\not\in I$ such that
      $fg\in I$. Since $g\not\in I$, there exists an essential prime
      component $P_i$ of $I$ which does not contain $g$, yet $fg\in I$
      implies $fg\in P_i$. Since $P_i$ is prime, we obtain $f\in P_i$.

      Vice versa, let $f$ be an element of an essential prime
      component of $I$. Let $P_{i_1},\ldots,P_{i_l}$ be the essential prime
      components of $I$ not containing $f$. Then for
      the ideal $I:f=\{g\;|\;gf\in I\}$, we have
      $$I:f=(P_1\cap\ldots\cap P_k):f=(P_1:f)\cap\ldots\cap(P_k:f)=P_{i_1}\cap\ldots\cap P_{i_l}.$$
      Since $P_1\cap\ldots\cap P_k$ is a non-redundant prime
      decomposition of $I$, we obtain $I:f\neq I$, hence $f$ is a
      zero-divisor modulo $I$.
      \end{proof}
    \item[$6\Rightarrow 1$] The proof of this implication is similar
      to $[4\Rightarrow 1]$.

      Given a characteristic set ${\mathcal C}$ of a prime
      differential ideal $P$. Consider the algebraic ideals
      $J_i=\left({\mathcal C}^{(i)}\right):H_{\mathcal C}^\infty$, $i=0,1,2,\ldots$.
      Let $F_i$ be a system of generators of $J_i$.
      By the basis theorem, there exists an index
      $i$ such that $\{F_i\}=P$. Note that the product $H_{\mathcal C}$
      of initials and separants of ${\mathcal C}$ is not a zero-divisor
      modulo $\{F_i\}$, since
      $$P=\{F_i\}\subseteq\{F_i\}:H_{\mathcal C}^\infty\subseteq [{\mathcal C}]:H_{\mathcal C}^\infty=P.$$

      Assume that we have an algorithm for determining whether
      a polynomial $f$ is a zero-divisor modulo a radical differential
      ideal $\{F\}$. Applying this algorithm to $H_{\mathcal C}$ and
      $\{F_i\}$, $i=0,1,2,\ldots$, find the smallest index $i$ such that the
      $H_{\mathcal C}$ is not a zero-divisor modulo $\{F_i\}$ (as we
      have shown above, such an index exists).
      Then $\{F_i\}:H_{\mathcal C}^\infty=\{F_i\}$. On the other hand,
      $\{F_i\}:H_{\mathcal C}^\infty=P$, since ${\mathcal C}\subset \{F_i\}$. Thus,
      $\{F_i\}=P$.
 \end{enumerate}
\end{proof}
\subsection{Canonical prime decomposition of a radical differential ideal}
In this section we will show how one can produce a prime decomposition of
a radical differential ideal $I$ given by a finite set of generators $F$ that does not
depend on this particular choice of generators. A good candidate for this decomposition
would be the essential prime decomposition but, again, it is still unknown whether
the latter is computable. Our procedure is based on two simple observations
contained in Lemma~\ref{l1} and Proposition~\ref{p1}.

Assume that a ranking is fixed. Then a prime differential ideal has a canonical
characteristic set uniquely determined by the ideal \cite{Bou3,canonical,Pol,Dif}.
And given $F \subset {\mathbf k}\{Y\}$ we can compute some prime decomposition
\begin{equation}\label{decomposition}
I = \{F\} = \bigcap_{i=1}^k[{\mathcal C}_i]:H_{{\mathcal C}_i}^\infty,
\end{equation}
where ${\mathcal C}_i$ are the canonical characteristic sets of the corresponding prime
differential ideals.

\begin{lemma}\label{l1} Let ${\mathcal C}$ be a characteristic set of the highest rank among ${\mathcal C}_1,\ldots,{\mathcal C}_k$. Then the ideal $P := [{\mathcal C}]:H_{\mathcal C}^\infty$ is an essential prime component
of $I$ of the highest rank, among all essential prime components of $I$.
\end{lemma}
\begin{proof}
Let $Q = [{\mathcal B}]:H_{\mathcal B}^\infty$, where ${\mathcal B}$ is the canonical characteristic set of $Q$, be an essential
prime component of $I$ such that $P\supseteq Q$. Because of this inclusion and the definition of
the characteristic set as an autoreduced subset of the least rank, we have $\mathop{\rm rk}\nolimits{\mathcal C} \le \mathop{\rm rk}\nolimits{\mathcal B}$.
Moreover, since $Q$ is an essential prime component of $I$, it must be among the ideals
$[{\mathcal C}_i]:H_{{\mathcal C}_i}^\infty$, $i=1,\ldots,k$, which means that ${\mathcal B}={\mathcal C}_l$ for some $l$, $1\leqslant l\leqslant k$.
Thus, due to the choice of ${\mathcal C}$, we have $\mathop{\rm rk}\nolimits{\mathcal C}\ge\mathop{\rm rk}\nolimits{\mathcal B}$. We conclude therefore that $\mathop{\rm rk}\nolimits{\mathcal C} = \mathop{\rm rk}\nolimits{\mathcal B}$.
Hence, according to \cite[Lemma 13]{canonical}, prime differential ideals $P$ and $Q$ are equal.
\end{proof}

\begin{proposition}\label{p1} Let $I=\{F\}$ be a radical differential ideal, and let
${\mathcal C} = C_1,\ldots,C_l$ be a finite set of differential polynomials satisfying
${\mathcal C}\subset I\subset [{\mathcal C}]:H_{\mathcal C}^\infty$.
 Then{ }\footnote{Admitting
a slight abuse of notation in this formula, we denote by $F\cup H_{\mathcal C}$
the union of the set $F$ and the singleton set containing $H_{\mathcal C}$.}
$$
I = [{\mathcal C}]:H_{\mathcal C}^\infty\cap I:C_1\cap\ldots\cap I:C_l\cap\{F\cup H_{\mathcal C}\}.
$$
\end{proposition}
\begin{proof} Let
$$f \in [{\mathcal C}]:H_{\mathcal C}^\infty\cap I:C_1\cap\ldots\cap I:C_l\cap\{F\cup H_{\mathcal C}\}.$$ Then
$$C_i\cdot f \in I,\ 1\leqslant i\leqslant l$$ and there exists $h \in H_{\mathcal C}^\infty$ such that
$$h\cdot f\in [{\mathcal C}].$$
We then have
$$
h\cdot f^2 \in f\cdot[{\mathcal C}] \subset \{f\cdot C_1,\ldots,f\cdot C_l\} \subset I.
$$
and, therefore, $f \in \{F\}:H_{\mathcal C}^\infty$.
Since due to, for example, \cite[Proposition 2.1]{Fac}
$$\{F\} = \{F\}:H_{\mathcal C}^\infty\cap\{F\cup H_{\mathcal C}\},
$$ we conclude that
$f \in I$. The other inclusion follows from $I \subset [{\mathcal C}]:H_{\mathcal C}^\infty$.
\end{proof}

If in decomposition~\eqref{decomposition} there are several characteristic sets of the
highest rank, say, ${\mathcal C}_1,\ldots,{\mathcal C}_q$, and ${\mathcal C}_i = C_{i,1},\ldots,C_{i,p_i}$, $1\leqslant i \leqslant q$, then
\begin{align}\label{decomposition2}
I =[{\mathcal C}_1]:H_{{\mathcal C}_1}^\infty&\cap I:C_{1,1}\cap\ldots\cap I:C_{1,p_1}\cap\left\{F\cup H_{{\mathcal C}_1}\right\}\cap\ldots\\
&\cap \left[{\mathcal C}_q\right]:H_{{\mathcal C}_q}^\infty\cap I:C_{q,1}\cap\ldots\cap I:C_{q,p_q}\cap\left\{F\cup H_{{\mathcal C}_q}\right\}.\notag
\end{align}
Note that ${\mathcal C}_1,\ldots,{\mathcal C}_q$ and, therefore, all ideals in~\eqref{decomposition2} are uniquely determined by $I$, that is, they do not depend on the choice of generators
of $I$. Moreover, the ideals
\begin{align}\label{id1}
I:C_{i,j}
\end{align}
and
\begin{align}\label{id2}
\left\{F\cup H_{{\mathcal C}_i}\right\}
\end{align}
strictly
contain $I$, $1\leqslant i \leqslant q$, $1\leqslant j \leqslant p_i$. Indeed, all $C_{i,j}$ are elements of essential
prime components of $I$, therefore $I:C_{i,j}\supsetneq I$. And, since $H_{{\mathcal C}_i}$ does not belong to
the corresponding essential prime component $[{\mathcal C}_i]:H_{{\mathcal C}_i}^\infty$, it does not belong
to $I$, and we have $\{F\cup H_{{\mathcal C}_i}\}\supsetneq I$.

By the Ritt-Raudenbush theorem,
a strictly increasing chain of radical differential ideals terminates. Therefore, by
computing recursively the canonical, generator-independent prime decomposition
of~\eqref{id1} and~\eqref{id2}, we obtain a generator-independent decomposition
of the original ideal $I$. We note that the prime decomposition required
in step~\eqref{decomposition} can be computed for the radical ideals given in
a saturated form, as in~\eqref{id1}.

\subsection{Ranking-independent canonical decomposition and generators}

Even though the canonical prime decomposition computed by the method described in the previous
section is independent of the given generators of the radical ideal $I$, it does
depend on the choice of ranking. It is possible to obtain a ranking-independent canonical
prime decomposition via the following modification. As in~\eqref{decomposition}, compute
any prime decomposition of $I$. Then, instead of extracting the characteristic sets of the
highest rank w.r.t. a fixed chosen ranking (this step is ranking-dependent), take
all prime components whose canonical characteristic sets have the highest rank w.r.t. {\it some}
ranking, and consider all {\it these} characteristic sets instead of the above ${\mathcal C}_1,\ldots,{\mathcal C}_q$.
This step can be accomplished by computing the universal characteristic set \cite{ucs} for each
prime component. The remaining steps are the same.

Finally, from the canonical prime decomposition
 $$I = \bigcap_{i=1}^k[{\mathcal C}_i]:H_{{\mathcal C}_i}^\infty$$
one can obtain a canonical set of generators of the radical differential ideal, which
depends only on this ideal. For $j=0,1,2,\ldots$ consider the algebraic ideal
  $$I_j = \bigcap_{i=1}^k\left({\mathcal C}_i^{(j)}\right):H_{{\mathcal C}_i}^\infty$$
and compute its Gr\"obner basis ${\mathcal B}_j$ w.r.t. the lexicographic term order induced
on power products of derivatives by the ranking (if a ranking-independent
canonical set of generators is sought, compute the universal Gr\"obner basis).
Stop at the least value of $j$ such that $\{{\mathcal B}_j\}=I$, and output ${\mathcal B}_j$. Such $j$
exists, because $I=\bigcup_{j=0}^\infty I_j$. Note that the
equality of two radical differential ideals given by generators can
be checked by testing membership of generators of one ideal to the other ideal.

\section{Acknowledgemenets}
We thank Michael Singer and William Sit for their helpful suggestions and support,
and Russell Miller for the introduction to the theory of computable fields and
subsequent discussions of this topic in connection with the Ritt problem.

\bibliographystyle{amsplain}