Bisection Method (Theory, Examples & Codes) | Numerical Methods

preview_player
Показать описание
This is a compilation video of all our bisection method videos. The Bisection method is a way to solve non-linear equations through numerical methods. Bisection method relies on defining two inputs between which there is a known root. In this video we go into the theory and procedure of the bisection method, how to solve an example using the bisection method and how to code the bisection method into python.

This timeline is meant to help you better understand the bisection method:
0:00 Bisection Method Theory
3:25 Bisection Method Example
7:59 Coding the bisection method into python
12:26 Bisection Method In Microsoft Excel
17:01 Bisection Method In Google Sheets
23:45 Outro

Relevant Numerical Methods Playlists:

Follow & Support StudySession:

This video is part of our Numerical Methods course. Numerical methods is about solving math problems through approximating the solution of problems that would be difficult or impossible to solve analytically. In this playlist we will cover topics such as solving systems of linear equations, solving systems of non-linear equations, numerical integration, numerical derivatives, etc..
#StudySession #NumericalMethods #BisectionMethod
Рекомендации по теме
Комментарии
Автор

Dude, such great comment should not be free, you are amazing, real help for my engineering class of numeric methods

David-pwsp
Автор

The use of 'error = abs(b - a)' means you are dealing with the number of decimal places.
This is OK if the root is in [1, 10] but give bad results if the root is near 0 e.g. x -
The sequence of intervals would be
1
2
3 0.250000]
4 0.125000]
5 0.062500]
...
20
so |b - a| = <
In this case, take the midpoint of this interval and we find
- < 5*10**(-6)
so that is an approximation to that is accurate to 5 decimal places but is a useless result.
Absolute error gives decimal place - relative error '|b - a| <= tol*|a|' gives digits - and a meaningful result.

From a code point of view-
From line 12 on, because the function exits on the 'quit', we can assume that f(a) and f(b) have opposite signs so there is no need to compare both 'f(c) * f(a) < 0' and f(c) * f(a\b) < 0. Also, we only need the signs of the functions so we could use 'import numpy as np' so the code could be
if f(a)*f(b) >= 0:
print( 'No root or multiple. roots present, therefore, the bisection method will not work|')
quit()
if np.sign(f(a)) == np.sign(f(m)):
b = c
else:
a = c
error = abs(b - a)

The function should return an error code rather than 'quit()'.

EdwardNorminton
Автор

Just draw a vertical line around the root? That's too aggressive...

xiangjunyangnyu