Skip to content

wlgns0330/RootFinding

 
 

Repository files navigation

YRoots

YRoots is a Python package designed for numerical rootfinding of multivariate systems of equations.

For a tutorial on YRoots syntax, set-up, and examples on how to use it with different function systems, see Combined Notebook.

Documentation is posted at https://tylerjarvis.github.io/RootFinding/

This project was supported in part by the National Science Foundation, grant number DMS-1564502.

Requirements

  • Python 3.14t (free-threaded build — see note below)
  • NumPy ≥ 2.4.4
  • Numba ≥ 0.65.1
  • SciPy ≥ 1.17.1
  • SymPy ≥ 1.12

Why 3.14t? YRoots requires the free-threaded build of Python 3.14, which runs without the Global Interpreter Lock (GIL) for better parallelism. The t suffix identifies this build — it is a different download from the standard Python 3.14.

Installation

With uv (recommended):

uv python install 3.14t
uv pip install git+https://github.com/tylerjarvis/RootFinding.git

Or clone and install for development:

git clone https://github.com/tylerjarvis/RootFinding.git
cd RootFinding
uv sync

With pip (requires Python 3.14t already installed):

pip install git+https://github.com/tylerjarvis/RootFinding.git

The package can then be imported using import yroots. (We are currently working on adding the yroots package to The Python Package Index)

Usage

#imports
import numpy as np
import yroots as yr

#define the functions -- must be smooth on the domain and vectorized
f = lambda x,y : np.sin(x*y) + x*np.log(y+3) - x**2 + 1/(y-4)
g = lambda x,y : np.cos(3*x*y) + np.exp(3*y/(x-2)) - x - 6

#define a search domain
a = np.array([-1,-2]) #lower bounds on x and y
b = np.array([0,1]) #upper bounds on x and y

#solve
yr.solve([f,g],a,b)

If the system includes polynomials, there are specialized Polynomial objects which may allow for faster solving. See Combined Notebook for more details.

Examples of Applications

Below is a list of Jupyter notebooks in which YRoots has been used to solve real-world problems:

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

About

Finding zeros of systems of multivariable functions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Jupyter Notebook 67.8%
  • Python 32.2%