0% found this document useful (0 votes)
225 views

NUmerical Solutions

The bisection method is a root-finding algorithm that uses bracketing to locate a root of a function within a given interval. It works by repeatedly bisecting the interval and narrowing in on the root. Specifically, it calculates the midpoint of the interval, evaluates the function at that point, and then selects the sub-interval in which the sign of the function changes, discarding the other half. This process is repeated with the selected sub-interval until the interval size is smaller than a predefined tolerance. The bisection method is simple to implement and is guaranteed to find a root if one exists, but it converges relatively slowly compared to other methods.

Uploaded by

Lia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
225 views

NUmerical Solutions

The bisection method is a root-finding algorithm that uses bracketing to locate a root of a function within a given interval. It works by repeatedly bisecting the interval and narrowing in on the root. Specifically, it calculates the midpoint of the interval, evaluates the function at that point, and then selects the sub-interval in which the sign of the function changes, discarding the other half. This process is repeated with the selected sub-interval until the interval size is smaller than a predefined tolerance. The bisection method is simple to implement and is guaranteed to find a root if one exists, but it converges relatively slowly compared to other methods.

Uploaded by

Lia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 76

COMPLEX NUMBER

•Complex
  number is a combination of real and imaginary numbers.
The square root of a negative number is called imaginary number
where the imaginary unit denoted as “,” satisfying the relation I =
NUMERICAL SOLUTIONS
ENGR. MARIANNE S. MENDEJA
INSTRUCTOR
Forms of Complex Number

•1.  Rectangular Form


Z = ( x ± yi)
Where x = real part of component
iy = imaginary part or imaginary component
2. Polar(or steinmetr) Form
Z=r
Where r = magnitude or amplitude
= argument or displacement in degrees
= read as bar angle
3. Trigonometric Form
z = r(cosØ ± jsinØ) or rcisØ or rcjsØ
4. Exponential Form

Where Ø = argument or displacement in radians.


Forms of Complex Number
•Example
 
Convert (6 -3i) to polar form, exponential form and
trigonometric form.
R=
Ø = arctan ( = -26.57°
Ø = -26.57 ( ) = -0.464 radian
6 – 3i = 6.708 -26.57°
6 – 3i = 6.708
6 – 3i = 6.708 )
Operations of Complex Number

•1.  Addition and Subtraction


a. To add or subtract two or more complex numbers in rectangular form,
add or subtract real part and imaginary part to imaginary part.
b. To add or subtract two or more complex numbers not in a reactangular
form, convert first these complex numbers to rectangular form and add
or subtract real part to real part and imaginary part to imaginary part.
Examples:
1. 3 30° - (6-2j) + 5 -20°
Solution
3 30° - (6-2j) + 5 -20°
= (2.598 + 1.5i) -6 + 2i + (4.698 – 1.710i)
= 2.598 -6 + 4.698 + I (1.5 + 2-1.710)
= 1.296 + 1.790i
Operations of Complex Number

•1.  Multiplication
The following are the rules in multiplication of complex numbers.
Rule 1. The product of two or more complex numbers in polar form, is equal to
the product of their magnitude and the sum of their directions.
Rule 2. To find the product of two or more complex numbers in rectangular form
Rule 3: Convert all complex numbers to polar form and apply Rule 1.

