Sunday, 26 June 2011

Numerical Methods using MATLAB - Bisection Method

Why do we need numerical methods?

          In Engineering, there are several different processes involved in a system under study. These processes are represented mathematically by their mathematical models. The models can be algebraic, trignometric, ordinary or partial differential equations. So, in order to study the static and dynamic behaviour of the system, we need to analyse the math models of the particular system. The analysis of these models is known as Numerical Analysis.

Basic Tools for Numerical Analysis:

1. System of Linear Algebraic Equations
2. Eigen value problems
3. Roots of Nonlinear Equations
4. Polynomial Approximation and Interpolation
5. Numerical differentiation and Interpolation

Above are few numerical techniques involved to solve several engineering problems. They are all based on certain assumptions and approximations.

Why do Engineers need to practise programming?

         Engineers are expected to solve problems in real time using the numerical techniques listed above. They just need to assemble existing pieces of code to form a solution to a practical problem. These existing pieces of code is usually a function that does a particular task.

What is MATLAB?

MATLAB  is a high-level language for scientific computing and data visualization built around an interactive programming environment. It is becoming the premiere platform for scientific computing at educational institutions and research establishments.

Why use MATLAB?

        MATLAB is an interactive system whereprograms can be tested and debugged quickly. There is no need for compiling, linking and execution each and every time of testing. Hence, programs can be developed in a shorter time in MATLAB. It contains a large number of basic functions and some numerical libraries like LINPACK etc,. There is no need of declaring variables as int or float since all the numerical entities are treated as arrays.

Where do we start?

        As Step1, we now learn to solve Algebraic Equations numerically. There are quite a few methods for solving them. Most are based on formula and approximation. We here use BISECTION Method to solve Algebraic Equations.


Let us consider a polynomial f(x) of degree 'n', then,
f(x)=0 is an algebraic equation, whose solution is assumed to lie between the range (a,b) and is continuous within that range.

 If f(a) and f(b) are of opposite signs, then a real root should exist between points a and b. Let f(a)>0 and f(b)<0.

As a first approximation, we assume the root of the equation to x0=(a+b)/2. If f(x0)<0, the root lies between a and x0 and so we consider new limits as a and x0 and the process goes on.

If f(x0)>0, the root lies between x0 and b and hence we consider limits as x0 and b and the process goes on.

This way, we form a sequence of approximate roots x0, x1,...

Depending of precision required, the number of iterations can be set.

How to write a program for it?

Simple Algorithm: (Solving Algebraic Equation BISECTION method)




WHILE actualAccuracy > precision
Var1  ->  mean(range)
Var2 = FUNCTION value(degree,coefficients,Var1)

IF Var2>0
Range(2) = Var1;

Range(1) = Var1;


Where do I find the source code?



Coming up next:

      Method of False Position


Matlab is a well known Engineering platform. There are some thing unknown like Mathematica from Wolfram Alpha and a open source Matlab clone GNU Octave. Octave handles m-files and execute them directly with no need of any modifications

Then, again, Mathematica is also a commercial product and Octave is windows incompatible. What's so special about them?

If Ocatve is windows incompatible , then switch to linux like Ubuntu distros. Why you stick to the Product of Microsoft.

Why won't you put the code here itself?

Post a Comment

தங்களது கருத்துக்களை இங்கே வெளியிடவும்...


Twitter Delicious Facebook Digg Stumbleupon Favorites More