Ejemplo n.º 1
0
        static void Main()
        {
            Console.WriteLine("Lab3: Zeidel method               \n-----------------------------------");
            try
            {
                var system = new LSystem(STUDENT_NUMBER, GROUP_NUMBER, MATRIX_SIZE);
                system.GenerateRegularSystem();

                Console.WriteLine("Our system:");
                system.Print();

                var solution = SimpleIteration.CalculateZeidel(system, PRECISION);
                Console.WriteLine("Solutions via Zeidel method:");
                solution.Print();

                Console.WriteLine("Residuals: ");
                system.CalcResiduals(solution)
                    .Print(15);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                Console.Read();
            }

            Console.Read();
        }
Ejemplo n.º 2
0
        private static void Main(string[] args)
        {
            double[][] data =
            {
                new double[] { 4, 7, 4, 17 },
                new double[] { 1, 2, 6, 12 },
                new double[] { 9, 5, 3, 14 },
            };

            var simpleIteration = new SimpleIteration(data);

            simpleIteration.Process();
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            Func <double, double> f  = (x) => { return(x * x * x - 1.3 * x * x + x - 1); };
            Func <double, double> f1 = (x) => { return(3 * x * x - 2.6 * x + 1); };
            Func <double, double> f2 = (x) => { return(6 * x - 2.6); };

            //Func<double, double> f = (x) => { return x * x * x - 3 * x * x + 4 * x - 5; };
            //Func<double, double> f1 = (x) => { return 3 * x * x - 6 * x + 4; };
            //Func<double, double> f2 = (x) => { return 6 * x - 6; };

            HalfDeviation   method  = new HalfDeviation(2, 3, f);
            SimpleIteration method1 = new SimpleIteration(2, 3, 0.00001, f, f1);
            Chords          method2 = new Chords(2, 3, 0.00001, f, f1, f2);
            Newton          method3 = new Newton(2, 3, 0.00001, f, f1, f2);

            Console.ReadLine();
        }