Python Code for Mastering Root Finding using Newton-Raphson and Beyond!

Опубликовано: 30 Март 2025
на канале: FinLog
32
1

This video is about using Python to solve Single Non Linear Equations using Newton-Raphson method and SymPy which is a Python library for Symbolic Mathematics. SymPy uses algebraic methods to find exact solutions unlike Newton Raphson method which relies on approximations due to its iterative nature.
I try to explain the code as I do it in the video.
Four Python codes have been explained in this video.
Link to Newton Raphson Method Explanation with Examples    • Newton Raphson Method Explanation & Exampl...  
Link to codes https://github.com/Kratosfury/Python-Codes...
Hope you find it useful.
Any questions, let me know.
Cheers

Timestamps
00:00 Intro
01:06 1st Python code using Newton Raphson (NR)
01:12 Cubic Equation
01:41 Key Steps for the Python Code
02:30 Defining Function and its Derivative
05:17 Zero Derivative Check
06:26 Coding Newton Raphson Formula
08:16 Initial Guess
08:35 Calling Newton Raphson Function in code
10:37 Errors in 1st Code
11:55 Result of 1st Python Code
12:36 Changing initial guess to get rest of the roots
14:21 2nd Python Code using NR to find all the Roots
15:09 For Loop for multiple Root Finding
18:27 List of Initial Guesses
21:01 Errors in 2nd Code
21:30 Result of 2nd Python Code
22:52 Sympy – Python Library
24:06 3rd Python code using Sympy
26:10 Separating Imaginary parts from Real parts of the Root
28:23 Errors in 3rd Code
28:46 Result of 3rd Python Code
29:58 Using Equation with Imaginary roots
30:54 Errors in 3rd Code
31:06 Result of 3rd Python Code
31:57 Plotting Graph – 4th Python Code
36:49 Converting Symbolic Equation to Numerical Equation
41:36 Errors in 4th Code
42:16 Result of 4th Code – 1 Real root shown
43:29 Using Equation with only Real roots
43:49 Result of 4th Code – 3 Roots shown
00:44 Outro