Ejemplo n.º 1
0
        private void DrawFunctionResultGraph(IterationResult iteration)
        {
            FunctionResultGraph.GraphPane.CurveList.Clear();
            PointPairList numList = new PointPairList();

            FunctionResultGraph.GraphPane.XAxis.Scale.Min = 0;
            FunctionResultGraph.GraphPane.XAxis.Scale.Max = 1;
            double min = iteration.Results.Min();
            double max = iteration.Results.Max();

            FunctionResultGraph.GraphPane.YAxis.Scale.Min = min - 0.25 * Math.Abs(min);
            FunctionResultGraph.GraphPane.YAxis.Scale.Max = max + 0.25 * Math.Abs(max);
            FunctionResultGraph.GraphPane.Title.Text      = iteration.Points.Count + " Finite Elements";
            FunctionResultGraph.AxisChange();
            FunctionResultGraph.Invalidate();
            for (int i = 0; i < iteration.Points.Count; ++i)
            {
                numList.Add(iteration.Points[i].Left, iteration.Results[i]);
            }
            numList.Add(iteration.Points[iteration.Points.Count - 1].Right, iteration.Results[iteration.Points.Count]);
            FunctionResultGraph.GraphPane.AddCurve("", numList, System.Drawing.Color.Blue, SymbolType.Star);
            FunctionResultGraph.AxisChange();
            FunctionResultGraph.Invalidate();
        }
Ejemplo n.º 2
0
        public void InitializeGraphPane()
        {
            FunctionResultGraph.GraphPane.XAxis.Scale.Min  = 0;
            FunctionResultGraph.GraphPane.XAxis.Scale.Max  = 1;
            FunctionResultGraph.GraphPane.YAxis.Scale.Min  = 0;
            FunctionResultGraph.GraphPane.YAxis.Scale.Max  = 10;
            FunctionResultGraph.GraphPane.Title.Text       = "";
            FunctionResultGraph.GraphPane.XAxis.Title.Text = "x";
            FunctionResultGraph.GraphPane.YAxis.Title.Text = "u(x)";
            FunctionResultGraph.IsShowPointValues          = true;
            FunctionResultGraph.AxisChange();
            FunctionResultGraph.Invalidate();

            ErrorResultGraph.GraphPane.XAxis.Scale.Min  = 0;
            ErrorResultGraph.GraphPane.XAxis.Scale.Max  = 1;
            ErrorResultGraph.GraphPane.YAxis.Scale.Min  = 0;
            ErrorResultGraph.GraphPane.YAxis.Scale.Max  = 10;
            ErrorResultGraph.GraphPane.Title.Text       = "";
            ErrorResultGraph.GraphPane.XAxis.Title.Text = "x";
            ErrorResultGraph.GraphPane.YAxis.Title.Text = "η, in %";
            ErrorResultGraph.IsShowPointValues          = true;
            ErrorResultGraph.AxisChange();
            ErrorResultGraph.Invalidate();
        }