You are on page 1of 30

Numerical methods | Richard A.

Lagatuz

NUMERICAL METHODS

A workbook
submitted to
Engr. Loreimay B. Andaya
in final fulfillment of the requirements in
ELECTRICAL ENGINEENIRING REVIEW

Richard A. Lagatuz
BSEE 4A

1
Numerical methods | Richard A. Lagatuz

FOREWORD

In this module, various information about different numerical methods are stated in
which each technique is provided with different problems that help its reader to further
understand the meaning and process of how this method can answer any mathematical and
complex real-life problem that requires an extensive calculation to carry out a solution. As
some of these methods are complicated to recognize, it requires a thorough comprehension of
the past topics about basic numerical analysis, mathematical expression, and the basic
foundation of differential and integral calculation. As we have the sufficient knowledge about
this matter we are able to apply that information to solve problems and utilize each method.
There are different types of numerical method in which some of it are not included in this
module and indicates only the definition with the general formula of each method that has
been collected from reliable resources across the web.

2
Numerical methods | Richard A. Lagatuz

TABLE OF CONTENTS

I. INTRODUCTION

II. ROOT FINDING


a. Bisection method
b. False Position Method
c. Newton’s Method
d. Secant method

III. LINEAR ALGEBRAIC EQUATION


a. Gaussian Elimination
b. LU decomposition
c. Gauss-Seidel Method

IV. CURVE FITTING


a. Linear Regression
b. Polynomial Regression
c. Multiple Linear Regressions
d. Newton’s Divided Difference Interpolating Polynomial
e. Lagrange Interpolating Polynomial

V. Numerical Differentiation
a. Forward Finite-Divided Differences
b. Backward Finite-Divided Differences
c. Centred Finite-Divided Differences

VI. Numerical integration


a. Trapezoidal rule
b. Simpson’s rule
c. Gauss Quadrature

VII. Ordinary Differential Equation


a. Taylor Series Method
b. Euler’s Method
c. Heun’s Second Order RK
d. Midpoint Second Order RK
e. Ralston’s Second Order RK
f. Classical Fourth Order RK

3
Numerical methods | Richard A. Lagatuz

Introduction

In the area of mathematics called numerical analysis which in charge of coming up with
practical methods for calculating answers to difficult mathematical problems. The majority of
mathematical issues in science and engineering are extremely complicated and occasionally
unsolvable. In order to simplify a difficult mathematical issue, measurement is crucial. So
due to the advancement of our technology, several numerical methods are used in order to
create more accurate and reliable computing techniques that solved mathematical problems or
complex problems including real life issues in a faster way.
The creation, analysis, and application of algorithms for resolving numerical issues in
continuous mathematics are the main applications of the numerical analysis approach in
mathematics and computer science. These kinds of issues typically come up in the actual
world when algebra, geometry, and calculus are applied, and they also have continuous
variables.
Through numerical methods, it is possible to approximate mathematical operations it may
simple or complex mathematical expressions. Our inability to solve the operation analytically
or the difficulty of the analytical method necessitates the use of approximations like solving
numerous set of linear equations for a thousand unknowns. Understanding the importance of
these methods is necessary especially when solving the exact method results in error to real
life problem. It provides a great impact in analyzing dependent and independent components
regarding fluid, heat and various complex variables that gives an clearly answer.

4
Numerical methods | Richard A. Lagatuz

NUMERICAL METHOD

I. ROOT FINDING

A root-finding is a technique for locating zeros, commonly referred to as "roots," of


continuous functions. A number x is a zero of a function f if it has the property that
f(x) = 0, whether the function is one from real numbers to real numbers or from
complex numbers to complex numbers.

Methods of Root Finding

a. Bisection method

A root-finding method that applies to any continuous function for which one knows
two values with opposite signs.
It is a very simple and robust method, but it is also relatively slow. Because of this, it
is often used to obtain a rough approximation to a solution which is then used as a
starting point for more rapidly converging methods.

