Skip to content

matthewkayne/newton-raphson-method

Repository files navigation

Gray shape shifter

The Newton Raphson Method

CodeFactor

Solves a functions root using the Newton-Raphson method. It requires three parameters, the function, the x₀ value, and the number of iterations.

⚡️ Interactive Graph

This is an application that allows you to input aa function, x₀ value and number of iterations into a UI and see it graphed and solved.

image

Run interactive__graph.py to see the graphical visualisation of the method

📈 Real Time Graph Function

This shows the real time lines being drawn when solving using the Newton-Raphson method

image

Run newton_raphson_graph.py to see the graphical visualisation of the method

🧠 Use The Base Function

To use the function, start by importing the function and sympy:

from sympy import *
from newton_raphson import nr

Then setup your x symbol:

x = Symbol('x')

Finally call the Newton-Raphson function

nr((x**3 + 2*x - 2)), 1, 3)

See newton_raphson.py for the base function

About

Solves a functions root using the Newton-Raphson method

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages