Skip to the content.

Numerical Analysis

Back

Introduction to Solution of Algebraic and Transcedental Equations

During the computation of Scientific and Engineering Problems, a recursive problem is to find the zero’s of equations of the form

equation1

If the equation is of lower order then algebraic formulae are available to determine zeros.

Example:

Equation:

equation2

Solution:

From Formula:

equation3

equation4

Now, let’s imagine to solve the following equations:

equation5

equation6

equation7

So, as of now there is no definite approach to solve these kind of equations through formulae. And in most of the times we are required to solve these kind of equations in the streams of science and engineering.

Here comes the approximate approach called Numerical Methods to solve any kind of equations.

The Numerical Analysis is a wide concept dealing with basic equation’s solution to integral solution.

Starting with root finding algorithms, It is divided into two categories:

  1. Bracketing Method
  2. Open Method

Bracketing Method requires range of equation, range here refers to lower and upper limit of equation.

Say a is the lower limit and b is the upper limit of the equation then it must satisfy the following equation.

equation8

Let’s Begin with the problem solving

Initially the Bracketing Methods problem solving requires the range of equation let’s say the range as (a,b)

To satisfy the condition:

equation8

There are two approaches:

equation9

equation10

range

Mathematically one can start taking values and find the range,

Example:

For the equation:

equation2

image image
image equation11
image equation12
image equation13
image equation14
image equation15
image equation14

Therefore (a,b) = (3,5) and root lies between this range. One can note that at x = 4 there is one zero of equation. In this example the root is real integer and hence f(x) = 0 at x = 4. But it varies with different equations, Let’s infer with the programming.

The programming snippets are provided which support MATLAB/ OCTAVE and Python3

MATLAB SCRIPT

% MATLAB/ OCTAVE snippet to determine range of equation

function[min_range,max_range] = range_of_equation(eqn)
f = eqn;
k = 0;
min_range = 0;
max_range = 0;
if(f(k)~=0)
if(f(k)<0)
    while(f(k)<0)
        min_range = k;
        k = k+1;
    end
    end
    while(1)
        if(f(k)>0)
        max_range = k;
        k = k+1;
        break;
        end
    end
k = 0;
if(f(k)>0)
    while(f(k)>0)
        min_range = k;
        k = k+1;
    end
    while(1)
        if(f(k)<0)
        max_range = k;
        k = k+1;
        break;
        end
    end
end
end
end

MATLAB DEMO

image

PYTHON3 SCRIPT

# Python3 Snippet to determine range of equation

def f(x):
    
    return 11*x**11 - 1 #update corresponding equation here

def range_of_equation():
    
    min_range = 0
    max_range = 0
    k = 0
    if(f(k)!=0):
        if(f(k)<0):
            while(f(k)<0):
                min_range = k
                k = k+1
        while(1):
            if(f(k)>0):
                max_range = k
                k = k+1
                break
        k = 0
        if(f(k)>0):
            while(f(k)>0):
                min_range = k
                k = k+1
            while(1):
                if(f(k)<0):
                    max_range = k
                    k = k+1
                    break
    return min_range,max_range

print(range_of_equation())

Python Demo

image