Root mean square function (RMS) in the ODEs of a dynamical system I am trying to obtain the differential equations of a dynamic system in which one of the blocks calculates the RMS of a signal. When arranging the ODEs I see that the differential version of the RMS formula is needed, if I'm not wrong. However I am finding difficulties deriving it from its usual form: 
$x_{rms}(t)=\sqrt{\frac{1}{T}\int_{t-T}^t x(\tau)^2 d\tau}$
Do I really need to use the derivative, or a different approach is needed to incorporate the block into the equations of the system for its simulation?
 A: I'm afraid I can't say something sensible about the use of the derivative, since I don't know the specifics of your system. However, it is possible to derive an ODE for $x_\text{rms}$.
Note that $x_\text{rms}$ is a function of $T$ only. Therefore, we can calculate its derivative to $T$: we obtain
\begin{align}
 \frac{\text{d} x_\text{rms}}{\text{d} T} &= \frac{1}{2 T^2 \sqrt{\frac{1}{T} \int_0^T x(t)^2 \text{d} t}}\left(-\int_0^T x(t)^2 \text{d} t + T \,x(T)^2\right) \\
&= \frac{- T^2 x_\text{rms}^2(T) + T\,x(T)^2}{2 T^2 x_\text{rms}(T)}\\
&= -\frac{1}{2}x_\text{rms}(T) + \frac{1}{2 T} \frac{x(T)^2}{x_\text{rms}(T)}.
\end{align}
Addition: Using the new expression for $x_\text{rms} $, we get
\begin{equation}
 \frac{\text{d} x_\text{rms}}{\text{d} t}(t) = \frac{x(t)^2 - x(t-T)^2}{2 T x_\text{rms}(t)}.
\end{equation}
This yields a delay differential equation in terms of $x$ and $x_\text{rms} $, which brings about its own issues in terms of solving. I strongly suggest you look into these aspects, using the term 'delay differential equation' as lead. 