Examples:
1. (5 + 3i)(6 30° )
Solution
(5 + 3i)(6 30° )
= (5.831 30.96°( 6 30° )
= 34.986 60.96°
Operations of Complex Number

•1.  Division
The following are the rule in the division of complex numbers.
Rule 1: To perform division
Of complex numbers in polar form, divide their magnitude and get the
differences of their directions
Examples:

Solution
= 35° - 25° = 1.209 10°
SQUARE ROOT OF COMPLEX NUMBER

•To  evaluate the square root of a given complex number in polar


form, simply take the square root of magnitude and multiply the
direction by one-half. Or if the given complex number is in
rectangular form, let that as ( x + yi) = , square both sides and
simplify then use theorem 2 of complex number, this is an alternate
method.
1. Evaluate the square root of (3+4i) by two method
Solution
3+4i = 5 53.13°
(3+4i)^2 = 5^1/2 1/2*53.13°
(3+4i)^1/2 = 2.236 26.57°
•Second
  Method
Let x + jy = ()  
(  
(x + jy)^2 = 3+4i (
X=±2
Y=
(
( 2xy
 26.57°
Y = 4/2x = 2/x
Nth Root of Complex Numbers

•From
  the general exponential form and trigonometric form
Z=r
Wk =
Where:
k = 0,1,2… (n-1)
Wo = is the principal value of root and Ø must be positive angle
W1, W2, … Wn-1
De Moivre’s Theorem

•It  states that for any complex number raised to the nth power, the outcoms
will be equal to another complex number with magnitude equal to the
original complex number’s magnitude raised to the nth power and the
argument equal to the original complex numbers argument multiplied by
“m”
Expressing the theorem in equation we have;

=
(cos
Where: m is any real number
Introduction to Matrices

A matrix is a rectangular array of elements arranged in horizontal


rows and vertical columns, and usually enclosed in brackets. The
elements of a matrix will almost always be numbers or functions of
the variable t. A matrix is real – valued ( or simply, real) if all its
elements are real numbers or real – valued functions; it is complex –
valued if at least one element is a complex number or a complex
valued functions; it is complex – valued if at least one element is a
complex number or complex-valued function. If all its elements are
numbers, then a matric is called a constant matrix.
SOLUTION OF NONLINEAR EQUATION

TOPICS
I. DEFINITION
II. METHODS OF SOLUTION
III. BISECTION METHOD
IV. FALSE POSITION METHOD
V. NEWTON – RAPHSON METHOD
VI. SECANT METHOD
LEARNING OBJECTIVES

At the end of this lesson, the students will be able to:


I. Define roots of nonlinear equations
II. Determine the two main group of methods of solving the roots
of nonlinear systems.
III. Perform root-finding using the bracketing methods.
IV. Perform root finding using open method
V. Determine which method gives the most accurate value of the
root.
1.1: DEFINITION

Consider a function f(x), ξ is the root of the function if f(ξ) = 0.

Example:
Prove that x = {-3,5} are the roots of f(x) = X^2 – 2X -15.

Solution: Substitute x = -3 and x = 5 in the function:


f(-3) = (3)^2 – 2(-3) -15 = 0
f(5) = (5)^2 – 2(5) -15 =0
Hence, x = {-3,5} are the roots of the function.
1.2: METHODS OF SOLUTION

There are two leading groups of methods in solving the


function’s roots: closed and open methods. In the closed method,
finding the root’s value starts by assuming that it is in the interval
with lower limit X1 and upper limit Xu (or [X1, Xu}). Series of
iterations are performed so that the interval became as close to the
actual roots as possible. The main advantage of this methods will
still solve for the root/s. Some of the closed methods are:
1. Bisection Method
2. Method of False Position (Regula Falsi)
1.2: METHODS OF SOLUTION

Meanwhile, finding the root’s value using the open method starts
by assuming an initial value of X or X0, and series of iterations are
performed so that the value of X becomes as close to the actual
roots as possible. This method’s main advantages compared to the
previous one is: (a) this only needs one initial value of X, and (b)
this converges quickly. However, the values of X do not always
converge. Some of the open methods are:
1. Newton – Raphson Method
2. Secant Method
Bisection Method
1.3 Bisection Method

The bisection method is one of the closed or bracketing methods


in solving the roots of the polynomial. This method is used to
determine the root between the interval [Xl, Xu] by dividing the
interval into two equal intervals (or bisecting).
1.3 Bisection Method
The graphical representation in Figure 1.1
illustrates this root-finding technique.
Assume that the original interval is [ Xl,
Xu]. The interval will be divided into two
equal spans by placing the middle point Xm
(it is evident that Xm = Xl + Xu/2 since it is
the midpoint of the span). After bisecting,
two new intervals are present [Xl, Xu] and
[Xm, Xu]; however, only one of these two
contains the root.
1.3 Bisection Method

To choose the span that contains the root, determination of the


values (or sign) of f(Xl), f(Xm) and f(Xu) is necessary. If the
numerical sign of f(Xl) and f(Xm) are opposite, then the root is
between [Xl, Xm]. Based on the figure, f(Xl) is negative while f(Xm)
and f(Xu) are both positive. It means that the root is between [Xl,
Xm], as obviously shown in Figure 1.1. The process will be repeated
to the new interval until it becomes small enough to accept the
root’s approximate value.
1.3 Bisection Method
The graphical representation in Figure 1.1
illustrates this root-finding technique.
Assume that the original interval is [Xl,
Xu]. The interval will be divided into two
equal spans by placing the middle point
Xm (it is evident that Xm = Xl + Xu / 2
since it is the midpoint of the span). After
bisecting, two new intervals are present,
[Xl, Xm] and [Xm, Xu]; however, only one
of these two contains the root.
1.3 Bisection Method
•The
  following is the step-by-step procedure to perform the Bisection Method:
1. Determine the middle point between [Xl, Xu]:
Xm = Xl + Xu / 2
2. Solve for the vaues of f(Xl), f(Xm) and f(Xu).
3. To choose the new interval for the next iteration:
a. If f(Xl) and f(Xm) are opposite in signs (or f(fl) – f(Xm) 0), the new
interval wll be [Xl, Xm]. It means that Xl retans the lower limit but Xm
will be the new upper limit of the interval.
b. If f(Xm) and f(Xu) are opposite in signs (or f(Xm) • f(Xu) 0), the new
interval will be [Xm, Xu]. It means that Xm will be the new lower limit,
but Xu retains as the upper limit of the interval.
1.3 Bisection Method

4. Repeat the first three steps for every new interval until it
becomes relatively small and the approximate value of root can be
accepted. The tabular presentation of the results of iteration is
helpful. Notice that the size of the interval halves after every
iteration. The root of the function will be the average of the last
produced interval.
1.3 Bisection Method

Example :
Determine the root of 3x^4 + 7x^3 – 15x^2 + 5x = 17 between [0,2].
Use bisection method and perform seven iterations.
1.3 Bisection Method

• Solution: The given Function is f(x) = 3x^4 + 7x^3 – 15x^2 +5x – 7


First iteration: using [0,2]
Xm = 0+2/2 = 1
f(Xl) = f(0) = -17
f(Xlm) = f(1) = -17
F(Xu) = f(2) = 37
Since f(1) and f(2) are opposite in sign, the new interval is [1,2]
1.3 Bisection Method

Tabular Presentation
1.3 Bisection Method

Second iteration: using [1,2]


Xm = 1+2/2 = 1.5
f(Xl) = f(1) = -17
f(Xm) = f(1.5) = -4.438
f(Xu) = f(2) = 37
Since f(1.5) and f(2) are opposite in sign, the new interval is[1.5, 2]
1.3 Bisection Method

Tabular Presentation
1.3 Bisection Method

Third iteration: using [1,2]


Xm = 1 + 2 / 2 = 1.5
f(Xl) = f(1) = -17
f(Xm) = f(1.5) = - 4.438
f(Xu) = f(2) = 37
Since f(1.5) and f(1.75) are opposite in sign, the new interval is
[1.5, 1.75]
1.3 Bisection Method

Tabular Presentation
1.3 Bisection Method

The resulting interval for the 4th to 7th iterations are:


4th iterations: [1.5 1.625]
5th iterations: [1.5625, 1.625]
6th iteration: [1.5625, 1.59375]
7th iteration: [1.57813, 1.59375]
1.3 Bisection Method

Tabular Presentation
1.3 Bisection Method

Thus, the value of x is:


X = 1.57813 + 1.59375 / 2 = 1.58594
1.3 Bisection Method

NOTE:
The obtained value of the root is accurate to the nearest
hundredths after seven iterations (the exact value of x for five
decimal places is 1.58416). However, the approximate value may be
unacceptable for some scientists and engineers because of the
notable errors; thus, further iterations are needed.
False Position Method
1.4: False Position Method

The False position method, or the Regula Falsi method, is an improvement of the Bisection Method. The two
methods share similar procedures, with a notable exception to obtaining the middle point in the interval. Its
graphical representation, as shown in Figure 1.2, shows that the middle point xm is the intersection of the
line connecting (XL, f(XL)) and (Xu,f(Xu)) and the x-axis. To obtain the numerical value of Xm, consider
the equation of the line connecting its endpoints using analytic geometry; that is:
1.4: False Position Method

Figure 1.2
1.4 False Position Method
 Substituting y = 0 and x = Xm (coordinates of Xm)
-f(Xu) = f(Xu) – f(Fi) / Xu – Xl (Xm – Xu)

Simplifying the equation by some algebraic manipulation:


-f(Xu) . (Xu – Xl) = Xm [f(Xu) – f(Xl)] – Xu [f(Xu) – f(Xl)]
-Xuf(Xu) = Xl f(Xu) = Xm[f(Xu) – f(Xl)} – Xu f(Xu) = Xu f(Xl)
Xl f(Xu) – Xu f (Xl) = Xm[f(Xu) – f(Xl)]
l f(Xu) – Xu f(Xi) / f(Xu) – f(Xi)
1.4 False Position Method

This method is usually faster to converge than the Bisection method;


however, this method is not ideal if the initial interval is large ( for
example, if the difference between Xl and Xu is greater than 3)
1.4 False Position Method

The following is the step-by-step procedure to performe the False


Position Method:
1. Solve for the values of f(Xl) and f(Xu).
2. Determine the value of the middle point Xm; that is:
Xm = Xl f(Xu) – Xu f(Xl) / f(Xu) – f(Xi)
3. Solve for the values of f(Xm).
1.4 False Position Method

•4.  To choose the new interval for the next iteration:


a. If f(Xl) and f(Xm). It means that Xl retains the lower limit but Xm
will be the new upper limit of the interval.
b. If f(Xm) and f(Xu) are opposite in signs (or f(Xm) • f(Xu) 0), the
new interval will be [ Xm, Xu]. It means that Xm will be the new
lower limit, but Xu retains as the upper limit of the interval.
5. Repeat the first four steps for every new interval until it becomes
relatively small, and the approximate value of root can be accepted.
The tabular presentation of the results of the iteration is helpful.
1.4 False Position Method

Example:
Determine the root of 3x^4 + 7x^3 – 15x^2 +5x = 17 between [0,2]
using the false position method. Perform seven iterations.
1.4 False Position Method

Solution: The given Function is f(x) = 3x^4 = 7x^3 -15x^2 + 5x – 17


First iteration: using [0,2]
F(Xl) = f(0) = -17
f(Xu) = f(2) = 37
Xm= Xl f(Xu) – Xu f(Xl) / f( Xu) – f(Xl) = 0(37) – 2(-17) / 37 – (-17) =
0.62963
f(Xm) = f(0.62963) = -17.580
Since f(0.62963, 2]
1.4 False Position Method

• Tabular Presentation:
1.4 False Position Method

• Perform the same process until seven iterations are made. The
tabular presentation of the solutions is:
False Position Method

Thus, the value of x is: (Note that f(Xl) = f(1.58010) = -0.234 and
f(Xu) = f(2) = 37)
X = Xl f(Xu) – Xu f(Xl) / f(Xu) – f(Xl) = 1.58010(37) – 2(-0.234) / 37 – (-
0.234) = 1.58274
1.4 False Position Method

NOTE:
The obtained value of the root using this method is slightly
accurate than that using the bisection method (recall that the
accurate value of x for five decimal places is 1.58416). However,
this may still be unacceptable for some scientists and engineers;
thus, further thus, further iterations are needed.
1.5 Newton – Raphson Method

Perhaps the most common and most accurate root-finding technique


is the Newton-Raphson Method. This method involves the use of the
slope of the tangent to the curve. Consider the graphical illustration
of this method shown in Figure 1.3. Let Xn as the last assumed value
of the root. According to this method, the next value of the root, Xn
+ 1, is the intersection of the tangent line to the curve at
y – f(Xn) = m(x – Xn)
1.5 Newton – Raphson Method

Figure 1.3: Graphical illustration of the Newton-


Raphson Method
1.5 Newton-Raphson Method

Perhaps the most common and most accurate root-finding technique


is the Newton-Raphson Method. This method involves the use of the
slope of the tangent to the curve. Consider the graphical illustration
of this method shown in Figure 1.3. Let Xn as the last assumed value
of the root. According to this method, the next value of the root, Xn
+ 1, is the intersection of the tangent line to the curve at
y – f(Xn) = m(x – Xn)
1.5 Newton-Raphson Method
The coordirdinate of the point
where the tangent intersects the
x-axis is
(Xn + 1, 0) and from differential
calculus, is slope is f’(Xn).
Sucstituting these values in the
previous equation:
0 – f(Xn) = f’(Xn)(Xn + 1 – Xn) Figure 1.3: Graphical illustration of the Newton-
Raphson Method
Isolating Xn+1 in the equation:
Xn+1 = Xn – f(Xn) / f’ (Xn)
1.5: Newton-Raphson Method

The following is the step-by-step procedure to perform the Newton-


Raphson Method (the initial given is Xn):
1. Determine the first derivative of the function, f’(X)
2. Solve for f(Xn) and f’(Xn)
3. Solve for the new value of x, Xn+1
Xn + 1 = - f(Xn) / f’ (Xn)
4. Repeat steps 2 and 3 for every new value of x until its value can be
accepted as the root. The tabular presentation of the results of the
iteration is helpful.
1.5 Newton-Raphson Method

Solution:
The given function is f(x) = 3x^4 + 7x^3 – 15x^2 + 5x – 17
The first derivative is f’(x) = 12x^3 + 21x^2 – 30x + 5

First iteration (X0 = 0)


f(X0) = f(0) = - 17
f(X0) = f’(0) = 5
X1 = X0 – f(Xo) / f’(X0) = 0 – (-17) / 5 = 3.4
1.5 Newton-Raphson Method
Tabular Presentation:
1.5 Newton-Raphson Method

Second iteration (X1 = 3.4)


f(X1) = f(3.4) = 502.6288
f’(X1) = f’(3.4) = 617.408
1.5 Newton-Raphson Method

Solution:
The given function is f(x) = 3x^4 + 7x^3 – 15x2 + 5x – 17
The first derivative is f’(x) = 12x^3 +21x^2 – 30x + 5

First iteration (X0 = 0)


f(X0) = f(0) = -17
f’ (X0) = f’(0) = 5
X1 = X0 – f(X0) / f’(X0) = 0 – (-17) / 5 = 3.4
1.5 Newton-Raphson Method

Second iteration (X1 = 3.4)


f(X1) = f(3.4) = 502.6288
f’ (X1) = f’(3.4) = 617.408
X2 = X1 – f(X1) / f’(1) = 3.4 – 502.6288 / 617.408 = 2.58590
1.5 Newton-Raphson Method
Tabular Presentation:
1.5 Newton-Raphson Method

Perform the same process until seven iterations are made. The
tabular presentation of the solutions is:
1.5 Newton-Raphson Method

Based on the table, the root of the function is the last value of
Xn+1, i.e.,

x = 1.58416
1.5 Newton-Raphson Method

NOTE:
The obtained value of the root using this method is much more
accurate than using the first two methods for the same numbers of
iterations (Note that the exact value of x for five decimal places is
1.58416). Thus, so far, this method is the most preferred root-
finding method. However, the only downside of this method is that
the solver or programmer needs to establish first the first derivative
of the function; some instances show that this process is
complicated.
Secant Method
1.6: Secant Method

The previous example demonstrates that despite its accuracy and


speed, the main problem with the Newton-Raphson Method is
obtaining the derivative of a complicated functions. Thus, a new
method is modified by substituting the first derivative, f’(x), by the
slope of the secant line connecting the first two iterations, and is
called as secant method.
1.6: Secant Method
Consider the graphical representation
shown in Figure 1.4. The secant line passes
through (Xn-1, f(Xn-1)) and (Xn, f(Xn)).
Thus, its slope is:

  𝑓 ( 𝑥 𝑛 ) − 𝑓 ( 𝑥 𝑛 −1)
𝑚 𝑠𝑒𝑐𝑎𝑛𝑡 =
𝑋 𝑛 − 𝑋 𝑛 −1
By some algebraic
Replacing f’(x) in the Newton-Raphson manipulation
formula into Msecant :   =𝑋 −
𝑋
𝑓 ( 𝑥 𝑛 ) ( 𝑋 𝑛 − 𝑋 𝑛 − 1)
𝑛 +1 𝑛
𝑓 ( 𝑋 ¿¿ 𝑛)− 𝑓 ( 𝑋 𝑛 −1 )
¿

  =𝑋 − 𝑓 ( 𝑥𝑛)
𝑋 𝑛 +1 𝑛
𝑓 ( 𝑋 ¿¿ 𝑛)− 𝑓 ( 𝑋 𝑛 −1 )
¿
𝑋𝑛 − 𝑋𝑛−1
1.6: Secant Method

The following is the step-by-step procedure to perform the Secant


Method (the initial given are Xn-1 and Xn
1. Solve the values of (Xn-1) and f’(Xn)
2. Solve for the new value of X, Xn+1𝑓 𝑥 ( 𝑋 − 𝑋 )
  =𝑋 − ( 𝑛) 𝑛 𝑛−1
𝑋 𝑛 +1 𝑛
𝑓 ( 𝑋 ¿¿ 𝑛)− 𝑓 ( 𝑋 𝑛 −1 )
¿

3. Repeat steps 1 and 2 for every new value of x until its value can
be accepted as the root. The tabular presentation of the results
of the iteration is helpful
1.6: Secant Method

Example:

Determine the root of 3x^4 + 7x^3 – 15x^2 + 5X = 17 between (1,2).


Use the secant method and perform seven iterations.
1.6: Secant Method

Solutions:
The given function is f(x) = 3x^4 + 7X^3 – 15X^2 + 5x -17
First Iteration (X0 = 0, X1 = 2)
f(X0) = f(1) = -17
1.6: Secant Method

Solutions:
The given function is f(x) = 3x^4 + 7X^3 – 15X^2 + 5x -17
First Iteration (X0 = 1, X1 = 2)
f(X0) = f(1) = -17
f(X1) = f(2) = 37
 𝑋 = 𝑋 − 𝑓 ( 𝑥2 ) ( 𝑋 1 − 𝑋 0 ) 37 ( 2 −1 )
¿  2− = 1.31481
2 2
𝑓 ( 𝑥1 ) − 𝑓 ( 𝑋 0 ) 37 − ( −17 )
1.6: Secant Method

TABULAR PRESENTATION
1.6: Secant Method

Second Iteration (X1 = 2, X2 = 1.31481)


f(X1) = f(2) = 37
f(X2) = f(1.31481) = -11.481
  𝑓 ( 𝑥2 ) ( 𝑋 1 − 𝑋 0 )   − 11.481 ( 1.31481− 2 )
𝑋3=𝑋2− ¿ 1.31481− =1. 47707
𝑓 ( 𝑥1 ) − 𝑓 ( 𝑋 0) −11.481 − 37
1.6: Secant Method

TABULAR PRESENTATION
1.6: Secant Method
Perform the same process until seven iteration are made. The tabular
presentation of the solution is:

Based on the table, the root of the function is the last value of Xn+1, ie.,
x = 1.58416
1.6: Secant Method
Note:
The values obtained using both the Newton-Raphson and the Secant
Methods are the same for at least five decimal places. This means that
secant method is a good alternative if the derivative of the function is
challenging to obtain.

You might also like