예제 #1
0
        private void definirVariables()
        {
            this.f0 = Muller.redondeo(evaluar(this.x0), 2);
            this.historial.Add($"define f({x0}) = {f0}");

            this.f1 = evaluar(this.x1);
            this.historial.Add($"define f({x1}) = {f1}");

            this.f2 = evaluar(this.x2);
            this.historial.Add($"define f({x2}) = {f2}");

            this.h0 = this.x1 - this.x0;
            this.historial.Add($"define h0 = {h0}");

            this.h1 = this.x2 - this.x1;
            this.historial.Add($"define h1 = {h1}");

            this.d0 = (this.f1 - this.f0) / this.h0;
            this.historial.Add($"define d0 = {d0}");

            this.d1 = (this.f2 - this.f1) / this.h1;
            this.historial.Add($"define d1 = {d1}");

            this.a = (this.d1 - this.d0) / (this.h1 + this.h0);
            this.historial.Add($"define a = {a}");

            this.b = (this.a * this.h1) + this.d1;
            this.historial.Add($"define b = {b}");

            this.c = this.f2;
            this.historial.Add($"define c = {c}");
        }
예제 #2
0
        public void ejecutar(String expression, int maxIteraciones, double maxError, double x0, double x1, double x2)
        {
            Muller m = new Muller(expression, maxIteraciones, maxError, x0, x1, x2);

            foreach (var item in m.historial)
            {
                Console.WriteLine(item);
            }

            limpiarGrafica();
            for (double i = -3; i < 3; i += 0.5)
            {
                grafica.Series[0].Points.AddXY(i, m.evaluar(i));
                //grafica.Series[1].Points.AddXY(i, m.evaluarParabola(i));
            }
        }