Sunteți pe pagina 1din 9

REPUBLIC OF THE PHILIPPINES

BATANGAS STATE UNIVERSITY


COLLEGE OF ENGINEERING, ARCHITECTURE AND FINE ARTS
ELECTRICAL ENGINEERING DEPARTMENT

LABARATORY EXERCISE NO.2


SOLVING ROOTS OF EQUATION USING MICROSOFT EXCEL

PATRON, RYAN KIM S.


EE 4103

INSTRUCTOR
ENGR. JOYZEL GUTIEREZ

OCTOBER 03, 2017


INTRODUCTION
Excel is a spreadsheet produced and developed by Microsoft, Inc. for Windows, mac OS,
Android and iOS. It features calculation, graphing tools, pivot tables, and a macro programming
language called Visual Basic for Applications. Microsoft Excel has the basic features of all
spreadsheets, using a grid of cells arranged in numbered rows and letter-named columns to
organize data manipulations like arithmetic operations. It has a battery of supplied functions to
answer statistical, engineering and financial needs.
Numerical methods can be applied as we use Excel to solve the roots of an equation.
With the widespread functions it can be use in getting the roots of a given equation. The software
includes different formulas and functions that make it possible for us to calculate and do
operations involving such us addition, subtraction, multiplication, and division, and as we raise a
number into a given exponent Excel provides the function =EXP(x). With Excel it is easier for us
to solve the roots of an equation.
After this activity it is expected that the student can understand the importance of
numerical methods with the use of this software (Microsoft Excel) on solving the roots of
equation as we master and understand the basic functions of the Microsoft Excel.

A. NEWTON RAPHSON METHOD


Use NEWTON RAPHSON METHOD to find the root of [8sin(x) e-x] with Xo = 3.0.

f(x) = [8sin(X) e-X] 1 f(x0) = [8sin(0.3) e-0.3] 1


f(x) = -8 e-X [ sin(X) cos(X) ] 1 f(x0) = 0.751414029
f(x) = -8 e-0.3 [ sin(0.3) cos(0.3) ] 1
f(x) = 3.910431395

f(xi ) f(x0 )
X i+1 = Xi X0+1 = X0
f (xi ) f (x0 )

f(X0) = [8sin(X) e-(0.751414029)] 1


f(X0) = -0.226951595

f(X0) = -8 e-0.751414029 [ sin(0.751414029) cos(0.751414029) ]


f(X0) = 6.367370203

xi+1 xi 0.1078437 0.3


Ea = | 100%| Ea = | 100%| = 178.1803674
xi+1 0.1078437

FINAL Xi = 0.145014813 ANSWER:


DISCUSSION:
In Newton Raphson Method we need to get the first derivative of the given equation and
then, substitute the given initial guesses to get the value of f(Xi). While in getting the value of
f(Xi), we simply substitute the given initial guesses to the original equation. For the value of Xi,
we used the given formula for this equation and then substitute the value. Repeat the methods
until Ea (%) reaches zero percent.

B. SECANT METHOD
Solve f(X) = [8sin(X) e-X] using SECANT METHOD with X-1=0 & Xo=-0.1
SOLUTION:
f(x) = 8sin(X)e-X -1 f(x-1) = 8SIN(0)e-0 -1
f(x0) = 8sin(-0.1) e-(-0.1) -1 f(x-1) = -1
f(x0) = -1.88266391

f(xi )(xi1 xi ) f(x0 )(x01 x0 )


xi+1 = xi x0+1 = x0
f(xi1 ) f(xi ) f(x01 ) f(x0 )

f(1.88266391)(1(1.88266391))
x1 = (0.1) = 0.113293405
f(1)f(1.88266391)

f(x) = 8sin(X) e-X -1 f(x1-1) = 8sin(-0.1)e-(-0.1) -1


f(x1) = 8sin(0.113293405) e-(0.113293405) -1 f(x0) = -1.88266391
f(x1) = -0.192462941

xi+1 xi 0.113293405(0.1)
Ea = | 100%| Ea= | 100%| = 188.266391
xi+1 0.113293405
.

FINAL ANSWER: X1 =0.145014813


DISCUSSION:
In Secant Method, derivation is not necessary. We will only use the original equation. To
get the value of f(Xi), we substitute the value of Xi to the given equation. The current value of Xi
will become the latest value for the Xi-1. Then substitute the value of (Xi-1) to get the value of
f(Xi-1). And for the value of Xi, substitute the values in the current iteration. Repeat those steps
until Ea becomes zero percent.

C. MODIFIED SECANT METHOD


Determine the real roots of X(3.5)=80, with the MODIFIED SECANT METHOD using an initial
guess of Xo=0.5 & =0.01.

