You are on page 1of 15

Republic of the Philippines

EASTERN VISAYAS STATE UNIVERSITY


Tacloban City
COLLEGE OF ENGINEERING
Electrical Engineering Department

FINAL OUTPUT
In
EE-313
(Numerical Methods and Analysis)

Submitted by:

Attach your
picture here

. GREZEL M. MALASAGA .
BSEE – 3B

Submitted to:

JAY GABRIEL F. JIMENEZ, REE, RME, M.Eng.


Instructor

December 21, 2022


Compilations of Activities in
EE-313
and
Modified Problem Sets
with Solutions per topic discussed
Table of contents

Topics Page

TEST I – Iterative Bracketing Method ………………………………………………………….. 1

1. Bisection Method …………………………………………………………………...……………… 1


2. False – Position Method ………………………………………………………………….……… 1

TEST III- Iterative Non – Bracketing Method……………………………………………….. 1

3. Newton Raphson Method………………………………………………………………………. 1


4. Secant Method ……………………………………………………………………………………… 2
5. Fixed Point Iteration ……………………………………………………………………………… 2

TEST III- Iterative Polynomial Function Techniques …………………………………… 2

6. Muller’s Method ……………………………………………………………………………………. 2


7. Bairstow’s Method…………………………………………………………………………………. 3

TEST IV- System of Linear Equation ……………………………………………………………. 4

8. Gauss Elimination Back Substitution Method ………………………………………… 4


9. Gauss – Jordan Elimination Method ……………………………………………………… 4
10. Cramer’s Rule Method ………………………………………………………………………….. 4

TEST V- Least Square Regression ………………………………………………………………… 5

11. Least Square Regression (LSR) ………………………………………………………………. 5

TEST VI- Numerical Interpolation Technique …………………………………………….. 5

12. Newton’s Forward Interpolation ………………………………………………………….. 5


13. Newton’s Backward Interpolation ………………………………………………………... 6
14. Newton’s Divided Interpolation ……………………………………………………………. 6
15. Missing Terms in Table Interpolation……………………………………………………… 7

TEST VII- Numerical Differentiation Technique …………………………………………. 7

16. Newton’s Forward Difference ……………………………………………………………….. 7


17. Newton’s Backward Difference …………………………………………………………….. 8
18. Newton’s Divided Difference ………………………………………………………………… 9

TEST VIII- Numerical Integration Technique ………………………………………………. 9

19. Trapezoidal Rule …………………………………………………………………………………… 9


20. Simpson’s 1/3 Rule ………………………………………………………………………………. 10
21. Simpson’s 3/8 Rule ………………………………………………………………………………. 10

Reflection …………………………………………………………………………………………………….. 10

i
Note:

1. No students shall have the same problem and solution sets, each student should modify
its own and different type or form of paragraph or sentences.
2. All submission with identical entries will obtain an average score.
3. Please refer to the given rubrics on the messenger group chat to serve you as a guide in
formulating your modified problems and solution sets in ME312.
4. Grades will be derived from total points based on given rubrics

Goodluck and God bless!!!

Engr. JGF JIMENEZ

ii
TEST I

Iterative Bracketing Method

1. Bisection Method
- Find a root of an equation f(x)=(x2+2x+1) using Bisection method.
Solution:

Here x2+2x+1=0
Let f(x)=x2+2x+1

Here x 0 -1 -2
f(x) 1 0 1

Here f(-1)=0
∴Root of the equation x2+2x+1 is -1

2. False – Position Method


- Find a root of an equation f(x)=(x2+2x+1) using False Position method.
Solution:

Here x2+2x+1=0
Let f(x)=x2+2x+1

Here x 0 -1 -2
f(x) 1 0 1

Here f(-1)=0
∴Root of the equation x2+2x+1 is -1

TEST II
Iterative Non – Bracketing Method

3. Newton Raphson Method


- Find a root of an equation f(x)=(x2+2x+1) initial solution x0=2, using Newton Raphson
method. (until two iterations)
Solution:

Here x2+2x+1=0
Let f(x)=x2+2x+1 2nd iteration :

