Home Login  |   Contact  |   About Us       Tuesday, May 17, 2022   

j0182018 - Back to Home
   Skip Navigation LinksHOME ›  AREAS OF EXPERTISE ›   Nonlinear Systems  ›  ~ Birge Method



Skip Navigation Links.





A new static method, BirgeVieta is added to the Nonlinear system class (class code not shown):

           public static double[] BirgeVieta(double[] a, double x0, int nOrder, int nRoots,
              int nIterations, double tolerance)r />
           {
              double x = x0;
              double[] roots = new double[nRoots];
              double[] a1 = new double[nOrder + 1];
              double[] a2 = new double[nOrder + 1];
              double[] a3 = new double[nOrder + 1];
              for (int j = 0; j <= nOrder; j++)
                  a1[j] = a[j];
              double delta = 10 * tolerance;
              int i = 1, n = nOrder + 1, nroot = 0;
              while (i++ < nIterations && n > 1)
              {
                  double x1 = x;
                  a2[n-1] = a1[n-1];
                  a3[n-1] = a1[n-1];
                  for (int j = n - 2; j > 0; j--)
                  {
                    a2[j] = a1[j] + x1 * a2[j + 1];
                    a3[j] = a2[j] + x1 * a3[j + 1];
                  }
                  a2[0] = a1[0] + x1 * a2[1];
                  delta = a2[0] / a3[1];
                  x -= delta;
                  if (Math.Abs(delta) < tolerance)
                  {
                    i = 1;
                    n--;
                    roots[nroot] = x;
                    nroot++;
                    for (int j = 0; j < n; j++)
                    {
                      a1[j] = a2[j + 1];
                      if (n == 2)
                      {
                        n--;
                        roots[nroot] = -a1[0];
                        nroot++;
                    }
                  }
              }
           }
           return roots;
        }

This method takes coefficients of the polynomial as input:

double [ ] a = double[n + 1] {a0, a1, a2, ... an}

To use this method, one can also specify an initial guess x0, order of the polynomial, number of roots, maximum number of iterations, and tolerance.


Testing the Birge Vieta Method

Now, one can examine the BirgeVieta method by using it to solve nonlinear equations. To solve the following nonlinear equation:

f(x) = x3 - 3x + 1

The initial values were set to x0 = 0.0, order of the polynomial = 3, number of roots = 3, tolerance = 0.0001, and the maximum number of iterations = 1000.

In order to test the nonlinear function defined above, a new method TestBirgeVieta() has been added and executed:

           static void TestBirgeVieta()
           {
              double[ ] x = NonlinearSystem.BirgeVieta(new double[4]
                            { 1, -3, 0, 1.0 }, 0.0, 3, 3, 1000, 0.0001);
              listBox1.Items.Add("root 1 = " +(x[0].ToString());
              listBox2.Items.Add("root 2 = " +(x[1].ToString());
              listBox3.Items.Add("root 3 = " +(x[2].ToString());
              this.Text = "Birge Vieta Method / KeystoneMiningPost";
           }

Results are shown in screen above.








Consulting Services - Back to Home
Home

Home Math, Analysis,
  expertise..."

EIGENVALUE
SOLUTIONS...


> Rayleigh-Quotient Method

> Cubic Spline Method

 

Applied Mathematical Algorithms

Home

ComplexFunctions

Home

NonLinear
Home

Differentiation
Home

Integration
About Us


KMP Software Engineering is an independent multidisciplinary engineering consulting company specializing in mathematical algorithms.
Areas of
Expertise


SpecialFunctions
VectorsMatrices
OptimizationMethods
ComplexNumbers
Interpolation
CurveFitting
NonLinearSystems
LinearEquations
DistributionFunctions
NumericalDifferentiation
NumericalIntegration
DifferentialEquations
Smalltalk
FiniteBoundary
Eigenvalue
Graphics
Understanding
Mining


MiningMastery
MineralNews
MineralCommodities
MineralForum
Crystallography
Services


NumericalModeling
WebServices
MainframeServices
OutsourceServices

LINKED IN
KMP ARTICLES
Brand





Home

Login

Contact
Since 2006 All Rights Reserved  © KMP Software Engineering LINKS | PRIVACY POLICY | LEGAL NOTICE