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; }
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); }