Skip to content
Merged
4 changes: 4 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ DocumenterInterLinks = "d12716ef-a0f6-4df4-a9f1-a5a34e75c656"
IncompleteLU = "40713840-3770-5561-ab4c-a76e7d0d7895"
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae"
LineSearch = "87fe0de2-c867-4266-b59a-2f0a94fc965b"
NonlinearSolve = "8913a72c-1f9b-4ce2-8d82-65094dcecaec"
NonlinearSolveBase = "be0214bd-f91f-a760-ac4e-3421ce2b2da0"
NonlinearSolveFirstOrder = "5959db7a-ea39-4486-b5fe-2dd0bf03d60d"
NonlinearSolveHomotopyContinuation = "2ac3b008-d579-4536-8c91-a1a5998c2f8b"
NonlinearSolveQuasiNewton = "9a2c21bd-3a47-402d-9113-8faf9a0ee114"
NonlinearSolveSciPy = "4827a3aa-8a82-4c61-8bd0-3c7d3e464ee5"
NonlinearSolveSpectralMethods = "26075421-4e9a-44e1-8bd1-420ed7ad02b2"
OrdinaryDiffEqTsit5 = "b1df2697-797e-41e3-8120-5422d3b24e4a"
PETSc = "ace2c81b-2b5f-4b1e-a30d-d662738edfe0"
Expand Down Expand Up @@ -44,11 +46,13 @@ DocumenterInterLinks = "1.0.0"
IncompleteLU = "0.2"
InteractiveUtils = "<0.0.1, 1"
LinearSolve = "2, 3"
LineSearch = "0.1"
NonlinearSolve = "4"
NonlinearSolveBase = "1"
NonlinearSolveFirstOrder = "1"
NonlinearSolveHomotopyContinuation = "0.1"
NonlinearSolveQuasiNewton = "1"
NonlinearSolveSciPy = "1"
NonlinearSolveSpectralMethods = "1"
OrdinaryDiffEqTsit5 = "1.1.0"
PETSc = "0.3"
Expand Down
8 changes: 4 additions & 4 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ using Sundials
using NonlinearSolveBase, SciMLBase, DiffEqBase
using SimpleNonlinearSolve, BracketingNonlinearSolve
using NonlinearSolveFirstOrder, NonlinearSolveQuasiNewton, NonlinearSolveSpectralMethods
using NonlinearSolveHomotopyContinuation
using SciMLJacobianOperators
using NonlinearSolveHomotopyContinuation, NonlinearSolveSciPy
using SciMLJacobianOperators, LineSearch
using NonlinearSolve, SteadyStateDiffEq