∴f′(x)=2x+2 f(x1)=f(0.5)=0.52+2⋅0.5+1=2.25
x0=2 f′(x1)=f′(0.5)=2⋅0.5+2=3
x2=x1-f(x1)f′(x1)
1st iteration : x2=0.5-2.253
x2=-0.25
f(x0)=f(2)=22+2⋅2+1=9
f′(x0)=f′(2)=2⋅2+2=6 Relative percent error
x1=x0-f(x0)f′(x0) 𝑋2 −𝑋1 −0.25−0.5
e=| |×100%=| |×100%=300%
𝑋2 −0.25
x1=2-96
x1=0.5

1
4. Secant Method
- Find a root of an equation f(x)=ln(x+2) using Secant method.
Solution:

Here ln(x+2)=0
Let f(x)=ln(x+2) Here f(-1)=0
∴Root of the equation ln(x+2) is -1
Here
x 0 -1 -2
f(x) 0.6931 0 "Undefined"

5. Fixed Point Iteration


- Find a root of an equation f(x)=(x2+2x+1) using Fixed Point Iteration method

Solution: Here
Let f(x)=x2+2x+1
x 0 -1 -2
Here x2+2x+1=0
f(x) 1 0 1
∴2x=-x2-1
Here f(-1)=0
∴x=-x2-12
Root of the equation x2+2x+1 is -1
∴ϕ(x)=-x2-12

TEST III

Iterative Polynomial Function Techniques

6. Muller’s Method
- Find a root of an equation f(x)=2x+1 using Muller method. (must reach 0%)
Solution: h1=x1-x0=0-(-1)=1
h2=x2-x1=-0.5-0=-0.5
Here 2x+1=0
Let f(x)=2x+1 δ1=f(x1)-f(x0)h1=1-(-11)=2
δ2=f(x2)-f(x1)h2=0-1-0.5=2
Here a=δ2-δ1h2+h1=2-2-0.5+1=0
x 0 -1 -2
b=a×h2+d2=0×-0.5+2=2
f(x) 1 -1 -3 c=f(x2)=0

x0=-1 x3=x2+-2cb±√b2-4ac
x1=0 x3=x2+-2cb+sign(b)√b2-4ac
x2=-0.5 =-0.5+-2×02+√22-4×0×0
=-0.5+02+√4
1st iteration : =-0.5+02+2
f(x0)=f(-1)=2⋅(-1)+1=-1 =-0.5
f(x1)=f(0)=2⋅0+1=1
f(x2)=f(-0.5)=2⋅(-0.5)+1=0 Relative percent error
𝑋 −𝑋 −0.5−0.5
ɛa1=| 3𝑋 2|×100%=| 0.5 |×100%=0%
3

Approximate root of the equation 2x+1=0 using Muller method is -0.5 (After 1 iterations)

n x0 x1 x2 f(x0) f(x1) f(x2) a b c x3 ɛan


1 -1 0 -0.5 -1 1 0 0 2 0 -0.5 0

2
7. Bairstow’s Method
- Find all roots of polynomial using Bairstow method
f(x)=x3-x2-x+1 and r=-1,s=-1

Solution: 2nd iteration :


x3-x2-x+1=0
-p1 a0 a1 a2 a3
In this problem the coefficients 0 1 -1 -1 1
are a0=1,a1=-1,a2=-1,a3=1
-q1 -p1⋅b0 -p1⋅b1 -p1⋅b2
Let the initial approximation p0=- 2 0 0 0
1 and q0=-1 -q1⋅b0 -q1⋅b1
2 -2
1st iteration : b3=a3-
b1=a1- b2=a2-
b0 p1⋅b2-
p1⋅b0 p1⋅b1-q1⋅b0
1 q1⋅b1
-p0 a0 a1 a2 a3 -1 1
-1
1 1 -1 -1 1
-p1⋅c0 -p1⋅c1
-q0 -p0⋅b0 -p0⋅b1 -p0⋅b2
0 0
1 1 0 0
-q1⋅c0
-q0⋅b0 -q0⋅b1
2
1 0
c1=b1- c2=b2-
b2=a2- b3=a3- c0
b1=a1- p1⋅c0 p1⋅c1-q1⋅c0
b0 p0⋅b1- p0⋅b2- 1
p0⋅b0 -1 3
1 q0⋅b0 q0⋅b1
0
0 1
-p0⋅c0 -p0⋅c1
1 1
-q0⋅c0
1
Δp=-b3⋅c0-b2⋅c1c21-c0⋅(c2-b2)=-0-1=0
c2=b2-
c1=b1- Δq=-b2⋅(c2-b2)-b3⋅c1c21-c0⋅(c2-b2)=-1-1=1
c0 p0⋅c1-
p0⋅c0
1 q0⋅c0
1 p2=p1+Δp=0=0
2

