Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
13 views
1 page
Rapson
Uploaded by
ssnehraje
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
Download
Save
Save Rapson For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
0 ratings
0% found this document useful (0 votes)
13 views
1 page
Rapson
Uploaded by
ssnehraje
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
Carousel Previous
Carousel Next
Download
Save
Save Rapson For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
Download
Save Rapson For Later
You are on page 1
/ 1
Search
Fullscreen
Rapson
# Implementing the Newton-Raphson method to solve the equation x^4 + x^2 - 80 = 0
# Define the function and its derivative
from sympy import symbols, diff
x = symbols('x')
f = x**4 + x**2 - 80 # Function
f_prime = diff(f, x) # Derivative of the function
# Convert to Python functions
from sympy.utilities.lambdify import lambdify
f_func = lambdify(x, f, 'numpy')
f_prime_func = lambdify(x, f_prime, 'numpy')
# Newton-Raphson method implementation
def newton_raphson(f, f_prime, initial_guess, tolerance=1e-3, max_iterations=100):
x_current = initial_guess
for _ in range(max_iterations):
f_value = f(x_current)
f_prime_value = f_prime(x_current)
if f_prime_value == 0: # Avoid division by zero
raise ValueError("Derivative is zero. No solution found.")
x_next = x_current - f_value / f_prime_value
if abs(x_next - x_current) < tolerance:
return round(x_next, 3) # Root correct to 3 decimal places
x_current = x_next
raise ValueError("Maximum iterations reached. No solution found.")
# Start with an initial guess (e.g., x = 3, since the root seems positive)
initial_guess = 3
root = newton_raphson(f_func, f_prime_func, initial_guess)
root
You might also like
Maths LAB Programs BMATS201
PDF
No ratings yet
Maths LAB Programs BMATS201
10 pages
Numerical Analysis
PDF
No ratings yet
Numerical Analysis
12 pages
Nme Lab Assign4 Group 6
PDF
No ratings yet
Nme Lab Assign4 Group 6
34 pages
Adv Math Prog
PDF
No ratings yet
Adv Math Prog
30 pages
Merged Document
PDF
No ratings yet
Merged Document
49 pages
m2 Math Lab
PDF
No ratings yet
m2 Math Lab
32 pages
Computer Assignment
PDF
No ratings yet
Computer Assignment
12 pages
A43 Maths Ass9
PDF
No ratings yet
A43 Maths Ass9
12 pages
Lap Report On Newton Raphson Method
PDF
100% (1)
Lap Report On Newton Raphson Method
9 pages
1 II-II Mech R20 Python Programming Lab
PDF
100% (1)
1 II-II Mech R20 Python Programming Lab
30 pages
19 Newton-Raphson Iteration
PDF
No ratings yet
19 Newton-Raphson Iteration
22 pages
Lec 4newton Raphson
PDF
No ratings yet
Lec 4newton Raphson
31 pages
Laboratory Exercise #4 Newton-Raphson Method
PDF
No ratings yet
Laboratory Exercise #4 Newton-Raphson Method
10 pages
Code
PDF
No ratings yet
Code
32 pages
Newton's Method Matlab
PDF
No ratings yet
Newton's Method Matlab
4 pages
Newton Mahmud
PDF
No ratings yet
Newton Mahmud
5 pages
HW MN 2 Petcov Nicolai
PDF
No ratings yet
HW MN 2 Petcov Nicolai
6 pages
Experiment 1
PDF
No ratings yet
Experiment 1
5 pages
1.to Find The Roots of Non-Linear Equation Using Newton Raphson's Method
PDF
No ratings yet
1.to Find The Roots of Non-Linear Equation Using Newton Raphson's Method
2 pages
Slip 21
PDF
No ratings yet
Slip 21
3 pages
Lab 4
PDF
No ratings yet
Lab 4
6 pages
Summary - Python Numerical Methods
PDF
No ratings yet
Summary - Python Numerical Methods
2 pages
LAB 4 - Jupyter Notebook
PDF
No ratings yet
LAB 4 - Jupyter Notebook
6 pages
LAB5.ipynb - Colab
PDF
No ratings yet
LAB5.ipynb - Colab
3 pages
Chako Sir Lab Practical Program
PDF
No ratings yet
Chako Sir Lab Practical Program
8 pages
Ayush 1
PDF
No ratings yet
Ayush 1
1 page
Algorithm:: Experiment No: 03 Experiment Name: Write A Program Implementation of Aim
PDF
No ratings yet
Algorithm:: Experiment No: 03 Experiment Name: Write A Program Implementation of Aim
3 pages
Mathematics Lab
PDF
No ratings yet
Mathematics Lab
6 pages
Newton-Raphson Method - Python Numerical Methods
PDF
No ratings yet
Newton-Raphson Method - Python Numerical Methods
2 pages
NR Matlab Cod PDF
PDF
No ratings yet
NR Matlab Cod PDF
4 pages
EAlab Codes
PDF
No ratings yet
EAlab Codes
6 pages
Newton Raphson Program
PDF
No ratings yet
Newton Raphson Program
1 page
Lab Programs
PDF
No ratings yet
Lab Programs
4 pages
07.4 Newton Raphson Method
PDF
No ratings yet
07.4 Newton Raphson Method
3 pages
Newtonraphson Matlab
PDF
No ratings yet
Newtonraphson Matlab
1 page
07.4 Newton Raphson Method
PDF
No ratings yet
07.4 Newton Raphson Method
3 pages
Newton-Raphson Method: Chemical Engineering Majors Authors: Autar Kaw, Jai Paul
PDF
No ratings yet
Newton-Raphson Method: Chemical Engineering Majors Authors: Autar Kaw, Jai Paul
25 pages
Haseeb Lab05 PSA
PDF
No ratings yet
Haseeb Lab05 PSA
6 pages
Python Codes For Root Finding
PDF
No ratings yet
Python Codes For Root Finding
4 pages
3080project2 Loops
PDF
No ratings yet
3080project2 Loops
6 pages
Python Cheat Sheet
PDF
No ratings yet
Python Cheat Sheet
2 pages
Python Exp3-Semester7.ipynb - Colab
PDF
No ratings yet
Python Exp3-Semester7.ipynb - Colab
2 pages
Lab07 Newton Raphson Method
PDF
No ratings yet
Lab07 Newton Raphson Method
5 pages
Proj
PDF
No ratings yet
Proj
3 pages
New Raphson
PDF
No ratings yet
New Raphson
2 pages
Newton Raphson Method (Gwasunda 2232292) .Ipynb - Colab - PDF - 20250103 - 085153 - 0000
PDF
No ratings yet
Newton Raphson Method (Gwasunda 2232292) .Ipynb - Colab - PDF - 20250103 - 085153 - 0000
2 pages
Newton
PDF
No ratings yet
Newton
2 pages
Ex 2 Code
PDF
No ratings yet
Ex 2 Code
4 pages
D and S Lab Report (170103050)
PDF
No ratings yet
D and S Lab Report (170103050)
7 pages
MATLAB Code For NumericalA
PDF
No ratings yet
MATLAB Code For NumericalA
6 pages
Assignment 4
PDF
No ratings yet
Assignment 4
2 pages
Newton-Raphson Method of Solving A Nonlinear Equation: Department of Computer Science 2010
PDF
No ratings yet
Newton-Raphson Method of Solving A Nonlinear Equation: Department of Computer Science 2010
3 pages
Task 3.3.2
PDF
No ratings yet
Task 3.3.2
5 pages
Newton Rapsin
PDF
No ratings yet
Newton Rapsin
2 pages
MAT 120 Assignment
PDF
No ratings yet
MAT 120 Assignment
2 pages
Numerical Method
PDF
No ratings yet
Numerical Method
18 pages
Newton Raphson Approximation On Python
PDF
No ratings yet
Newton Raphson Approximation On Python
6 pages
Maths Lab Notes Kishan
PDF
No ratings yet
Maths Lab Notes Kishan
2 pages
Approximating Roots and Optimizing Solutions Using Numerical Methods
PDF
No ratings yet
Approximating Roots and Optimizing Solutions Using Numerical Methods
5 pages
A Brief Introduction to MATLAB: Taken From the Book "MATLAB for Beginners: A Gentle Approach"
From Everand
A Brief Introduction to MATLAB: Taken From the Book "MATLAB for Beginners: A Gentle Approach"
Peter Kattan
2.5/5 (2)