示例#1
0
        private void calculate(double lower, double upper)
        {
            if (rb_Math.Checked == true)
            {
                DrawCurve       math1 = new DrawCurve();
                MathematicaLink math2 = new MathematicaLink();
                this.Cursor = Cursors.WaitCursor;
                HookUp(math1);
                int choice = lb_curvature.SelectedIndex;
                rangeV         = range[choice];
                txt_range.Text = rangeV.ToString();
                math1.SolveAcurate(math2, kappa[choice], rangeV.ToString());

                this.Cursor = Cursors.Arrow;
            }
            else if (rb_Euler.Checked == true)
            {
                DrawCurve rk4 = new DrawCurve();
                this.Cursor = Cursors.WaitCursor;
                HookUp(rk4);
                int choice = lb_curvature.SelectedIndex + 1;
                rk4.SolveFast(rk4, choice, lower, upper);
                this.Cursor = Cursors.Arrow;
            }
        }
示例#2
0
        public void SolveAcurate(MathematicaLink instance, string kappa, string range)
        {
            solution.Clear();
            bsdata.DataSource = null;
            List <Vector> curve = new List <Vector>();

            curve = instance.MathDraw(kappa, range);
            for (int i = 0; i < curve.Count; i++)
            {
                solution.Add(curve[i]);
            }
            bsdata.DataSource = solution;
        }