Skip to content

Commit da057e7

Browse files
committed
docs: update documentation
1 parent 1b77877 commit da057e7

File tree

18 files changed

+212
-128
lines changed

18 files changed

+212
-128
lines changed

.github/workflows/Documentation.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- uses: actions/checkout@v4
1616
- uses: julia-actions/setup-julia@latest
1717
with:
18-
version: '1'
18+
version: '1.10'
1919
- name: Install dependencies
2020
run: |
2121
import Pkg

.github/workflows/Downgrade.yml

+31-4
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,42 @@ jobs:
1414
test:
1515
runs-on: ubuntu-latest
1616
strategy:
17+
fail-fast: false
1718
matrix:
18-
version: ["1.10"]
19+
version:
20+
- "1.10"
21+
group:
22+
- Core
23+
- Downstream
24+
- Misc
25+
- Wrappers
1926
steps:
2027
- uses: actions/checkout@v4
2128
- uses: julia-actions/setup-julia@v2
2229
with:
2330
version: ${{ matrix.version }}
2431
- uses: julia-actions/julia-downgrade-compat@v1
32+
- name: "Install Dependencies and Run Tests"
33+
run: |
34+
import Pkg
35+
Pkg.Registry.update()
36+
# Install packages present in subdirectories
37+
dev_pks = Pkg.PackageSpec[]
38+
for path in ("lib/SciMLJacobianOperators", "lib/BracketingNonlinearSolve", "lib/NonlinearSolveBase", "lib/SimpleNonlinearSolve")
39+
push!(dev_pks, Pkg.PackageSpec(; path))
40+
end
41+
Pkg.develop(dev_pks)
42+
Pkg.instantiate()
43+
Pkg.test(; coverage=true)
44+
shell: julia --color=yes --code-coverage=user --depwarn=yes --project=. {0}
45+
env:
46+
GROUP: ${{ matrix.group }}
47+
- uses: julia-actions/julia-processcoverage@v1
2548
with:
26-
skip: Pkg,TOML
27-
- uses: julia-actions/julia-buildpkg@v1
28-
- uses: julia-actions/julia-runtest@v1
49+
directories: src,ext,lib/SciMLJacobianOperators/src
50+
- uses: codecov/codecov-action@v4
51+
with:
52+
file: lcov.info
53+
token: ${{ secrets.CODECOV_TOKEN }}
54+
verbose: true
55+
fail_ci_if_error: true

Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ BenchmarkTools = "1.4"
6868
CUDA = "5.5"
6969
CommonSolve = "0.2.4"
7070
ConcreteStructs = "0.2.3"
71-
DiffEqBase = "6.158.3"
71+
DiffEqBase = "6.155.3"
7272
DifferentiationInterface = "0.6.1"
7373
Enzyme = "0.13.2"
7474
ExplicitImports = "1.5"

docs/Project.toml

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
33
AlgebraicMultigrid = "2169fc97-5a83-5252-b627-83903c6c433c"
44
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
55
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
6+
BracketingNonlinearSolve = "70df07ce-3d50-431d-a3e7-ca6ddb60ac1e"
67
DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e"
78
DifferentiationInterface = "a0c0ee7d-e4b9-4e03-894e-1c5f64a51d63"
89
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
@@ -11,8 +12,8 @@ DocumenterInterLinks = "d12716ef-a0f6-4df4-a9f1-a5a34e75c656"
1112
IncompleteLU = "40713840-3770-5561-ab4c-a76e7d0d7895"
1213
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
1314
LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae"
14-
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
1515
NonlinearSolve = "8913a72c-1f9b-4ce2-8d82-65094dcecaec"
16+
NonlinearSolveBase = "be0214bd-f91f-a760-ac4e-3421ce2b2da0"
1617
OrdinaryDiffEqTsit5 = "b1df2697-797e-41e3-8120-5422d3b24e4a"
1718
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
1819
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
@@ -29,16 +30,16 @@ ADTypes = "1.9.0"
2930
AlgebraicMultigrid = "0.5, 0.6"
3031
ArrayInterface = "6, 7"
3132
BenchmarkTools = "1"
32-
DiffEqBase = "6.136"
33+
BracketingNonlinearSolve = "1"
3334
DifferentiationInterface = "0.6.1"
3435
Documenter = "1"
3536
DocumenterCitations = "1"
3637
DocumenterInterLinks = "1.0.0"
3738
IncompleteLU = "0.2"
3839
InteractiveUtils = "<0.0.1, 1"
3940
LinearSolve = "2"
40-
ModelingToolkit = "9"
4141
NonlinearSolve = "4"
42+
NonlinearSolveBase = "1"
4243
OrdinaryDiffEqTsit5 = "1.1.0"
4344
Plots = "1"
4445
Random = "1.10"

