You are on page 1of 7

College of

Engineering CE 33A Numerical Solutions to CE Problems, Lab

Activity Report No. 3

Numerical Differentiation and Integration


1
Student, BSCE-2C;

Instructor: Engr.

Date Submitted:

1. Introduction

The technique of obtaining the numerical value of a derivative of a given function at a specific
position is known as numerical differentiation. It refers to a method for computing the estimated
numerical value of the derivative of a function at a point in the domain as a difference quotient.
Numerical Integration on the other hand, is the estimated computation of an integral using numerical
technique. It is the reverse process of differentiation. Quadrature refers to the numerical computation of
an integral.

In Numerical differentiation, one of the fastest method to approximate a derivative for a set of
discrete points is to create an interpolation function, which will give an estimated continuous function
for the data. You can then employ known derivatives once you have the approximated function, such as
a polynomial function. Numerical Integration is carried by the numerical methods and they are of three
types Euler’s method, trapezoidal rule and Simpson’s rule. Numerical Integration is used when
analytical integration is difficult or not possible and when the integrant is given as a set of discrete
point.

In general differentiation is used to divide in quantity into number of parts, and integration is used
to unite small quantities into a large quantity. Differentiation and integration is utilized when a value
changes simultaneously in relation or with respect to another value.

2. Process Flow

MS office Excel was used for the conduction of the activity. The goal of the first page was to use
Gauss Elimination to find the solution to the given system of linear equations. Equation 1 contains the
linear equations that were employed in the Gauss Elimination.

4𝑤− 2𝑥− 3𝑦 + 6𝑧 = 12 Eq. 1


−6𝑤 + 7𝑥 + 6.5𝑦− 6𝑧 = −6.5
CE 31.1, First Semester, S.Y. 2021-2022 Page 2 of
7

𝑤 + 7.5𝑥 + 6.25𝑦 + 5.5𝑧 = 16


−12𝑤 + 22𝑥 + 15.5𝑦−𝑧 = 17

Transforming the equation into matrix form was the first thing done on the activity. The method's
first purpose was to assign a value of zero to all values below the pivot element. Equations are assigned
to each row to meet the constraint that the values below the first pivot element becomes zero. To satisfy
the conditions equation 2 was used. These will be repeated for each subsequent pivot element until the
last value below the previous pivot element is reached. A system of n linear algebraic equations has the
generic form an1 x1 + an2 x2+...+ ann xn = bn, as shown in Eq. 2

𝑎𝑛1𝑥1 + 𝑎𝑛2𝑥2 + ⋯ + 𝑎𝑛𝑛𝑥𝑛 = 𝑏𝑛 Eq. 2


The first step in the Gauss-Jacobi approach is to arrange the equations in a diagonally dominant
manner, the next step is to reorganize the information into explicit forms. Third, is to set the unknowns
to zero at the start and finally iterate until convergence is achieved. The equations that were used in the
Gauss-Jacobi and Gauss-Seidel are shown in Eq. 3.

−12𝑤 + 3𝑥𝑥 + 5𝑦−𝑧 = 17 Eq. 3


2𝑤−𝑥𝑥 + 16𝑦 + 6𝑧 = 12
𝑤 + 8𝑥 + 2𝑦− 4𝑧 = 16
−6𝑤 + 2𝑥 + 7𝑦 + 21𝑧 = −

The Gauss-Seidel method uses the latest updated values during the iterative procedure while Gauss
Jacobi method uses the values obtained from the previous test.
Graph 1. Flowchart for the Gauss Elimination
CE 31.1, First Semester, S.Y. 2021-2022 Page 3 of
7

Graph 2. Flowchart for the Gauss-Jacobi and Gauss–Seidel method

3. Observation

The matrix form of the following equations is shown in Table 1. Table 2 was created using Gauss
elimination, resulting in an upper triangle variant of Gauss Elimination. A non-zero value of 4, 2, -3, 6,
and a constant of 12 make up the first row. The second row has a constant of 11.5, a non-zero value of 4,
2, 3, and a non-zero value of 4. Non-zero numbers of 3, -2, and a constant of -10 make up the third row.
The last row has a constant of 2 and a non-zero value of 4. The values obtained for the variables z, y, x,
and w are 0.5, -3, 4, and 2 correspondingly, as shown in Table 3.
CE 31.1, First Semester, S.Y. 2021-2022 Page 4 of
7

Table 1. Matrix form of the given equations

w x y z constant
4 -2 -3 6 12
-6 7 6.5 -6 -6.5
1 7.5 6.25 5.5 16
-12 22 15.5 -1 17

Table 2. Upper triangle form of Gauss Elimination

4 -2 -3 6 12
0 4 2 3 11.5
0 0 3 -2 -10
0 0 0 4 2

Table 3. Values obtained from Gauss Elimination

z 0.5
y -3
x 4
w 2

