Exemplo n.º 1
0
        public OptimalManaging(double LengthVal, double TimeVal,
                               double sq_a, double Nu, int TIME_M, int LEN_N,
                               double eps1, double eps2,
                               FunctionLib.Function distrib_y,
                               FunctionLib.Function env_temperature_p,
                               FunctionLib.Function temperature0,
                               FunctionLib.Function2d temperature_sourses,
                               double pmin, double pmax, double INT_R)
        {
            ITERATION = 0;
            L         = LengthVal;
            T         = TimeVal;
            aa        = sq_a;
            nu        = Nu;
            R         = INT_R;

            TIME_SIZE = TIME_M;
            GRID_SIZE = LEN_N;

            EPS1  = eps1;
            EPS2  = eps2;
            P_MAX = pmax;
            P_MIN = pmin;
            double C0 = Get_C0();
            double C1 = Get_C1();

            LIP = Math.Sqrt(2d * C0 * C1);

            manage_p = new Vector(TIME_SIZE);

            y   = distrib_y;
            p   = env_temperature_p;
            phi = temperature0;
            f   = temperature_sourses;

            alpha_old = 5d;

            double tau = MyMath.GetStep(TIME_SIZE, 0d, T);
            double h   = MyMath.GetStep(GRID_SIZE, 0d, L);

            for (int i = 0; i < TIME_SIZE; i++)
            {
                manage_p[i] = p(tau * i);
            }

            manage_f = new Matrix(TIME_SIZE, GRID_SIZE);
            for (int i = 0; i < TIME_SIZE; i++)
            {
                for (int j = 0; j < GRID_SIZE; j++)
                {
                    manage_f[i, j] = f(h * j, tau * i);
                }
            }

            //Vector temp = MyMath.GetVectorFunction(GRID_SIZE, 0d, LengthVal, y);
            //R = MyMath.TrapezoidMethod(temp, h);
        }
Exemplo n.º 2
0
        public OptimalManaging(double LengthVal, double TimeVal,
                               double sq_a, double Nu, int TIME_M, int LEN_N,
                               double eps1, double eps2,
                               FunctionLib.Function distrib_y,
                               FunctionLib.Function env_temperature_p,
                               FunctionLib.Function temperature0,
                               FunctionLib.Function2d temperature_sourses)
        {
            ITERATION = 0;
            L         = LengthVal;
            T         = TimeVal;
            aa        = sq_a;
            nu        = Nu;


            TIME_SIZE = TIME_M;
            GRID_SIZE = LEN_N;

            EPS1  = eps1;
            EPS2  = eps2;
            P_MAX = 1000;
            P_MIN = -1000;
            double C0 = Get_C0();
            double C1 = Get_C1();

            LIP      = Math.Sqrt(2d * C0 * C1);
            R        = 10;
            manage_p = new Vector(TIME_SIZE);

            y   = distrib_y;
            p   = env_temperature_p;
            phi = temperature0;
            f   = temperature_sourses;

            double tau = MyMath.Basic.GetStep(TIME_SIZE, 0d, T);
            double h   = MyMath.Basic.GetStep(GRID_SIZE, 0d, L);

            for (int i = 0; i < TIME_SIZE; i++)
            {
                manage_p[i] = p(tau * i);
            }
            manage_f = new Matrix(TIME_SIZE, GRID_SIZE);
            for (int i = 0; i < TIME_SIZE; i++)
            {
                for (int j = 0; j < GRID_SIZE; j++)
                {
                    manage_f[i, j] = f(h * j, tau * i);
                }
            }
        }