b. False Position Method

In mathematics, an ancient method of solving an equation in one variable is the false


position method (method of false position) or regula falsi method. In simple words,
the method is described as the trial and error approach of using “false” or “test”
values for the variable and then altering the test value according to the result.

c. Newton’s Method

Also known as the Newton–Raphson method, named after Isaac Newton and Joseph
Raphson. This is the fastest method, but requires analytical computation of the
derivative of f (x). Also, the method may not always converge to the desired root. It
produces successively better approximations to the roots (or zeroes) of a real-valued
function.

5
Numerical methods | Richard A. Lagatuz

d. Secant method

It uses a succession of roots of secant lines to better approximate a root of a function


f. The secant method can be thought of as a finite-difference approximation of
Newton's method.

II. LINEAR ALGEBRAIC EQUATION

a. Gaussian Elimination

Also known as Row Reduction Algorithm for solving linear equations systems. It
consists of a sequence of operations performed on the corresponding matrix of
coefficients.

b. LU decomposition

In linear algebra, LU Decomposition, i.e., lower–upper (LU) decomposition or


factorization of a matrix, can be defined as the product of a lower and an upper
triangular matrices.

6
Numerical methods | Richard A. Lagatuz

c. Gauss-Seidel Method

The Gauss-Seidel method is a improvisation of the Jacobi method. This method is


named after mathematicians Carl Friedrich Gauss (1777–1855) and Philipp L. Seidel
(1821–1896). This modification often results in higher degree of accuracy within less
iteration. In Jacobi method the value of the variables is not modified until next
iteration, whereas in Gauss-Seidel method the value of the variables is modified as
soon as new value is evaluated. For instance, in Jacobi method the value of xi(k) is
not modified until the (k + 1)th iteration but in Gauss-Seidel method the value of xi(k)
changes in in kth iteration only.

III. CURVE FITTING

a. Linear Regression

Linear regression analysis is used to predict the value of a variable based on the
value of another variable. The variable you want to predict is called the dependent
variable. The variable you are using to predict the other variable's value is called the
independent variable.

7
Numerical methods | Richard A. Lagatuz

b. Polynomial Regression

In statistics, polynomial regression is a form of regression analysis in which the


relationship between the independent variable x and the dependent variable y is
modeled as an nth degree polynomial in x. Polynomial regression fits a nonlinear
relationship between the value of x and the corresponding conditional mean of y,
denoted E(y |x). Although polynomial regression fits a nonlinear model to the data,
as a statistical estimation problem it is linear, in the sense that the regression
function E(y | x) is linear in the unknown parameters that are estimated from the
data.

c. Multiple Linear Regressions

Multiple linear regression is a regression model that estimates the relationship


between a quantitative dependent variable and two or more independent variables
using a straight line.

8
Numerical methods | Richard A. Lagatuz

d. Newton’s Divided Difference Interpolating Polynomial

Interpolation is an estimation of a value within two known values in a sequence of


values. Newton’s divided difference interpolation formula is an interpolation
technique used when the interval difference is not same for all sequence of
values.

e. Lagrange Interpolating Polynomial

Lagrange Interpolation Formula finds a polynomial called Lagrange Polynomial that


takes on certain values at an arbitrary point. It is an nth degree polynomial expression
to the function f(x). The interpolation method is used to find the new data points
within the range of a discrete set of known data points.

IV. Numerical Differentiation

Numerical differentiation is the process of finding the numerical value of a


derivative of a given function at a given point.

A finite difference is a mathematical expression of the form f (x + b) − f (x + a). If a


finite difference is divided by b − a, one gets a difference quotient. The
approximation of derivatives by finite differences plays a central role in finite
difference methods for the numerical solution of differential equations, especially
boundary value problems.

9
Numerical methods | Richard A. Lagatuz