cp(
Expand Down Expand Up @@ -37,8 +37,8 @@ makedocs(;
SimpleNonlinearSolve, BracketingNonlinearSolve,
NonlinearSolveFirstOrder, NonlinearSolveQuasiNewton, NonlinearSolveSpectralMethods,
NonlinearSolveHomotopyContinuation,
Sundials,
SciMLJacobianOperators,
Sundials, LineSearch,
SciMLJacobianOperators, NonlinearSolveSciPy,
NonlinearSolve, SteadyStateDiffEq
],
clean = true,
Expand Down
1 change: 1 addition & 0 deletions docs/pages.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ pages = [
"api/nlsolve.md",
"api/nlsolvers.md",
"api/petsc.md",
"api/scipy.md",
"api/siamfanlequations.md",
"api/speedmapping.md",
"api/sundials.md",
Expand Down
2 changes: 1 addition & 1 deletion docs/src/api/SciMLJacobianOperators.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ operator built on top on DifferentiationInterface.jl.
```julia
import Pkg
Pkg.add("SciMLJacobianOperators")
using SciMLJacobianOperators
import SciMLJacobianOperators
```

## Jacobian API
Expand Down
5 changes: 3 additions & 2 deletions docs/src/api/fastlevenbergmarquardt.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ interface. Note that these solvers do not come by default, and thus one needs to
the package before using these solvers:

```julia
using Pkg
import Pkg
Pkg.add("FastLevenbergMarquardt")
using FastLevenbergMarquardt, NonlinearSolve
import FastLevenbergMarquardt
import NonlinearSolve as NLS
```

## Solver API
Expand Down
5 changes: 3 additions & 2 deletions docs/src/api/fixedpointacceleration.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ interface. Note that these solvers do not come by default, and thus one needs to
the package before using these solvers:

```julia
using Pkg
import Pkg
Pkg.add("FixedPointAcceleration")
using FixedPointAcceleration, NonlinearSolve
import FixedPointAcceleration
import NonlinearSolve as NLS
```

## Solver API
Expand Down
5 changes: 3 additions & 2 deletions docs/src/api/homotopycontinuation.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ HomotopyContinuation.jl. This solver is not included by default and needs
to be installed separately:

```julia
using Pkg
import Pkg
Pkg.add("NonlinearSolveHomotopyContinuation")
using NonlinearSolveHomotopyContinuation, NonlinearSolve
import NonlinearSolveHomotopyContinuation
import NonlinearSolve as NLS
```

# Solver API
Expand Down
5 changes: 3 additions & 2 deletions docs/src/api/leastsquaresoptim.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ interface. Note that these solvers do not come by default, and thus one needs to
the package before using these solvers:

```julia
using Pkg
import Pkg
Pkg.add("LeastSquaresOptim")
using LeastSquaresOptim, NonlinearSolve
import LeastSquaresOptim
import NonlinearSolve as NLS
```

## Solver API
Expand Down
5 changes: 3 additions & 2 deletions docs/src/api/minpack.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ these solvers do not come by default, and thus one needs to install the package
these solvers:

```julia
using Pkg
import Pkg
Pkg.add("MINPACK")
using MINPACK, NonlinearSolve
import MINPACK
import NonlinearSolve as NLS
```

## Solver API
Expand Down
5 changes: 3 additions & 2 deletions docs/src/api/nlsolve.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ that these solvers do not come by default, and thus one needs to install the pac
using these solvers:

```julia
using Pkg
import Pkg
Pkg.add("NLsolve")
using NLsolve, NonlinearSolve
import NLsolve
import NonlinearSolve as NLS
```

## Solver API
Expand Down
5 changes: 3 additions & 2 deletions docs/src/api/nlsolvers.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ that these solvers do not come by default, and thus one needs to install the pac
using these solvers:

```julia
using Pkg
import Pkg
Pkg.add("NLSolvers")
using NLSolvers, NonlinearSolve
import NLSolvers
import NonlinearSolve as NLS
```

## Solver API
Expand Down
5 changes: 3 additions & 2 deletions docs/src/api/petsc.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ that these solvers do not come by default, and thus one needs to install the pac
using these solvers:

```julia
using Pkg
import Pkg
Pkg.add("PETSc")
using PETSc, NonlinearSolve
import PETSc
import NonlinearSolve as NLS
```

## Solver API
Expand Down
25 changes: 25 additions & 0 deletions docs/src/api/scipy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# SciPy

This is an extension for importing solvers from
[SciPy](https://scipy.org/) into the SciML
interface. Note that these solvers do not come by default, and thus one needs to install
the package before using these solvers:

```julia
import Pkg
Pkg.add("NonlinearSolveSciPy")
import NonlinearSolveSciPy as NLSP
```

Note that using this package requires Python and SciPy to be available via PythonCall.jl.

## Solver API

```@docs
NonlinearSolveSciPy.SciPyLeastSquares
NonlinearSolveSciPy.SciPyLeastSquaresTRF
NonlinearSolveSciPy.SciPyLeastSquaresDogbox
NonlinearSolveSciPy.SciPyLeastSquaresLM
NonlinearSolveSciPy.SciPyRoot
NonlinearSolveSciPy.SciPyRootScalar
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
```
```

5 changes: 3 additions & 2 deletions docs/src/api/siamfanlequations.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ interface. Note that these solvers do not come by default, and thus one needs to
the package before using these solvers:

```julia
using Pkg
import Pkg
Pkg.add("SIAMFANLEquations")
using SIAMFANLEquations, NonlinearSolve
import SIAMFANLEquations
import NonlinearSolve as NLS
```

## Solver API
Expand Down
5 changes: 3 additions & 2 deletions docs/src/api/speedmapping.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ interface. Note that these solvers do not come by default, and thus one needs to
the package before using these solvers:

```julia
using Pkg
import Pkg
Pkg.add("SpeedMapping")
using SpeedMapping, NonlinearSolve
import SpeedMapping
import NonlinearSolve as NLS
```

## Solver API
Expand Down
4 changes: 2 additions & 2 deletions docs/src/api/sundials.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ Note that these solvers do not come by default, and thus one needs to install th
before using these solvers:

```julia
using Pkg
import Pkg
Pkg.add("Sundials")
using Sundials
import Sundials
```

These methods can be used independently of the rest of NonlinearSolve.jl.
Expand Down
18 changes: 9 additions & 9 deletions docs/src/basics/diagnostics_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Note that you will have to restart Julia to disable the timer outputs once enabl
## Example Usage

```@example diagnostics_example
using NonlinearSolve
import NonlinearSolve as NLS

function nlfunc(resid, u0, p)
resid[1] = u0[1] * u0[1] - p
Expand All @@ -36,23 +36,23 @@ function nlfunc(resid, u0, p)
nothing
end

prob = NonlinearProblem(nlfunc, [1.0, 3.0, 5.0], 2.0)
prob = NLS.NonlinearProblem(nlfunc, [1.0, 3.0, 5.0], 2.0)

solve(prob)
NLS.solve(prob)
```

This produced the output, but it is hard to diagnose what is going on. We can turn on
the trace to see what is happening:

```@example diagnostics_example
solve(prob; show_trace = Val(true), trace_level = TraceAll(10))
NLS.solve(prob; show_trace = Val(true), trace_level = NLS.TraceAll(10))
nothing; # hide
```

You can also store the trace in the solution object:

```@example diagnostics_example
sol = solve(prob; trace_level = TraceAll(), store_trace = Val(true));
sol = NLS.solve(prob; trace_level = NLS.TraceAll(), store_trace = Val(true));

sol.trace
```
Expand All @@ -62,16 +62,16 @@ to use the `init` and `solve!` API for this. The `TimerOutput` will be present i
`cache.timer`. However, note that for poly-algorithms this is currently not implemented.

```@example diagnostics_example
cache = init(prob, NewtonRaphson(); show_trace = Val(true));
solve!(cache)
cache = NLS.init(prob, NLS.NewtonRaphson(); show_trace = Val(true));
NLS.solve!(cache)
cache.timer
```

Let's try for some other solver:

```@example diagnostics_example
cache = init(prob, DFSane(); show_trace = Val(true), trace_level = TraceMinimal(50));
solve!(cache)
cache = NLS.init(prob, NLS.DFSane(); show_trace = Val(true), trace_level = NLS.TraceMinimal(50));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
cache = NLS.init(prob, NLS.DFSane(); show_trace = Val(true), trace_level = NLS.TraceMinimal(50));
cache = NLS.init(
prob, NLS.DFSane(); show_trace = Val(true), trace_level = NLS.TraceMinimal(50));

NLS.solve!(cache)
cache.timer
```

Expand Down
Loading
Loading