Example #1
0
        public static double IntegralU0Der(Problem p, Vector<double> x)
        {
            double sum = 0;
            int count = 1;

            double a = 0.5 * ((double)p.f0.DynamicInvoke(p.Gamma0(0).a, p.Gamma0(0).b))
                * GreenFunction.NormalDerivative_Y_forU0(p, x, 0);

            for (double i = 0.05; i < 2 * Math.PI; i += 0.05)
            {
                sum += (double)p.f0.DynamicInvoke(p.Gamma0(i).a, p.Gamma0(i).b)
                * GreenFunction.NormalDerivative_Y_forU0(p, x, i);
                count++;
            }

            double b = 0.5 * ((double)p.f0.DynamicInvoke(p.Gamma0(2 * Math.PI).a, p.Gamma0(2 * Math.PI).b))
                * GreenFunction.NormalDerivative_Y_forU0(p, x, 2 * Math.PI);

            //2*pi*R/count
            return -(a + sum + b) * ((2 * Math.PI * p.R) / (double)count);
        }
Example #2
0
        //can't be evaluated on Г0
        public static double NormalDerivative_Y_forU0(Problem p, Vector<double> x , double t)
        {
            double GreenFunctionDer;
            double a;
            double b;
            Vector<double> yVect = p.Gamma0(t);
            Vector<double> yVectDeriv = p.Gamma0Derivative(t);

            //Green Function Variables
            double rZero = Math.Sqrt((Math.Pow(yVect.a, 2) + Math.Pow(yVect.b, 2)));
            double rAP = Math.Sqrt(Math.Pow(x.a - yVect.a, 2) + Math.Pow(x.b - yVect.b, 2));
            double rAStarP = Math.Sqrt(Math.Pow(x.a - (Math.Pow(p.R / rZero, 2)) * yVect.a, 2)
                             + Math.Pow(x.b - (Math.Pow(p.R / rZero, 2)) * yVect.b, 2));

            double rZero2 = rZero * rZero;
            double rAP2 = rAP * rAP;
            double rAStarP2 = rAStarP * rAStarP;

            //Constructing elements of the vector
            //if (Math.Abs(rAP) > 1e-10)
            //{
                a = -(yVect.a / rZero2)
                    + ((Math.Pow(p.R / rZero, 2)) * (x.a - (Math.Pow(p.R / rZero, 2)) * yVect.a)) / rAStarP2
                    - (x.a - yVect.a) / rAP2;
                b = -(yVect.b / rZero2)
                    + ((Math.Pow(p.R / rZero, 2)) * (x.b - (Math.Pow(p.R / rZero, 2)) * yVect.b)) / rAStarP2
                    - (x.b - yVect.b) / rAP2;
            //}
            //else
            //{

            //    double yDeriv2A = (p.Gamma0Derivative(yVect.a + 0.001).a - p.Gamma0Derivative(yVect.a - 0.001).a) * 2000;
            //    double yDeriv2B = (p.Gamma0Derivative(yVect.b + 0.001).b - p.Gamma0Derivative(yVect.b - 0.001).b) * 2000;
            //    double yDerivNorm2 = yVectDeriv.a * yVectDeriv.a + yVectDeriv.b * yVectDeriv.b;

            //    a = -(yVect.a / rZero2)
            //        + ((Math.Pow(p.R / rZero, 2)) * (x.a - (Math.Pow(p.R / rZero, 2)) * yVect.a)) / rAStarP2
            //        - (0.5 * yDeriv2A) / yDerivNorm2;
            //    b = -(yVect.b / rZero2)
            //        + ((Math.Pow(p.R / rZero, 2)) * (x.b - (Math.Pow(p.R / rZero, 2)) * yVect.b)) / rAStarP2
            //        - (0.5 * yDeriv2B) / yDerivNorm2;
            //}

            //Count Mju function
            Vector<double> mju = p.NormalDerivative(yVectDeriv);

            //Count Green function
            GreenFunctionDer = (1 / (2 * Math.PI)) * (a * mju.a + b * mju.b);

            return GreenFunctionDer;
        }