docs/make.jl

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
using Documenter, DocumenterCitations, DocumenterInterLinks
22
using NonlinearSolve, SimpleNonlinearSolve, Sundials, SteadyStateDiffEq, SciMLBase,
3-
DiffEqBase
3+
BracketingNonlinearSolve, NonlinearSolveBase
44
using SciMLJacobianOperators
5+
import DiffEqBase
56

67
cp(joinpath(@__DIR__, "Manifest.toml"),
78
joinpath(@__DIR__, "src/assets/Manifest.toml"), force = true)
@@ -20,8 +21,9 @@ interlinks = InterLinks(
2021
makedocs(;
2122
sitename = "NonlinearSolve.jl",
2223
authors = "Chris Rackauckas",
23-
modules = [NonlinearSolve, SimpleNonlinearSolve, SteadyStateDiffEq,
24-
Sundials, DiffEqBase, SciMLBase, SciMLJacobianOperators],
24+
modules = [NonlinearSolve, SimpleNonlinearSolve, SteadyStateDiffEq, DiffEqBase,
25+
Sundials, NonlinearSolveBase, SciMLBase, SciMLJacobianOperators,
26+
BracketingNonlinearSolve],
2527
clean = true,
2628
doctest = false,
2729
linkcheck = true,

docs/pages.jl

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Put in a separate page so it can be used by SciMLDocs.jl
22

3-
pages = ["index.md",
3+
pages = [
4+
"index.md",
45
"Getting Started with Nonlinear Rootfinding in Julia" => "tutorials/getting_started.md",
56
"Tutorials" => Any[
67
"tutorials/code_optimization.md",
@@ -31,6 +32,7 @@ pages = ["index.md",
3132
"Native Functionalities" => Any[
3233
"native/solvers.md",
3334
"native/simplenonlinearsolve.md",
35+
"native/bracketingnonlinearsolve.md",
3436
"native/steadystatediffeq.md",
3537
"native/descent.md",
3638
"native/globalization.md",

docs/src/basics/diagnostics_api.md

+8-12
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,16 @@ Note that you will have to restart Julia to disable the timer outputs once enabl
2727
## Example Usage
2828

2929
```@example diagnostics_example
30-
using ModelingToolkit, NonlinearSolve
30+
using NonlinearSolve
3131
32-
@variables x y z
33-
@parameters σ ρ β
32+
function nlfunc(resid, u0, p)
33+
resid[1] = u0[1] * u0[1] - p
34+
resid[2] = u0[2] * u0[2] - p
35+
resid[3] = u0[3] * u0[3] - p
36+
nothing
37+
end
3438
35-
# Define a nonlinear system
36-
eqs = [0 ~ σ * (y - x), 0 ~ x * (ρ - z) - y, 0 ~ x * y - β * z]
37-
@mtkbuild ns = NonlinearSystem(eqs, [x, y, z], [σ, ρ, β])
38-
39-
u0 = [x => 1.0, y => 0.0, z => 0.0]
40-
41-
ps = [σ => 10.0 ρ => 26.0 β => 8 / 3]
42-
43-
prob = NonlinearProblem(ns, u0, ps)
39+
prob = NonlinearProblem(nlfunc, [1.0, 3.0, 5.0], 2.0)
4440
4541
solve(prob)
4642
```

docs/src/basics/solve.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# [Common Solver Options (Solve Keyword Arguments)](@id solver_options)
22

33
```@docs
4-
solve(prob::SciMLBase.NonlinearProblem, args...; kwargs...)
4+
solve(::NonlinearProblem, args...; kwargs...)
55
```
66

77
## General Controls

docs/src/basics/termination_condition.md

+14-8
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,23 @@ terminated = cache(du, u, uprev)
2323
### Absolute Tolerance
2424

2525
```@docs
26-
AbsTerminationMode
27-
AbsNormTerminationMode
28-
AbsNormSafeTerminationMode
29-
AbsNormSafeBestTerminationMode
26+
NonlinearSolveBase.AbsTerminationMode
27+
NonlinearSolveBase.AbsNormTerminationMode
28+
NonlinearSolveBase.AbsNormSafeTerminationMode
29+
NonlinearSolveBase.AbsNormSafeBestTerminationMode
3030
```
3131

3232
### Relative Tolerance
3333

3434
```@docs
35-
RelTerminationMode
36-
RelNormTerminationMode
37-
RelNormSafeTerminationMode
38-
RelNormSafeBestTerminationMode
35+
NonlinearSolveBase.RelTerminationMode
36+
NonlinearSolveBase.RelNormTerminationMode
37+
NonlinearSolveBase.RelNormSafeTerminationMode
38+
NonlinearSolveBase.RelNormSafeBestTerminationMode
39+
```
40+
41+
### Both Tolerances
42+
43+
```@docs
44+
NonlinearSolveBase.NormTerminationMode
3945
```

docs/src/devdocs/algorithm_helpers.md

-3
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@ NonlinearSolve.GenericTrustRegionScheme
6060
## Miscellaneous
6161

6262
```@docs
63-
SimpleNonlinearSolve.__nextfloat_tdir
64-
SimpleNonlinearSolve.__prevfloat_tdir
65-
SimpleNonlinearSolve.__max_tdir
6663
NonlinearSolve.callback_into_cache!
6764
NonlinearSolve.concrete_jac
6865
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# BracketingNonlinearSolve.jl
2+
3+
These methods can be used independently of the rest of NonlinearSolve.jl
4+
5+
```@index
6+
Pages = ["bracketingnonlinearsolve.md"]
7+
```
8+
9+
## Interval Methods
10+
11+
These methods are suited for interval (scalar) root-finding problems,
12+
i.e. [`IntervalNonlinearProblem`](@ref).
13+
14+
```@docs
15+
ITP
16+
Alefeld
17+
Bisection
18+
Falsi
19+
Ridder
20+
Brent
21+
```

docs/src/native/simplenonlinearsolve.md

+1-15
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,6 @@ These methods can be used independently of the rest of NonlinearSolve.jl
66
Pages = ["simplenonlinearsolve.md"]
77
```
88

9-
## Interval Methods
10-
11-
These methods are suited for interval (scalar) root-finding problems,
12-
i.e. `IntervalNonlinearProblem`.
13-
14-
```@docs
15-
ITP
16-
Alefeld
17-
Bisection
18-
Falsi
19-
Ridder
20-
Brent
21-
```
22-
239
## General Methods
2410

2511
These methods are suited for any general nonlinear root-finding problem, i.e.
@@ -54,6 +40,6 @@ Squares problems.
5440
[^1]: Needs [`StaticArrays.jl`](https://github.com/JuliaArrays/StaticArrays.jl) to be
5541
installed and loaded for the non-allocating version.
5642
[^2]: This method is non-allocating if the termination condition is set to either `nothing`
57-
(default) or [`AbsNormTerminationMode`](@ref).
43+
(default) or [`NonlinearSolveBase.AbsNormTerminationMode`](@ref).
5844
[^3]: Only the defaults are guaranteed to work inside kernels. We try to provide warnings
5945
if the used version is not non-allocating.

docs/src/tutorials/modelingtoolkit.md

+14-14
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ modeling system for the Julia SciML ecosystem. It adds a high-level interactive
55
for the numerical solvers which can make it easy to symbolically modify and generate
66
equations to be solved. The basic form of using ModelingToolkit looks as follows:
77

8-
```@example mtk
8+
```julia
99
using ModelingToolkit, NonlinearSolve
1010

1111
@variables x y z
@@ -30,20 +30,20 @@ sol = solve(prob, NewtonRaphson())
3030
As a symbolic system, ModelingToolkit can be used to represent the equations and derive new
3131
forms. For example, let's look at the equations:
3232

33-
```@example mtk
33+
```julia
3434
equations(ns)
3535
```
3636

3737
We can ask it what the Jacobian of our system is via `calculate_jacobian`:
3838

39-
```@example mtk
39+
```julia
4040
calculate_jacobian(ns)
4141
```
4242

4343
We can tell MTK to generate a computable form of this analytical Jacobian via `jac = true`
4444
to help the solver use efficient forms:
4545

46-
```@example mtk
46+
```julia
4747
prob = NonlinearProblem(ns, u0, ps, jac = true)
4848
sol = solve(prob, NewtonRaphson())
4949
```
@@ -54,7 +54,7 @@ One of the major reasons for using ModelingToolkit is to allow structural simpli
5454
the systems. It's very easy to write down a mathematical model that, in theory, could be
5555
solved more simply. Let's take a look at a quick system:
5656

57-
```@example mtk
57+
```julia
5858
@variables u1 u2 u3 u4 u5
5959
eqs = [0 ~ u1 - sin(u5), 0 ~ u2 - cos(u1), 0 ~ u3 - hypot(u1, u2),
6060
0 ~ u4 - hypot(u2, u3), 0 ~ u5 - hypot(u4, u1)]
@@ -63,47 +63,47 @@ eqs = [0 ~ u1 - sin(u5), 0 ~ u2 - cos(u1), 0 ~ u3 - hypot(u1, u2),
6363

6464
If we run structural simplification, we receive the following form:
6565

66-
```@example mtk
66+
```julia
6767
sys = structural_simplify(sys)
6868
```
6969

70-
```@example mtk
70+
```julia
7171
equations(sys)
7272
```
7373

7474
How did it do this? Let's look at the `observed` to see the relationships that it found:
7575

76-
```@example mtk
76+
```julia
7777
observed(sys)
7878
```
7979

8080
Using ModelingToolkit, we can build and solve the simplified system:
8181

82-
```@example mtk
82+
```julia
8383
u0 = [u5 .=> 1.0]
8484
prob = NonlinearProblem(sys, u0)
8585
sol = solve(prob, NewtonRaphson())
8686
```
8787

8888
We can then use symbolic indexing to retrieve any variable:
8989

90-
```@example mtk
90+
```julia
9191
sol[u1]
9292
```
9393

94-
```@example mtk
94+
```julia
9595
sol[u2]
9696
```
9797

98-
```@example mtk
98+
```julia
9999
sol[u3]
100100
```
101101

102-
```@example mtk
102+
```julia
103103
sol[u4]
104104
```
105105

106-
```@example mtk
106+
```julia
107107
sol[u5]
108108
```
109109

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# BracketingNonlinearSolve.jl
2+
3+
Fast implementations of interval root finding algorithms in Julia that satisfy the SciML
4+
common interface. BracketingNonlinearSolve.jl focuses on low-dependency implementations of
5+
very fast methods for very small and simple problems. For the full set of solvers, see
6+
[NonlinearSolve.jl](https://github.com/SciML/NonlinearSolve.jl), of which
7+
BracketingNonlinearSolve.jl is just one solver set.
8+
9+
For information on using the package,
10+
[see the stable documentation](https://docs.sciml.ai/NonlinearSolve/stable/). Use the
11+
[in-development documentation](https://docs.sciml.ai/NonlinearSolve/dev/) for the version of
12+
the documentation which contains the unreleased features.
13+
14+
## High Level Examples
15+
16+
```julia
17+
using BracketingNonlinearSolve
18+
19+
f(u, p) = u .* u .- 2.0
20+
u0 = (1.0, 2.0) # brackets
21+
probB = IntervalNonlinearProblem(f, u0)
22+
sol = solve(probB, ITP())
23+
```

0 commit comments

Comments
 (0)