Ejemplo n.º 1
0
 public static decimal A1(decimal t, decimal tay)
 {
     if (t != tay)
     {
         return(VectorHelper.Mult(
                    VectorHelper.Div(
                        Parametrization_ND.X0(tay),
                        Parametrization_ND.X0(t)),
                    Normal.GetNormal(t,
                                     Parametrization_ND.X01d,
                                     Parametrization_ND.X02d))
                / (decimal)Math.Pow(
                    (double)Normal.GetModul(
                        VectorHelper.Div(
                            Parametrization_ND.X0(t),
                            Parametrization_ND.X0(tay)))
                    , 2));
     }
     else
     {
         return(VectorHelper.Mult(
                    new[] { Parametrization_ND.X01d2(t), Parametrization_ND.X02d2(t) },
                    Normal.GetNormal(t,
                                     Parametrization_ND.X01d,
                                     Parametrization_ND.X02d))
                / (2M * (decimal)Math.Pow(
                       (double)Normal.GetModul(new[]
         {
             Parametrization_ND.X01d(t),
             Parametrization_ND.X02d(t)
         })
                       , 2)));
     }
 }
Ejemplo n.º 2
0
        private decimal[] GetF1_G1(bool useNoisy)
        {
            var res = new decimal[2 * Parameters.M];

            Random  r           = new Random();
            decimal randomValue = (decimal)r.Next(0, 100) / 100M;

            var norma = 0.0M;

            for (int i = 0; i < res.Length; i++)
            {
                var t = (decimal)((decimal)i * (decimal)Math.PI) / (decimal)Parameters.M;
                res[i] = (decimal)(Math.Pow((double)Parametrization_ND.X11(t), 2) - Math.Pow((double)Parametrization_ND.X12(t), 2));
                norma += (res[i] * res[i]);
            }

            if (useNoisy)
            {
                for (int i = 0; i < res.Length; i++)
                {
                    res[i] = res[i] + Noisy * (2M * randomValue - 1M) * (decimal)Math.Sqrt((double)norma);
                }
            }

            return(res);
        }
Ejemplo n.º 3
0
        private static decimal[] GetH_1()
        {
            var res = new decimal[2 * Parameters.M];


            for (int i = 0; i < res.Length; i++)
            {
                var t    = (decimal)((decimal)i * (decimal)Math.PI) / (decimal)Parameters.M;
                var dod1 = 2M * Parametrization_ND.X11(t) * Parametrization_ND.X12d(t) / Normal.GetModul(new[]
                {
                    Parametrization_ND.X11d(t),
                    Parametrization_ND.X12d(t)
                });

                var dod2 = 2M * Parametrization_ND.X12(t) * Parametrization_ND.X11d(t) / Normal.GetModul(new[]
                {
                    Parametrization_ND.X11d(t),
                    Parametrization_ND.X12d(t)
                });

                res[i] = (dod1 + dod2);
            }

            return(res);
        }
Ejemplo n.º 4
0
 public static decimal H01(decimal t, decimal tay)
 {
     if (t != tay)
     {
         return((decimal)Math.Log(4 / Math.E *
                                  Math.Pow(
                                      Math.Sin(
                                          (double)(t - tay) / 2
                                          ), 2)
                                  / Math.Pow((double)Normal.GetModul(
                                                 VectorHelper.Div(
                                                     Parametrization_ND.X0(t),
                                                     Parametrization_ND.X0(tay))), 2)) / 2);
     }
     else
     {
         return((decimal)Math.Log(1 /
                                  (Math.E * Math.Pow((double)
                                                     Normal.GetModul(new[]
         {
             Parametrization_ND.X01d(t),
             Parametrization_ND.X02d(t)
         })
                                                     , 2))) / 2);
     }
 }
