コード例 #1
0
        public ActionResult Muller()
        {
            Muller_model model = new Muller_model();

            model.function    = "16x^4-40x^3+5x^2+20x+6";
            model.X0          = 0.5m;
            model.X1          = 1;
            model.X2          = 1.5m;
            model.tolerancia  = "0.001";
            model.iteraciones = 25;
            Muller mullerMet = new Muller();

            model.ans          = new Answer_Model();
            mullerMet.Function = "x^3 + 2x^2 + 10x - 20";
            mullerMet.X0       = 0.5m;
            mullerMet.X1       = 1;
            mullerMet.X2       = 1.5m;
            mullerMet.Tol      = 0.001m;
            mullerMet.N        = (decimal)25;
            model.ans.Res      = mullerMet.Solve();
            model.ans.status   = 0;
            return(View(model));
        }
コード例 #2
0
        public ActionResult Muller(Muller_model model, string submitbutton)
        {
            Muller mullerMet = new Muller();

            model.ans          = new Answer_Model();
            mullerMet.Function = model.function;
            mullerMet.X0       = model.X0;
            mullerMet.X1       = model.X1;
            mullerMet.X2       = model.X2;
            mullerMet.Tol      = Convert.ToDecimal(model.tolerancia);
            mullerMet.N        = (decimal)model.iteraciones;
            model.ans.Res      = mullerMet.Solve();
            model.ans.status   = 0;

            if (model.ans.Res[0] == 'S')
            {
                model.ans.status = 1;
            }
            else
            {
                model.ans.status = 2;
            }
            return(View(model));
        }