Example #3
0
        public static double ND_X_Y_Part2(Problem p, Vector<double> x, double t)
        {
            Vector<double> y = p.Gamma0(t);
            //yVect.a = (double)p.Gamma2.a.DynamicInvoke(t);
            //yVect.b = (double)p.Gamma2.b.DynamicInvoke(t);
            double rZero = Math.Sqrt((Math.Pow(y.a, 2) + Math.Pow(y.b, 2)));
            double rAStarP = Math.Sqrt(Math.Pow(x.a - (Math.Pow(p.R / rZero, 2)) * y.a, 2)
                             + Math.Pow(x.b - (Math.Pow(p.R / rZero, 2)) * y.b, 2));
            Vector<double> mjux = p.NormalDerivative(x);
            Vector<double> mjuy = p.NormalDerivative(y);
            double rZero2 = rZero * rZero;
            double rAStarP2 = rAStarP * rAStarP;

            Vector<double> a = new Vector<double>(p.R * p.R / rAStarP2 * mjuy.a, p.R * p.R / rAStarP2 * mjuy.b);
            double b = 2 * (p.R * p.R / rZero2 * ((x.a - y.a * (p.R * p.R / rZero2)) * mjuy.a + (x.b - y.b * (p.R * p.R / rZero2)) * mjuy.b)) / (rAStarP2 * rAStarP2);

            return 1 / (2 * Math.PI) * (((a.a - b) * mjux.a) + ((a.b - b) * mjux.b));
        }
Example #4
0
        public static double ND_X_Y_Part1(Problem p, Vector<double> x, double t)
        {
            Vector<double> y = p.Gamma0(t);
            //yVect.a = (double)p.Gamma2.a.DynamicInvoke(t);
            //yVect.b = (double)p.Gamma2.b.DynamicInvoke(t);
            double rZero = Math.Sqrt((Math.Pow(y.a, 2) + Math.Pow(y.b, 2)));
            double rAP = Math.Sqrt(Math.Pow(x.a - y.a, 2) + Math.Pow(x.b - y.b, 2));
            Vector<double> mjux = p.NormalDerivative(x);
            Vector<double> mjuy = p.NormalDerivative(y);

            double rZero2 = rZero * rZero;
            double rAP2 = rAP * rAP;

            double a = (mjux.a * mjuy.a + mjux.b * mjuy.b) / rAP2;
            double b = 2 * (((x.a - y.a) * mjuy.a + (x.b - y.b) * mjuy.b) / rAP2) * (((x.a - y.a) * mjux.a + (x.b - y.b) * mjux.b) / rAP2);
            return 1 / (2 * Math.PI) * (a - b);
        }
Example #5
0
        public static double Green(Problem p, Vector<double> x , double t)
        {
            Vector<double> yVect = p.Gamma0(t);
            //yVect.a = (double)p.Gamma2.a.DynamicInvoke(t);
            //yVect.b = (double)p.Gamma2.b.DynamicInvoke(t);
            double rZero = Math.Sqrt((Math.Pow(yVect.a, 2) + Math.Pow(yVect.b, 2)));
            double rAP = Math.Sqrt(Math.Pow(x.a - yVect.a, 2) + Math.Pow(x.b - yVect.b, 2));
            double rAStarP = Math.Sqrt(Math.Pow(x.a - (Math.Pow(p.R / rZero, 2)) * yVect.a, 2)
                             + Math.Pow(x.b - (Math.Pow(p.R / rZero, 2)) * yVect.b, 2));

            return Math.Log(p.R / rZero, Math.Exp(1)) - Math.Log(rAStarP, Math.Exp(1)) - Math.Log(1 / rAP, Math.Exp(1));
        }