Ejemplo n.º 5
0
        public decimal[] CalculatePochidnaG0()
        {
            var res = new decimal[2 * Parameters.M];

            for (var j = 0; j < 2 * Parameters.M; j++)
            {
                decimal sum1 = 0;
                decimal sum2 = 0;

                var dod1 = (-destiny[j]) / (2M * Normal.GetModul(new[]
                {
                    Parametrization_ND.X01d(t[j]),
                    Parametrization_ND.X02d(t[j])
                }));
                //Normal.GetModul(t[j], Parametrization_ND.X01d, Parametrization_ND.X02d));
                for (var k = 0; k < 2 * Parameters.M; k++)
                {
                    sum1 += (destiny[k] * Kernels_DN.A1(t[j], t[k]));
                    sum2 += (destiny[k + 2 * Parameters.M] * Kernels_DN.A2(t[j], t[k]));
                }

                //res[j] = dod1 + (sum1 + sum2) / (2M * Parameters.M);
                res[j] = (sum1 + sum2) / (2M * Parameters.M);
            }

            return(res);
        }
Ejemplo n.º 6
0
 private decimal GetDod1(int j)
 {
     return(1M / (2M * Normal.GetModul(new[]
     {
         Parametrization_ND.X11d(t[j]),
         Parametrization_ND.X12d(t[j])
     })));
 }
Ejemplo n.º 7
0
 public static decimal H02(decimal t, decimal tay)
 {
     return((decimal)Math.Log(
                (double)(1M / (
                             Normal.GetModul(
                                 VectorHelper.Div(
                                     Parametrization_ND.X0(t),
                                     Parametrization_ND.X1(tay)))))));
 }
Ejemplo n.º 8
0
        private static decimal[] GetF1_0()
        {
            var res = new decimal[2 * Parameters.M];

            for (int i = 0; i < res.Length; i++)
            {
                var t = (decimal)((decimal)i * (decimal)Math.PI) / (decimal)Parameters.M;
                res[i] = (decimal)(Math.Pow((double)Parametrization_ND.X01(t), 2) - Math.Pow((double)Parametrization_ND.X02(t), 2));
            }

            return(res);
        }
Ejemplo n.º 9
0
        public decimal CalculateU(decimal[] x)
        {
            decimal sum1 = 0;
            decimal sum2 = 0;

            for (int k = 0; k < 2 * Parameters.M; k++)
            {
                sum1 += destiny[k] * Kernels_ND.Fundamental(x, new [] { Parametrization_ND.X01(t[k]), Parametrization_ND.X02(t[k]) });
                sum2 += destiny[k + 2 * Parameters.M] * Kernels_ND.Fundamental(x, new [] { Parametrization_ND.X11(t[k]), Parametrization_ND.X12(t[k]) });
            }

            return((sum1 + sum2) / (2M * Parameters.M));
        }
Ejemplo n.º 10
0
 public static decimal K11(decimal t, decimal tay)
 {
     return(VectorHelper.Mult(
                VectorHelper.Div(
                    Parametrization_ND.X0(tay),
                    Parametrization_ND.X1(t)),
                Normal.GetNormal(t,
                                 Parametrization_ND.X11d,
                                 Parametrization_ND.X12d))
            / (decimal)Math.Pow(
                (double)Normal.GetModul(
                    VectorHelper.Div(
                        Parametrization_ND.X1(t),
                        Parametrization_ND.X0(tay)))
                , 2));
 }
Ejemplo n.º 11
0
        private decimal ErrorL(decimal[] ex, decimal[] nabl)
        {
            var error = 0.0M;

            for (int i = 0; i < 2 * Parameters.M; i++)
            {
                var t = (decimal)((decimal)i * (decimal)Math.PI) / (decimal)Parameters.M;
                error += ((decimal)Math.Pow((double)(ex[i] - nabl[i]), 2) * Normal.GetModul(new [] { Parametrization_ND.X01d(t), Parametrization_ND.X02d(t) }));
            }

            return((decimal)Math.Sqrt((double)(error / (2M * Parameters.M))));
        }