Finite differences were introduced by Brook Taylor in 1715 and have also been
studied as abstract self-standing mathematical objects in works by George Boole
(1860), L. M. Milne-Thomson (1933), and Károly Jordan [de] (1939). Finite
differences trace their origins back to one of Jost Bürgi's algorithms (c. 1592) and
work by others including Isaac Newton. The formal calculus of finite differences can
be viewed as an alternative to the calculus of infinitesimals.

a. Forward Finite-Divided Differences

b. Backward Finite-Divided Differences

c. Centered Finite-Divided Differences

V. Numerical integration

In analysis, numerical integration comprises a broad family of algorithms for


calculating the numerical value of a definite integral, and by extension, the term is
also sometimes used to describe the numerical solution of differential equations.
The term numerical quadrature (often abbreviated to quadrature) is more or less
a synonym for numerical integration, especially as applied to one- dimensional
integrals. Some authors refer to numerical integration over more than one
dimension as cubature; others take quadrature to include higher- dimensional
integration.

10
Numerical methods | Richard A. Lagatuz

a. Trapezoidal rule

Trapezoidal Rule is a rule that evaluates the area under the curves by dividing the
total area into smaller trapezoids rather than using rectangles. This integration works
by approximating the region under the graph of a function as a trapezoid, and it
calculates the area.

b. Simpson’s rule

Simpson's rule is a Newton-Cotes formula for approximating the integral of a


function f using quadratic polynomials (i.e., parabolic arcs instead of the straight line
segments used in the trapezoidal rule).
It is also a method for approximating the area under a curve over a given interval that
involves partitioning the interval by an odd number n + 1 of equally spaced
ordinates and adding the areas of the n/2 figures formed by pairs of successive
odd-numbered ordinates and the parabolas which they determine with their
included even-numbered ordinates.

11
Numerical methods | Richard A. Lagatuz

c. Gauss Quadrature

In numerical analysis, a quadrature rule is an approximation of the definite


integral of a function, usually stated as a weighted sum of function values at
specified points within the domain of integration.
An n-point Gaussian quadrature rule, named after Carl Friedrich Gauss,[1] is a
quadrature rule constructed to yield an exact result for polynomials of degree 2n − 1
or less by a suitable choice of the nodes xi and weights wi for i = 1, …, n.

12
Numerical methods | Richard A. Lagatuz

VI. Ordinary Differential Equation

An ordinary differential equation (also abbreviated as ODE), in Mathematics, is


an equation which consists of one or more functions of one independent variable
along with their derivatives.

a. Taylor Series Method

Taylor series methods compute a solution to an initial value problem in ordinary


differential equations by expanding each component of the solution in a long
Taylor series. The series terms are generated recursively using the techniques of
automatic differentiation.

b. Euler’s First Order RK

The most basic explicit method for numerical integration of ordinary differential
equations and is the simplest Runge–Kutta method.
The Euler method is a first-order method, which means that the local error (error per
step) is proportional to the square of the step size, and the global error (error at a
given time) is proportional to the step size.

c. Heun’s Second Order RK

In mathematics and computational science, Heun's method may refer to the


improved or modified Euler's method (that is, the explicit trapezoidal rule, or a
similar two-stage Runge–Kutta method. It is named after Karl Heun and is a
numerical procedure for solving ordinary differential equations (ODEs) with a
given initial value. Both variants can be seen as extensions of the Euler method into
two-stage second-order Runge–Kutta methods.
Heun's Method considers the tangent lines to the solution curve at both ends of the
interval, one which overestimates, and one which underestimates the ideal vertical
coordinates. A prediction line must be constructed based on the right end point
tangent's slope alone, approximated using Euler's Method.

13
Numerical methods | Richard A. Lagatuz

d. Midpoint Second Order RK

The midpoint method is a type of second order Runge-Kutta method. It is used to


solve ordinary differential equations with a given initial condition.
This method uses a tangent to approximate the next point y(i+1) given the initial
point y(i). This technique was named the midpoint method because it uses the
tangent at the midpoint and then checks where the tangent cuts the vertical
lines.

