Posts

Showing posts with the label numerical method

Numerical Methods in Python : Regula-Falsi Method

The Regula-Falsi method is another one of the bracketing methods for finding roots of equations. This method is based on linear interpolation. The logic is very similar to the bisection method  with the difference only in the finding of the middle point. In bisection method, the point in the exact middle is chosen whereas in regula-falsi method, the point where the line joining (a,f(a)) and (b,f(b)) and the x-axis intersects is chosen. Apart from this the rest of the algorithm is similar to that of the bisection method. Here's my python code :

Numerical Methods in Python : Bisection Method

This semester, I have Computational Lab as one of my practical subjects. While the subject itself is quite interesting, the programming environment being used in the lab is Turbo C, a DOS based IDE which has been  abandoned a long time ago. It doesn't even run natively on modern operating systems and requires a DOS emulator called DOSBox to run. This makes it very irritating to use due to the poor mouse support. While its true that the academic world can never catch up with the industry, falling behind by such amounts is nothing but a shame. When beginner-friendly yet powerful modern languages such as Python  are available, why stick to the ages old Turbo C? So I've decided to rewrite the programs I do in the lab in Python 2.7. This would serve me in two ways, it would help me understand the algorithm better while also improving my python coding skills. The first one would be the Bisection Method Bisection Method to find the roots of a non linear equation. This method...