Skip to content

This program computes the approximated solution of a given equation in the form f(x)=0 and an initial solution using Newton's method.

Notifications You must be signed in to change notification settings

joserodriguez16/newtonmethod

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Description

This is a python program that enforces the Newton's method algorithm.

What is the Newton's method?

-Newton's method is a root-finding algorithm which produces approximations to the roots of a mathematical function in the form p(x) = 0.

How does it work?

-The algorithm requires an approximation which then will be used to compute a better root of the function. to start finding the roots using Newton's method, the given approximation is evaluated at the function, then the evaluation divided by the derivative of the function is subtracted from the given approximation.

For example:

x1 = x0 - f(x0)/f'(x0) x2 = x1 - f(x1)/f'(x1) xn = (xn-1) - f(xn-1)/f'(xn-1) xn+1 = xn - f(xn)/f'(xn)

where x0 is the given approximation require by the algorithm.

Instruction to run the program

-The program consists in two parts. A python class that finds the derivative of a polynomial function and evaluates a function given a number. The other part is the actual program that computes the Newton's method algorithm.

-To use the program run Finalproject.py and choose the input type:

Keyboard: Use the keyboard to enter your input.

File: Use a file that contains the information needed to compute the algorithm.

About

This program computes the approximated solution of a given equation in the form f(x)=0 and an initial solution using Newton's method.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages