## Iterative methods for solving linear equations:

The preceding methods of solving simultaneous linear equations are known as direct methods as they yield an exact solution. On the other hand, an iterative method is that in which we start from an approximation to the true solution and obtain better and better approximation from a computation cycle repeated as often as may be necessary for achieving the desired accuracy. Simple iteration methods can be devised for systems in which the coefficient of leading diagonal is large compared to others.

There are two iterative methods as follows:

1)Â Â Â Â Â Jacobiâ€™s iteration method.

2)Â Â Â Â Gauss-Seidel iteration method.

Today we are just concentrating on the first method that is Jacobiâ€™s iteration method. We will see second method (Gauss-Seidel iteration method) for solving simultaneous equations in next post. After that, I will show you how to write a MATLAB program for solving roots of simultaneous equations using Jacobi’s Iterative method.

## Jacobiâ€™s Iteration Method:

Let us consider set of simultaneous equations as follows:

a1x+b1y+c1z=d1â€¦â€¦â€¦â€¦â€¦â€¦â€¦1)

a2x+b2y+c2z=d2â€¦â€¦â€¦â€¦â€¦â€¦â€¦1)

a3x+b3y+c3z=d3â€¦â€¦â€¦â€¦â€¦â€¦â€¦1)

If a1, b2, c3 are large as compare to other coefficient then solving these for x,y, and z respectively. Then the system can be written in the form:

x = (k1) â€“ (l1)y â€“ (m1)zâ€¦â€¦â€¦â€¦..2)

y = (k2) â€“ (l2)x â€“ (m2)zâ€¦â€¦â€¦â€¦â€¦.2)

z = (k3) â€“ (l3)x â€“ (m3)yâ€¦â€¦â€¦â€¦â€¦.2)

Let us starts with the initial approximations x0=k1, y0=k2 and z0=k3.(by putting x=y=z=0 in right hand side above equation)

Then the second approximation is given by,

x1 = (k1) â€“ (l1)y0 â€“ (m1)z0â€¦â€¦â€¦â€¦..3)

y1= (k2) â€“ (l2)x0 â€“ (m2)z0â€¦â€¦â€¦â€¦â€¦.3)

z1 = (k3) â€“ (l3)x0 â€“ (m3)y0â€¦â€¦â€¦â€¦â€¦.3)

Third approximation is given by,

x2 = (k1) â€“ (l1)y1 â€“ (m1)z1â€¦â€¦â€¦â€¦..4)

y2= (k2) â€“ (l2)x1 â€“ (m2)z1â€¦â€¦â€¦â€¦â€¦.4)

z2 = (k3) â€“ (l3)x1 â€“ (m3)y1â€¦â€¦â€¦â€¦â€¦.4)

This process is repeated till difference between two consecutive approximations is negligible.

Let us understand this method in detail by solving one simple example.

## Example

Solve following set of simultaneous equations using Jacobiâ€™s iterative method.

20x+y-2z=17

3x+20y-z=-18

2x-3y+20z=25

## Solution

We write the given equations in the following form:

x = (1/20)(17-y+2z)â€¦â€¦â€¦â€¦â€¦..1)

y = (1/20)(-18-3x+z)â€¦â€¦â€¦â€¦â€¦.1)

z = (1/20)(25-2x+3y)â€¦â€¦â€¦â€¦â€¦1)

Substitute x0=y0=z0=0 in above equation we get,

x1 = (1/20)(17);Â y1 = (1/20)(-18);Â z1=(1/20)(25).

Or x1=0.85;Â y1=-0.90;Â z1=1.25

Put x1, y1 and z1 in equation (1)

x2 = 1.02;Â y2 = -0.965;Â z2 = 1.03.

Put x2, y2 and z2 in equation (1)

x3 = 1.001;Â y3 = -1.001;Â z3 = 1.003.

Put x3, y3 and z3 in equation (1)

x4 = 1.0004;Â y4 = -1;Â z4=0.99975

Put x4, y4 and z4 in equation (1)

x5 = 1;Â y5 = -1;Â z5=1

Now it is sufficient. If you observe above two sets of roots, they are almost same.

Hence the roots of given simultaneous equations using Jacobiâ€™s iterative method are:

x=1;Â y = -1;Â z=1

### MATLAB program for Jacobi’s iterative method:

### You may also like

- Jacobiâ€™s iteration method
- Gauss elimination method
- lagrange interpolation with MATLAB Program
- Simpsonâ€™s 3/8th Rule MATLAB Program example
- Simpsonâ€™s 1/3rd rule MATLAB Program examples
- MATLAB Programming for Trapezoidal rule with example

If you like this article, please share it with your friends and like or facebook page for future updates. Subscribe to our newsletter to get notifications about our updates via email. If you have any queries, feel free to ask in the comments section below. Have a nice day!