0% found this document useful (0 votes)
14 views25 pages

SWE Math4543 Lecture1

Uploaded by

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

SWE Math4543 Lecture1

Uploaded by

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

Math 4543: Numerical Methods

Lecture 1 — Introduction & Bisection Method

Syed Rifat Raiyan


Lecturer
Department of Computer Science & Engineering
Islamic University of Technology, Dhaka, Bangladesh
Email: [email protected]

Math 4543: Numerical Methods Lecture 1 SWE, IUT 1


Introduction
First things first…

Google Classroom — hjqlnji

Relevant Resources
• Book/Lecture notes — Numerical Methods with Applications by Professor Dr. Autar Kaw
Link: http://nm.mathforcollege.com/NumericalMethodsTextbookUnabridged/
• Video Lectures — YouTube channel numericalmethodsguy
Link: https://www.youtube.com/@numericalmethodsguy
• Practise Problems — Holistic Numerical Methods website
Link: https://nm.mathforcollege.com/physical-problems/
Link: http://nm.mathforcollege.com/mws/che/

Keep an eye on the GC for the Slides and Lecture notes.

Math 4543: Numerical Methods Lecture 1 SWE, IUT 2


Introduction
How to do well in this course?
Numerical
For the theory course Math 4543 — Methods

• Pay attention to the class lectures.


• Practise examples from the lecture notes and the HNM website.
• Solve previous-year questions (problems and derivations).
• Practise, practise, and practise…

For the lab course Math 4544 —


• Try to convert the algorithms taught in the class to pseudocode.
• Practise implementing them before attending the lab session.
• Key pre-requisite:
 Basic knowledge about the Python programming language.
 Familiarity with Google Colab or Jupyter Notebook.

Math 4543: Numerical Methods Lecture 1 SWE, IUT 3


Lecture Plan
The agenda for today

• What are Numerical Methods?

• Why do we need them?

• Analytical solution vs. Numerical solution

• The Bisection Method of Solving a Nonlinear Equation

• The pros and cons of the method

Expect some mini quizzes!

(for easy attendance marks bonus 😉)

Math 4543: Numerical Methods Lecture 1 SWE, IUT 4


Numerical Methods
What are they and why do we need them?

Definition: Numerical methods are techniques to approximate mathematical processes


(examples of mathematical processes are integrals, differential equations, nonlinear equations).

Numerical methods are just one step in solving an engineering problem.

Math 4543: Numerical Methods Lecture 1 SWE, IUT 5


Numerical Methods
What are they and why do we need them?

We end up with a quadratic equation (polynomial with degree 2).

Solving analytically, using the Solving numerically, using a numerical


quadratic formula. method e.g. the bisection method.

 Get exact solutions.


 Involves a lot of symbolic
manipulations.  Get approximate solutions.
 Converge till solution “good enough.”
Math 4543: Numerical Methods Lecture 1 SWE, IUT 6
Mini Quiz
Quantifying the goodness of an approximation

How can we judge how good of an approximation our guess is?


(given the ground-truth or the value of the guess in the previous iteration)

Math 4543: Numerical Methods Lecture 1 SWE, IUT 7


Mini Quiz
Quantifying the goodness of an approximation

We use absolute relative errors as our metric of judgement.

Remember your physics lab experiments?


(e.g. calculating the acceleration due to gravity using a pendulum)

Math 4543: Numerical Methods Lecture 1 SWE, IUT 8


Numerical Methods
More on why we need them

We need to resort to finding approximations because —


• We cannot solve the procedure analytically, e.g. the standard normal Cumulative Distribution
Function (CDF)

• The analytical method is intractable, such as solving a set of a 1000 simultaneous linear equations
for a 1000 unknowns.

Math 4543: Numerical Methods Lecture 1 SWE, IUT 9


Bisection Method
For solving a Nonlinear Equation

One of the first numerical methods developed to find the root of a nonlinear equation
was the bisection method (also called the binary-search method).

It falls under the umbrella of bracketing methods.

Math 4543: Numerical Methods Lecture 1 SWE, IUT 10


Bisection Method
Examining the cases (not changing signs)

Math 4543: Numerical Methods Lecture 1 SWE, IUT 11


Bisection Method
Examining the cases (changing signs)

Math 4543: Numerical Methods Lecture 1 SWE, IUT 12


Mini Quiz
An edge case?
Does the theorem fail in this case?

Math 4543: Numerical Methods Lecture 1 SWE, IUT 13


Bisection Method
The algorithm

Math 4543: Numerical Methods Lecture 1 SWE, IUT 14


Bisection Method
An example problem

Ignore for now.


We will revisit this later!

Math 4543: Numerical Methods Lecture 1 SWE, IUT 15


Bisection Method
An example problem

A sanity check of
the initial guesses.

Math 4543: Numerical Methods Lecture 1 SWE, IUT 16


Bisection Method
An example problem

Math 4543: Numerical Methods Lecture 1 SWE, IUT 17


Bisection Method
An example problem

Math 4543: Numerical Methods Lecture 1 SWE, IUT 18


Bisection Method
An example problem

Math 4543: Numerical Methods Lecture 1 SWE, IUT 19


Bisection Method
An example problem

Math 4543: Numerical Methods Lecture 1 SWE, IUT 20


Bisection Method
An example problem

Math 4543: Numerical Methods Lecture 1 SWE, IUT 21


Bisection Method
The pros and cons

GIF Link

Math 4543: Numerical Methods Lecture 1 SWE, IUT 22


Bisection Method
The pros and cons

Math 4543: Numerical Methods Lecture 1 SWE, IUT 23


Bisection Method
The pros and cons

Math 4543: Numerical Methods Lecture 1 SWE, IUT 24


Bisection Method
The pros and cons

Math 4543: Numerical Methods Lecture 1 SWE, IUT 25

You might also like