private void timer2_Tick(object sender, EventArgs e) { dif1.start(Convert.ToInt32(NUD_mem_step.Text)); dif2.start(Convert.ToInt32(NUD_mem_step.Text)); zedGraphControl1.GraphPane.CurveList.Clear(); PointPairList u1 = new PointPairList(); PointPairList v1 = new PointPairList(); PointPairList u2 = new PointPairList(); PointPairList v2 = new PointPairList(); PointPairList raznAct = new PointPairList(); PointPairList raznIng = new PointPairList(); double maxRaznAct = 0; double maxRaznIng = 0; for (int i = 0; i < dif1.get_n() + 1; i++) { u1.Add(dif1.Points[i], dif1.CurrentU1[i]); v1.Add(dif1.Points[i], dif1.CurrentU2[i]); u2.Add(dif2.Points[i], dif2.CurrentU1[i]); v2.Add(dif2.Points[i], dif2.CurrentU2[i]); double raznCurAct = Math.Abs(dif2.CurrentU1[i] - dif1.CurrentU1[i]); double raznCurIng = Math.Abs(dif2.CurrentU2[i] - dif1.CurrentU2[i]); maxRaznAct = Math.Max(maxRaznAct, raznCurAct); maxRaznIng = Math.Max(maxRaznIng, raznCurIng); raznAct.Add(dif1.Points[i], raznCurAct); raznIng.Add(dif1.Points[i], raznCurIng); } lbRaznNormAct.Text = "||u1-v1|| = " + maxRaznAct; lbRaznNormIng.Text = "||u2-v2|| = " + maxRaznIng; if (chbFirst.Checked) { zedGraphControl1.GraphPane.AddCurve("u1(x) - активатор, н.у. 1", u1, System.Drawing.Color.Green, SymbolType.None); zedGraphControl1.GraphPane.AddCurve("u2(x) - ингибитор, н.у. 1", v1, System.Drawing.Color.DarkRed, SymbolType.None); } if (chbSecond.Checked) { zedGraphControl1.GraphPane.AddCurve("u1(x) - активатор, н.у. 2", u2, System.Drawing.Color.LightGreen, SymbolType.None); zedGraphControl1.GraphPane.AddCurve("u2(x) - ингибитор, н.у. 2", v2, System.Drawing.Color.Red, SymbolType.None); } if (chbRazn.Checked) { zedGraphControl1.GraphPane.AddCurve("Модуль разности активаторов", raznAct, System.Drawing.Color.DarkBlue, SymbolType.None); zedGraphControl1.GraphPane.AddCurve("Модуль разности ингибиторов", raznIng, System.Drawing.Color.DarkGoldenrod, SymbolType.None); } zedGraphControl1.AxisChange(); zedGraphControl1.Invalidate(); time += t * Convert.ToDouble(NUD_mem_step.Text); LB_Time.Text = "Текущее время = " + Convert.ToString(time); LB_Step.Text = "Слой = " + dif1.get_layerNum(); }
private void timer1_Tick(object sender, EventArgs e) { dif.start(Convert.ToInt32(NUD_mem_step.Text)); dif.plot(zedGraphControl1, LB_norm_u1, LB_norm_u2, CB_STAT_SOL.Checked); if (is_visible_nu) { dif.plot_star(zedGraphControl1); } time += t * Convert.ToDouble(NUD_mem_step.Text); LB_Time.Text = "Текущее время = " + Convert.ToString(time); LB_Step.Text = "Слой = " + dif.get_layerNum(); }