SOLUTION:

Xi = (0.01)(0.5) = 0.005
Xi+ Xi = (0.5)+(0.005) = 0.505
f(Xi) = (0.5)(3.5)80 = -79.91161165
f(Xi+Xi) = (0.505)(3.5)-80 = -79.9084792
(Xi)f(Xi)
Xi+1= Xi - (+Xi)()

(0.005)(79.91161165)
Xi+1 = 0.5 - ( 79.9084792)(79.91161165) = 128.0542582

currentold 128.05425820.5
Ea = | 100| Ea = | 100| = 99.60954051%
current 128.0542582

FINAL ANSWER: X0 = 3.497357243


DISCUSSION:
In Modified Secant Method, to get the value of X0, substitute the current values to the
equation given in this method. And for the X0 we multiplied the latest value of X0 to the value
of . In getting the value of f(X0), just simply substitute the value of X0 to the given equation.
For the values of (X0+X0) we just simply add the values of X0 and X0. And in the f(X0+X0),
substitute the value of (X0+X0) to the given equation in this problem. Repeat this method until
the Ea (%) reaches zero percent.
D. MODIFIED NEWTON RAPHSON METHOD
Using MODIFIED NEWTON RAPHSON solve for the root of F(X) = (X-3) (X-1)(X-1)(X-
1)(X-1) with Xo=5.

SOLUTION:
f(x) = x 5 7x 4 + 18x 3 22x 2 + 13x 3
f (x) = 5x 4 28x 3 + 54x 2 44x + 13
f (x) = 20x 3 84x 2 + 108x 44
f(X)f(X) (512)(768)
+1 = xi [f(X)]2 f(X)f(X) xi+1 = xi [768]2 [(512)(896)] =2

currentold 25
Ea = | 100| Ea = | 100| = 150%
current 2

FINAL ANSWER: Xi = 1.000170871


DISCUSSION:
In solving the root of an equation using Modified Newton Raphson Method we derived
the original equation twice. Thats why we have the f(Xi) and f(Xi). To get the value of f(Xi),
f(Xi), and f(Xi) substitute the value of Xi to the original equation, to the first derivative
equation, and to the second derivative equation. For the latest value of Xi, substitute the current
values to the formulas given in this method. Repeat this steps until Ea (%) reaches zero percent.
E. JACOBI METHOD
Solve for X1, X2, X3 & X4 using JACOBI ITERATION.

10X1-X2+2X3+X4=6
3X2-X3+10X4=15
-X1+10X2-X3+3X4=2
3X2-X3+10X4=15

SOLUTION:
X22X3X4+6 X1+X33X4+25 2X1+X2+X411 3X2+X3+15
X1= X2= X3= X4=
10 10 10 10
000+6 0+00+25
X1= = 0.6 X2= = 2.5
10 10

0+0+011 0+0+15
X3= = -1.1 X4= = 1.5
10 10

currentold
Ea = | 100|
current

0.60 2.50
Ea1 = | 100| = 100% Ea2 = | 100| = 100%
0.6 2.5

1.10 1.10
Ea1 = | 100| = 100% Ea2 = | 100| = 100%
1.1 1.1

FINAL ANSWER:

X1 = 0.954727659 X2 = 2.281419477 X3 = -0.991157746 X4 = 0.716458382


DISCUSSION:
In Jacobi Method we simply substitute the current value to the equation of X1, X2, X3,
and X4. We assumed that the first value of the four equations is to be zero. From that, we get the
latest value needed for the next iteration. Repeat the steps until the Ea (%) reaches zero percent.

F. GAUSS-SEIDEL METHOD
Solve for X1, X2, X3 & X4 using JACOBI ITERATION.
10X1-X2+2X3+X4=6
3X2-X3+10X4=15
-X1+10X2-X3+3X4=2
3X2-X3+10X4=15

SOLUTION:

X22X3X4+6 X1+X33X4+25 2X1+X2+X411 3X2+X3+15


X1= X2= X3= X4=
10 10 10 10

000+6 0.6+00+25
X1= 10
= 0.6 X2= 10
= 2.56

2(0.6)+2.56+011 3(2.56)+(0.964)+15
X3= = -0.964 X4= = 0.6356
10 10

currentold
Ea = | 100|
current

0.60 2.560
Ea1 = | 100| = 100% Ea2 = | 100| = 100%
0.6 2.56

0.9640 1.10
Ea3 =| 100| = 100% Ea4 = | 100| = 100%
0.964 1.1

FINAL ANSWER:

X1 = 0.954727659 X2 = 2.281419477 X3 = -0.991157746 X4 = 0.716458382


