Ejemplo n.º 1
0
        private void Reload()
        {
            optm = new OptimalManaging(1d, 1d, a, 1d, TIME_SIZE, GRID_SIZE, 0.1, 0.1,
                                       TestFunction1.y, TestFunction1.p, TestFunction1.phi, TestFunction1.f, -100, 100, R);
            optm.pickAlpha = pick;
            DrawOM.SetNSeries(chart1, 2);
            DrawOM.SetHeatMap(chart2);
            y     = MyMath.GetVectorFunction(GRID_SIZE, 0, 1d, TestFunction1.y);
            u_old = new Vector(GRID_SIZE);
            x     = new Vector(MyMath.CreateUniformGrid(GRID_SIZE, 0, 1d));

            tau  = new Vector(MyMath.CreateUniformGrid(TIME_SIZE, 0, 1d));
            Iter = 0;
            DrawOM.Draw(chart1, x, y, 0);
        }
Ejemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            Vector calc_p = new Vector();

            for (int i = 0; i < 1; i++)
            {
                calc_p = optm.CalculateIteration();
            }

            DrawOM.Draw(chart1, x, optm.calc_u, 1);
            //DrawOM.Draw(chart2, tau, calc_p, 0);
            DrawOM.DrawHeatMap(chart2, optm.manage_f, 0);
            Iter++;
            double J = optm.Functional_J(optm.calc_u);

            label1.Text  = "Информация " + Environment.NewLine;
            label1.Text += "J(u_" + Iter + ") = " + J + Environment.NewLine;
            label1.Text += "||u - u_old|| = " + (u_old - optm.calc_u).Norm + Environment.NewLine;
            label1.Text += "Итерация: " + Iter + Environment.NewLine;
            label1.Text += "alpha = " + optm.alpha_old;
            u_old        = optm.calc_u;
        }
Ejemplo n.º 3
0
        private void button2_Click(object sender, EventArgs e)
        {
            Vector calc_p = optm.CalculateIteration();
            double J      = optm.Functional_J(optm.calc_u);

            int ITER = 0;

            while (J > 0.001d && (u_old - optm.calc_u).Norm > 0.001d)
            {
                u_old = optm.calc_u;
                optm.CalculateIteration();
                J = optm.Functional_J(optm.calc_u);
                ITER++;
            }
            calc_p       = optm.CalculateIteration();
            label1.Text  = "Информация " + Environment.NewLine;
            label1.Text += "J = " + J + Environment.NewLine;
            label1.Text += "||u - u_old|| = " + (u_old - optm.calc_u).Norm + Environment.NewLine;
            label1.Text += "Количество итераций: " + ITER;


            DrawOM.Draw(chart1, x, optm.calc_u, 1);
            DrawOM.DrawHeatMap(chart2, optm.manage_f, 0);
        }