e. Ralston’s Second Order RK

Ralston's method is a second-order method with two stages and a minimum local
error bound.

f. Classical Fourth Order RK

The most commonly used Runge Kutta method to find the solution of a differential
equation is the RK4 method, i.e., the fourth-order Runge-Kutta method. The
Runge-Kutta method provides the approximate value of y for a given point x.

14
Numerical methods | Richard A. Lagatuz

SAMPLE PROBLEM

1. Find the root of the equation x e^x = cosx using the Secant method correct to four decimal
places.

15
Numerical methods | Richard A. Lagatuz

4. Using Regula Falsi Method, compute the real root of the equation x ex – 2 = 0 correct up
to three decimals places.

16
Numerical methods | Richard A. Lagatuz

17
Numerical methods | Richard A. Lagatuz

18
Numerical methods | Richard A. Lagatuz

19
Numerical methods | Richard A. Lagatuz

20
Numerical methods | Richard A. Lagatuz

21
Numerical methods | Richard A. Lagatuz

22
Numerical methods | Richard A. Lagatuz

23
Numerical methods | Richard A. Lagatuz

24
Numerical methods | Richard A. Lagatuz

25
Numerical methods | Richard A. Lagatuz

26
Numerical methods | Richard A. Lagatuz

27
Numerical methods | Richard A. Lagatuz

28
Numerical methods | Richard A. Lagatuz

29
Numerical methods | Richard A. Lagatuz

REFERENCE

 (2022, May 2). Gauss Elimination Method | Meaning and Solved Example. BYJUS.
https://byjus.com/maths/gauss-elimination-
method/#:~:text=In%20mathematics%2C%20the%20Gaussian%20elimination,rank%
20of%20the%20given%20matrix
 GeeksforGeeks. (2022, November 14). Newton s Divided Difference Interpolation
Formula. https://www.google.com/amp/s/www.geeksforgeeks.org/newtons-divided-
difference-interpolation-formula/amp/
 (2022b, November 9). LU Decomposition | LU Decomposition Method of
Factorisation Steps. BYJUS. https://byjus.com/maths/lu-decomposition/
 (2022b, May 2). The Jacobi and Gauss-Seidel Iterative Methods. BYJUS.
https://byjus.com/maths/iterative-methods-gauss-seidel-and-
jacobi/#:~:text=Gauss%2DSeidel%20Method,of%20accuracy%20within%20fewer%
20iterations.
 Introduction to Numerical Methods/Roots of Equations - Wikibooks, open books for
an open world. (n.d.).
https://en.m.wikibooks.org/wiki/Introduction_to_Numerical_Methods/Roots_of_Equa
tions
 (2022b, April 28). False Position Method (Regula Falsi Method) - Formulas, Solved
Example. BYJUS. https://byjus.com/maths/false-position-
method/#:~:text=The%20false%20position%20method%20is,the%20roots%20of%20
the%20equation.
 8.7 Numerical Integration‣ Chapter 8 Techniques of Integration ‣ Calculus II. (n.d.).
https://sites.und.edu/timothy.prescott/apex/web/apex.Ch8.S7.html
o (2022e, August 26). Trapezoidal Rule for Integration (Definition, Formula,
and Examples). BYJUS. https://byjus.com/maths/trapezoidal-rule/
 (2021b, December 7). Simpson’s Rule For Integration - Definition and Formula for
1/3 & 3/8 Rule. BYJUS. https://byjus.com/maths/simpsons-rule/#formula
 Euler Method for solving differential equation - GeeksforGeeks. (n.d.).
https://www.geeksforgeeks.org/euler-method-solving-differential-equation/amp/
 Wikipedia contributors. (2023, January 12). Heun’s method. Wikipedia.
https://en.m.wikipedia.org/wiki/Heun%27s_method#:~:text=Heun's%20Method%20c
onsiders%20the%20tangent,alone%2C%20approximated%20using%20Euler's%20M
ethod.

30

You might also like