Problem:
A mining company extracts mineral from two mines, which contains for the mine I 1% nickel and 2% copper, for the mine II nickel 2% and 5% copper. How much mineral must be extracted from each mine to get 4 tons of nickel and nine tons of copper?
Solution:
We want to know the number of tons of mineral must be extracted from each mine, assign literals to those numbers.
Where x are the tons extracted of mine I.And y are the tons extracted of mine II.
Now we establish algebraic relationships between the literal.
How much nickel is obtained from the mine I?
0.01x
And mine II?0.02y
To know how many tons must be extracted from each mine must solve the system of two linear equations with two unknowns:
0.01x+0.02y=4
0.02x+0.05y=9
0.02x+0.05y=9
The Matrix
x= (4-0.02y)/0.01
y=(9-0.02x)/0.05
y=(9-0.02x)/0.05
On the first initial value is Y1= 75.
x= (4-0.02(75))/0.01=250
y= (9-0.02(250))/0.05=80
Error:
(80-75)/80*100=6.25%
Iterations are continued as you can see in the diagram and are interpreted as x approaches 200, while the variable y is close to 100 where these results.
the same problem but using gauss seidel relaxation's method.
m = 1.25
x=((4-0.02(75))/0.01)*1.25+(1-1.25)*0=312.5
y= ((9-0.02(312.5))/0.05)*1.25+(1-1.25)*75=50
y= ((9-0.02(312.5))/0.05)*1.25+(1-1.25)*75=50
Error:
for x:
error%= |(312.5-0)/312.5|*100=100%
for y:
error%= |(50-75)/50|*100=50%
The diagram compares the methods.
Excel
gauss-seidel