private void SetVolts(double volt, int voltIndex)
        {
            if (!IsRatesLengthStable)
            {
                return;
            }
            if (double.IsInfinity(volt) || double.IsNaN(volt))
            {
                return;
            }
            UseRates(rates => rates.BackwardsIterator().TakeWhile(r => GetVoltByIndex(voltIndex)(r).IsNaN())
                     .ForEach(r => SetVoltByIndex(voltIndex)(r, volt)));
            //SetVoltage(RateLast, volt);
            var voltRates = RatesArray.Select(GetVoltByIndex(voltIndex)).SkipWhile(v => v.IsNaN())
                            .Scan((p, n) => n.IsNaN() ? p : n)
                            .ToArray();

            if (voltRates.Any())
            {
                GeneralPurposeSubject.OnNext(() => {
                    try {
                        var voltageAvgLow = voltRates.AverageByIterations(-VoltAverageIterationsByIndex(voltIndex)).DefaultIfEmpty(double.NaN).Average();
                        SetVoltLowByIndex(voltIndex)(voltageAvgLow);
                        var voltageAvgHigh = voltRates.AverageByIterations(VoltAverageIterationsByIndex(voltIndex)).DefaultIfEmpty(double.NaN).Average();
                        SetVoltHighByIndex(voltIndex)(voltageAvgHigh);
                    } catch (Exception exc) { Log = exc; }
                });
            }
        }
        //    SetVoltHighByIndex(voltIndex)(min.Abs());
        //        SetVoltLowByIndex(voltIndex)(-min.Abs());

        private void SetVolts(double volt, Func <Rate, double> getVolt, Action <Rate, double> setVolt, double cma = 0)
        {
            if (!IsRatesLengthStable)
            {
                return;
            }
            if (double.IsInfinity(volt) || double.IsNaN(volt))
            {
                return;
            }
            var volt2 = cma > 0 ? GetLastVolt(getVolt).Select(v => v.Cma(cma, volt)).DefaultIfEmpty(volt).SingleOrDefault() : volt;

            UseRates(rates => rates.Where(r => getVolt(r).IsNaN()).ToList())
            .SelectMany(rates => rates).ForEach(r => setVolt(r, volt2));
            //SetVoltage(RateLast, volt);
            if (getVolt != GetVoltage)
            {
                return;
            }
            var voltRates = RatesArray.Select(getVolt).SkipWhile(v => v.IsNaN()).ToArray();

            if (voltRates.Any())
            {
                GeneralPurposeSubject.OnNext(() => {
                    try {
                        var voltageAvgLow  = voltRates.AverageByIterations(-VoltAverageIterations).DefaultIfEmpty(double.NaN).Average();
                        GetVoltageAverage  = () => new[] { voltageAvgLow };
                        var voltageAvgHigh = voltRates.AverageByIterations(VoltAverageIterations).DefaultIfEmpty(double.NaN).Average();
                        GetVoltageHigh     = () => new[] { voltageAvgHigh };
                    } catch (Exception exc) { Log = exc; }
                });
            }
        }