The matrix was sorted in Table 4 according to dominance, which was used in the Gauss-
Jacobi approach. The matrix's sign was then changed, as shown in table 5. The results obtained
using the Gauss-Jacobi method are shown in Table 6. It can be seen that the values converge at the
15th iteration. W, x, y, and z have values of -0.48668, 1.17833, 1.30220, and -1.11391, respectively.

Table 4. Matrix arranged according to dominance

w x y z Constant
-12 3 5 -1 17
1 8 2 -4 16
2 -1 16 6 12
-6 2 7 21 -9
CE 31.1, First Semester, S.Y. 2021-2022 Page 5 of
7

Table 5. Matrix arranged according to dominance and corrected signs

w x y z constant
-12 -3 -5 1 17
-1 8 -2 4 16
-2 1 16 -6 12
6 -2 -7 21 -9

Table 6. Gauss-Jacobi table

N w x y z
0 0 0 0 0
1 -1.41667 2.00000 0.75000 -0.42857
2 -0.56845 1.77530 1.21280 -1.27381
3 -0.36136 1.13095 1.40969 -1.16433
4 -0.44953 1.11058 1.30248 -1.10942
5 -0.50387 1.17586 1.29164 -1.09694
6 -0.49311 1.19161 1.29783 -1.11507
7 -0.48508 1.17965 1.30426 -1.11555
8 -0.48535 1.17679 1.30270 -1.11427
9 -0.48682 1.17786 1.30207 -1.11355
10 -0.48688 1.17856 1.30205 -1.11386
11 -0.48668 1.17842 1.30222 -1.11394
12 -0.48664 1.17831 1.30221 -1.11393
13 -0.48667 1.17831 1.30220 -1.11390
14 -0.48668 1.17833 1.30219 -1.11391
15 -0.48668 1.17833 1.30220 -1.11391
16 -0.48668 1.17833 1.30220 -1.11391
17 -0.48668 1.17833 1.30220 -1.11391
18 -0.48668 1.17833 1.30220 -1.11391
19 -0.48668 1.17833 1.30220 -1.11391
20 -0.48668 1.17833 1.30220 -1.11391
CE 31.1, First Semester, S.Y. 2021-2022 Page 6 of
7

Table 7 shows the values obtained using the Gauss-Seidel method. In the 9th iteration, it is
observed that the values converged. W, x, y, and z have the values of -0.48668, 1.17833, 1.30220, and
-1.11391, respectively.

The Gauss-Seidel technique converges in nine (9) iterations, but the Gauss-Jacobi approach
takes fifteen (15) iterations, indicating that the Gauss-Seidel method is more efficient in this
example. The values for w, x, y, and z determined by the two techniques are -0.48668, 1.17833,
1.30220, and - 1.11391, respectively.

Table 7. Gauss-Seidel table

N w x y z
0 0 0 0 0
1 -1.41667 2.17708 1.06315 -1.39506
2 -0.31316 1.07583 1.37953 -1.08035
3 -0.48288 1.17530 1.28895 -1.10812
4 -0.49344 1.18538 1.30131 -1.11622
5 -0.48509 1.17720 1.30279 -1.11355
6 -0.48674 1.17837 1.30207 -1.11389
7 -0.48672 1.17838 1.30220 -1.11393
8 -0.48666 1.17832 1.30220 -1.11391
9 -0.48668 1.17833 1.30220 -1.11391
10 -0.48668 1.17833 1.30220 -1.11391
11 -0.48668 1.17833 1.30220 -1.11391
12 -0.48668 1.17833 1.30220 -1.11391
13 -0.48668 1.17833 1.30220 -1.11391
14 -0.48668 1.17833 1.30220 -1.11391
15 -0.48668 1.17833 1.30220 -1.11391
16 -0.48668 1.17833 1.30220 -1.11391
17 -0.48668 1.17833 1.30220 -1.11391
18 -0.48668 1.17833 1.30220 -1.11391
19 -0.48668 1.17833 1.30220 -1.11391
20 -0.48668 1.17833 1.30220 -1.11391

4. Conclusion

In conclusion, the activity that was conducted it shows that the Gauss-Seidel method obtained the
values earlier making few iterations compared to the Gauss-Jacobi. Systems of linear equation is an
important tool in the field of engineering for it helps them solve complex problems and also systems of
CE 31.1, First Semester, S.Y. 2021-2022 Page 7 of
7

equations are a powerful tool for simulating and answering questions about real-world situations. With
the help of computers and its different software such as MS Excel, engineers can now solve problems
with ease and can now solve problems faster and efficiently than before.

5. References

1. Press, W. H.; Flannery, B. P.; Teukolsky, S. A.; and Vetterling, W. T. "Numerical


Derivatives." §5.7 in Numerical Recipes in FORTRAN: The Art of Scientific Computing,
2nd ed. Cambridge, England: Cambridge University Press, pp. 180-184, 1992.
2. R.L. Burden, J.D. Faires Numerical Analysis (Fifth edition), PWS Publishing Company, Boston,
MA (1993)

You might also like