DISCUSSION:
Gauss-Seidel Method and Jacobi method is almost the same. The only difference is that
the latest value is to be substitute to get the other latest value of every equation in iteration. We
should remember that the four equations are needed to rearranged were the diagonal of a matrix
is the highest value of every equation. After that we will get the equation to solve for the X1, X2,
X3, and X4. Then make an initial approximation be zero. Substitute this value to obtain the first
approximation. The latest value should substitute to the equation of X1, X2, X3, and X4. Repeat
this method until Ea (%) reaches zero percent.
FORMULA USED
NEWTON RAPHSON METHOD

i Xi f(Xi) f'(Xi) Ea (%)


=(8*(SIN(B8)*EXP(- (-8*EXP(-B8))*(SIN(B8)-
0 0.3
B8)))-1 COS(B8))
(-8*EXP(-
(B13)- (8*(SIN(B14)*EXP(- ABS((((B14)-
6 B14))*(SIN(B14)-
(C13)/(D13) B14)))-1 (B13))/(B14))*100)
COS(B14))
SECANT METHOD
i X1 X2 f(X1) f(X2) Ea (%)
=(8*(SIN(B5)*EXP(- =(8*(SIN(C5)*EXP(-
0 0 -0.1
B5)))-1 C5)))-1
=(B12)-
((D12)*(C12 =B1 =(8*(SIN(B13)*EXP( =(8*(SIN(C13)*EXP( =ABS(((B13-
8
-B12))/(E12- 2 -B13)))-1 -C13)))-1 B12)/(B13))*100)
D12)
MODIFIED SECANT METHOD
i Xo Xo Xo+Xo f(Xo) f(Xo+Xo) Ea (%)
=(B4)*(B7 =(B7)^(3.5) =(D7)^(3.5)
0 0.5 =(B7+C7)
) -80 -80
=(B28)- =ABS(((B29-
=(B4)*(B2 =(B29+C2 =(B29)^(3. =(D29)^(3.
22 ((C28)*(E28))/((F B28)/B29)*1
9) 9) 5)-80 5)-80
28)-(E28)) 00)
MODIFIED NEWTON RAPHSON
i Xi f(x) f'(x) f''(x) Ea (%)
=B5^5-
7*B5^4+18*B5^ =5*B5^4- =20*B5^3-
0 5 3- 28*B5^3+54*B5 84*B5^2+108*B
22*B5^2+13*B ^2-44*B5+13 5+-44
5-3
=B11^5-
=B10- 7*B11^4+18*B =5*B11^4- =20*B11^3- =ABS((B11-
6 (C10*D10)/(D1 11^3- 28*B11^3+54*B 84*B11^2+108* B10)/(B11*0.
0^2-C10*E10) 22*B11^2+13* 11^2-44*B11+13 B11+-44 01))
B11-3
JACOBI ITERATION
Ea(X1) Ea(X2) Ea(X3) Ea(X4)
i X1 X2 X3 X4
(%) (%) (%) (%)
41 =(C5 =(B51+ =(- =(- =ABS((B =ABS((C =ABS((D =ABS((E
1- D51- 2*B51+C 3*C51+D5 52- 52- 52- 52-
2*D5 3*E51+ 51+E51- 1+15)/10 B51)/(B5 C51)/(C5 D51)/(D5 E51)/(E5
1- 25)/10 11)/10 2*0.01)) 2*0.01)) 2*0.01)) 2*0.01))
E51+
6)/10
GAUSS-SEIDEL METHOD
i X1 X2 X3 X4 Ea(X1) Ea(X2) Ea(X3) Ea(X4)
=(C2
8- =(B29+ =(- =ABS((B =ABS((C =ABS((D =ABS((E
=(-
2*D2 D28- 2*B29+C 29- 29- 29- 29-
17 3*C29+D2
8- 3*E28+ 29+E28- B28)/(B2 C28)/(C2 D28)/(D2 E28)/(E2
9+15)/10
E28+ 25)/10 11)/10 9*0.01)) 9*0.01)) 9*0.01)) 9*0.01))
6)/10

CONCLUSION
Using Excel has a wide variety of application including its ability to aid in solving
theoretical and real-life problems. However, it cannot directly solved any mathematical or
problem solving type of question. This is because its usual main job is to perform addition,
subtraction, multiplication and division in such a manner that the answer will automatically be
flashed on the screen without actually using any calculating device or calculator. Therefore, we
need to understand, think and elaborate critically on how to convert the given problem such that
it can be applied with the Excels function. For instance, with regards to the solving the roots of
an equation, Excel really contribute a lot and made the solution clearly and properly organize.
Therefore, through this activity we are able to use Excel as we apply numerical methods in
solving the roots of an equation.

S-ar putea să vă placă și