q2=q1+Δq=-2+1=-1
Δp=-b3⋅c0-b2⋅c1c21-c0⋅(c2-b2)=-1-1=1
Δq=-b2⋅(c2-b2)-b3⋅c1c21-c0⋅(c2-b2)=--1-1=-1 Approximate root p=0 and q=-1

p1=p0+Δp=-1+1=0 Hence extracted quadratic


q1=q0+Δq=-1-1=-2
factor =x2+px+q=x2-1

3
TEST IV

System of Linear Equation

8. Gauss Elimination Back Substitution Method


- Solve Equations 2x+y=8, x+2y=1 using Gauss Elimination Back Substitution
method
Solution: Now use back substitution method
Total Equations are 2
2x+y=8→(1) From (2)
1.5y=-3
x+2y=1→(2) ⇒y=-3×0.6667=-2

Converting given equations into From (1)


matrix form 2x+y=8
2 1 8 ⇒2x+(-2)=8
⇒2x-2=8
1 2 1 ⇒2x=8+2
R2←R2-0.5×R1 ⇒2x=10
2 1 8 ⇒x=102=5

0 1.5 -3 Solution using back substitution


2x+y=8→(1) method.
1.5y=-3→(2) x=5andy=-2

9. Gauss – Jordan Elimination Method


- Solve Equations 2x+5y=21,x+2y=8 using Gauss-Jordan Elimination method.
Solution:
Total Equations are 2
2x+5y=21→(1)

x+2y=8→(2) R2←R2×-2
1 2.5 10.5
Converting given equations into matrix
form 0 1 5
2 5 21 R1←R1-2.5×R2
1 2 8 1 0 -2
R1←R1÷2 0 1 5
1 2.5 10.5
x=-2
1 2 8 y=5
R2←R2-R1
1 2.5 10.5 Solution By Gauss Jordan elimination
method
0 -0.5 -2.5 x=-2andy=5
10. Cramer’s Rule Method
- Solve Equations 1 -11
2x+5y=16,3x+y=11 using
Cramer's Rule method =5×(-11)-(-16)×1
Solution: =-55+16
The equations can be expressed as =-39
2x+5y-16=0
3x+y-11=0 2 -16
Dy =
3 -11
=2×(-11)-(-16)×3
Use Cramer’s Rule to find the values of =-22+48
x, y, z. =26
xDx=-yDy=1D
2 5
Dx = 5 -16 D=
3 1
4
=2×1-5×3
=2-15 ∴x-39=1-13,-y26=1-13
=-13
∴x=-39-13,y=-26-13
xDx=-yDy=1D
∴x=3,y=2
∴x-39=-y26=1-13

TEST V
Least Square Regression
11. Least Square Regression (LSR)
- Solve for the m, y=mx+b and its errors using Least Square Regression.
x y x2 xy x y Y=mx+b errors

1 2 1 2 1 2 1.9067 -0.0933

4 5 16 20 4 5 5.3867 0.3867

6 7 36 42 6 7 7.7067 0.7067

11 15 53 64

N=3 𝑵∑(xy)−∑x∑y
m= 2 =1.16
𝑵∑(𝑥2 )−(∑𝑥)
Sum of X = 11
∑y−m∑x
Sum of Y = 15 b= 𝑵
=0.7467
Sum of x2= 53
Sum of xy= 64

