root_finder
Implicit methods require solving systems of equations. This module provides an interface (wrapper) for such solvers.
RootFinder
Bases: ABC
An interface for root-finders used to solve systems in implicit methods.
Source code in src/odeiter/root_finder.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | |
solve(func, u0)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
func
|
Callable[[ndarray[float]], ndarray[float]]
|
A function |
required |
u0
|
ndarray[float]
|
An approximate solution to |
required |
Returns:
| Type | Description |
|---|---|
ndarray[float]
|
The solution |
Raises:
| Type | Description |
|---|---|
ValueError
|
The solver fails to find a solution. |
Source code in src/odeiter/root_finder.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | |
DefaultRootFinder
Bases: RootFinder
A wrapper for scipy.optimize.root.
Source code in src/odeiter/root_finder.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 | |