TEST VI
Numerical Interpolation Technique

12. Newton’s Forward Interpolation


- Find the estimated number of population during 1900. Find Solution using
Newton's Forward Difference formula.

x f(x) Newton's forward difference table is


x y Δy Δ2y Δ3y Δ4y
1891 46
1891 46
1901 66
20
1911 81
1901 66 -5
1921 93
15 2
1931 101 1911 81 -3 -3
x = 1900
12 -1
Finding option 1. Value f(2)
1921 93 -4
Solution:
8
The value of table for x and y
1931 101
x 1891 1901 1911 1921 1931
The value of x at you want to find
y 46 66 81 93 101
the f(x):x=1900
Newton's forward difference
interpolation method to find solution

5
h=x1-x0=1901-1891=10
p=x-x0h=1900-189110=0.9 y(1900)=46+0.9×20+0.9(0.9-1)2×-
5+0.9(0.9-1)(0.9-2)6×2+0.9(0.9-1)(0.9-
Newton's forward difference 2)(0.9-3)24×-3
interpolation formula is y(1900)=46+18+0.225+0.033+0.026
y(x)=y0+pΔy0+p(p-1)2!⋅Δ2y0+p(p-1)(p- y(1900)=64.284
2)3!⋅Δ3y0+p(p-1)(p-2)(p-3)4!⋅Δ4y0

13. Newton’s Backward Interpolation


- Calculate the estimated population during the year 1920 in Texas. Find Solution
using Newton's Backward Difference formula
15 2
x f(x)
1911 81 -3 -3
1891 46 12 -1
1901 66 1921 93 -4
1911 81 8
1921 93 1931 101
1931 101

x = 1920 The value of x at you want to find


Finding option 1. Value f(2) the f(x):x=1920
h=x1-x0=1901-1891=10
Solution: p=x-xnh=1920-193110=-1.1
The value of table for x and y
Newton's backward difference
x 1891 1901 1911 1921 1931 interpolation formula is
y 46 66 81 93 101 y(x)=yn+p∇yn+p(p+1)2!⋅∇2yn+p(p+1)(p+2)3
!⋅∇3yn+p(p+1)(p+2)(p+3)4!⋅∇4yn
Newton's backward difference
interpolation method to find solution y(1920)=101+(-1.1)×8+-1.1(-1.1+1)2×-4+-
1.1(-1.1+1)(-1.1+2)6×-1+-1.1(-1.1+1)(-
Newton's backward difference table is 1.1+2)(-1.1+3)24×-3
x y ∇y ∇2y ∇3y ∇4y
y(1920)=101-8.8-0.22-0.0165-0.0235
1891 46
20 y(1920)=91.94
1901 66 -5

14. Newton’s Divided Interpolation


- Find Solution using Newton's Divided Difference Interpolation formula.
The value of table for x and y
x f(x)
x -1 0 3 6 7
-1 3
y 3 -6 39 822 1611
0 -6
3 39 Numerical divided differences method to
find solution
6 822
7 1611 Newton's divided difference table is
x y 1st order 2nd order 3rd order 4th order
x=1
Finding option 1. Value f(2) -1 3
-6-30--
Solution: 1=-9

6
15--93- 161
0 -6 7
-1=6 1
39-- The value of x at you want to find
41-66-- the f(x):x=1
63-
1=5
0=15
Newton's divided difference interpolation
261- formula is
13-57-
3 39 156- f(x)=y0+(x-x0)f[x0,x1]+(x-x0)(x-
-1=1
0=41 x1)f[x0,x1,x2]+(x-x0)(x-x1)(x-
822- 132- x2)f[x0,x1,x2,x3]+(x-x0)(x-x1)(x-x2)(x-
396- 417- x3)f[x0,x1,x2,x3,x4]
3=261 0=13
y(1)=3+(1+1)×-9+(1+1)(1)×6+(1+1)(1)(1-
789- 3)×5+(1+1)(1)(1-3)(1-6)×1
6 822 2617-
3=132 y(1)=3+(2)×-9+(2)(1)×6+(2)(1)(-
1611- 2)×5+(2)(1)(-2)(-5)×1
8227-
6=789 y(1)=3-18+12-20+20

y(1)=-3

15. Missing Terms in Table Interpolation


- Find Missing terms in interpolation table

x f(x)
2 45 Hence Δ4y0=0
Solution: (E-1)4y0=0
3 49.2 The value of table for x and y (E4-4E3+6E2-4E+1)y0=0
4 54.1 y4-4y3+6y2-4y1+y0=0
x 2 3 4 5 6 ∴67.4-4(a)+6(54.1)-4(49.2)+45=0
5 ?
y 45 49.2 54.1 ? 67.4 ∴-4a+240.2=0
6 67.4
∴-4a=-240.2
Here we are given 4 values of y. We ∴a=-240.2-4
assume that y is polynomial of ∴a=60.05
degree 3.

TEST VII

Numerical Differentiation Technique

16. Newton’s Forward Difference


- Using Newton's Forward Difference formula to find solution.
x f(x) Newton's forward differentiation table is
1.4 4.0552 x = 1.4 x y Δy Δ2y Δ3y Δ4y
1.6 4.9530 Solution: 1. 4.055
Numerical differentiation 4 2
1.8 6.0496
method to find solution. 0.897
2.0 7.3891 The value of table 8
for x and y
2.2 9.0250 1. 0.198
4.953
6 8
x 1.4 1.6 1.8 2 2.2 1.096 0.044
6 1
y 4.0552 4.953 6.0496 7.3891 9.025

7
1. 6.049 0.242 0.009
8 6 9 4 [dy/dx]x=x0=1h⋅(Δy0-
12⋅Δ2y0+13⋅Δ3y0-14⋅Δ4y0)
1.339 0.053
5 5 ∴[dy/dx]x=1.4=10.2⋅(0.8978-
7.389 0.296 12×0.1988+13×0.0441-14×0.0094)
2
1 4
∴[dy/dx]x=1.4=4.0538
1.635
9
2. [d2y/dx2]x=x0=1h2⋅(Δ2y0-
9.025 Δ3y0+1112⋅Δ4y0)
2

The value of x at you want to ∴[d2y/dx2]x=1.4=10.04⋅(0.1988-


find f(x):x0=1.4 0.0441+1112×0.0094)

h=x1-x0=1.6-1.4=0.2 ∴[d2y/dx2]x=1.4=4.0829

17. Newton’s Backward Difference


- Using Newton's Backward Difference formula to find solution.
2.
x f(x) 9.025
2
1.4 4.0552 x = 2.0
1.6 4.9530 Solution:
The value of x at you want to
Numerical differentiation
1.8 6.0496 find f(x):xn=2.0
method to find solution.
2.0 7.3891 The value of table
h=x1-x0=1.6-1.4=0.2
for x and y
2.2 9.0250

[dydx]x=xn=1h⋅(∇yn+12⋅∇2yn+13⋅∇3yn+14
x 1.4 1.6 1.8 2 2.2 ⋅∇4yn)
y 4.0552 4.953 6.0496 7.3891 9.025
∴[dydx]x=2.0=10.2×(1.3395+12×0.2429+13
×0.0441+14×0)
Newton's backward differentiation table
x y ∇y ∇2y ∇3y ∇4y ∴[dydx]x=2.0=7.3782
1. 4.055
4 2
[d2ydx2]x=xn=1h2⋅(∇2yn+∇3yn+1112⋅∇4yn
0.897 )
8
1. 0.198 ∴[d2ydx2]x=2.0=10.04⋅(0.2429+0.0441+111
4.953 2×0)
6 8
1.096 0.044 ∴[d2ydx2]x=2.0=7.175
6 1
1. 6.049 0.242 0.009
8 6 9 4
1.339 0.053
5 5
7.389 0.296
2
1 4
1.635
9

8
18. Newton’s Divided Difference
- Using Newton's Divided Difference formula to find solution.
1 98
x f(x) 0 0
2 4
4 56 Newton's divided difference interpolation
9 711 formula is
f(x)=y0+(x-x0)f[x0,x1]+(x-x0)(x-
10 980
x1)f[x0,x1,x2]+(x-x0)(x-x1)(x-
x2)f[x0,x1,x2,x3]
x=5

Solution: f(x)=4+(x-2)×26+(x-2)(x-4)×15+(x-2)(x-
The value of table for x and y 4)(x-9)×1

x 2 4 9 10 f(x)=4+(x-2)×26+(x2-6x+8)×15+(x3-
15x2+62x-72)×1
y 4 56 711 980

f(x)=4+(26x-52)+(15x2-90x+120)+(x3-
Numerical divided differences method to
find solution 15x2+62x-72)

Newton's divided difference table is f(x)=x3-2x


3rd orde
x y 1st order 2nd order
r Now, differentiate with x
2 4 f′(x)=3x2-2

56-44-2=26
f′′(x)=6x
131-269-
4 56
2=15 Now, substitute x=5
711-569- 23-1510-
4=131 2=1 f′(5)=3×52-2=73
71 269-13110-
9
1 4=23 f′′(5)=6×5=30
980-71110-
9=269

TEST VIII

Numerical Integration Technique

19. Trapezoidal Rule


- Find Solution using Trapezoidal rule.
x f(x) Using Trapezoidal Rule
1.4 4 ∫ydx=h2[y0+y4+2(y1+y2+y3)]
Solution:
1.6 4.9 The value of table for x and y ∫ydx=0.22[4+9+2×(4.9+6+7.3)]
1.8 6
x 1.4 1.6 1.8 2 2.2 ∫ydx=0.22[4+9+2×(18.2)]
2.0 7.3
y 4 4.9 6 7.3 9 ∫ydx=4.94
2.2 9

9
20. Simpson’s 1/3 Rule
- Find Solution using Simpson's 1/3 rule.
- x 7.47 7.48 7.49 7.5 7.51
x f(x)
y 1.93 1.95 1.98 2.01 2.03
7.47 1.93
Using Simpsons 13 Rule
7.48 1.95
7.49 1.98 ∫ydx=h3[(y0+y4)+4(y1+y3)+2(y2)]
7.50 2.01 ∫ydx=0.013[(1.93+2.03)+4×(1.95+2.01)+2×(
7.51 2.03 1.98)]

∫ydx=0.013[(1.93+2.03)+4×(3.96)+2×(1.98)]
Solution: ∫ydx=0.0792
The value of table for x and y

21. Simpson’s 3/8 Rule


- Find Solution using Simpson's 3/8 rule.
- x 0 0.25 0.5 0.75 1
x f(x)
y 1 0.9896 0.9589 0.9089 0.8415
0.00 1.0000
Using Simpson's 38 Rule
0.25 0.9896
0.50 0.9589 ∫ydx=3h8[(y0+y4)+2(y3)+3(y1+y2)]
0.75 0.9089 ∫ydx=3×0.258[(1+0.8415)+2×(0.9089)+3
1.00 0.8415 ×(0.9896+0.9589)]

∫ydx=3×0.258[(1+0.8415)+2×(0.9089)+3
×(1.9485)]
Solution:
The value of table for x and y ∫ydx=0.8911

Reflection
Numerical Methods and Analysis (EE313) is a course subject that every Electrical Student
should take. This subject taught me how to understand complicated problems using different kinds
of methods in solving. We do not use this kinds of solving in our daily lives, but I am certain that
this would be helpful in my future endeavours.
From the very beginning of this subject, we discussed from the basic methods – bisection,
false-position, etc. We also had some laboratories, where we inputted our problems and solve it
using MS Excel. It was fun though, even it was sometimes difficult to get the correct answer,
regardless – it was worth it.
Now, we’ve reached the last part of the topics, and all I could say is that, I learned a lot. I
did not expect to digest all of the topics, but I did, thankfully. Of course, this learning would never
be possible and accessible if it weren’t because of our instructor who gave his undivided and
unconditional attention to us, his students. We will be forever grateful for all the hardships and all
the laughter’s we’ve all shared. Charr! Ehem plus points hihi.

10

You might also like