Skip to content

Commit

Permalink
strict docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnoStrouwen committed Nov 26, 2022
1 parent 78ab622 commit aa7945a
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ docs/site/
# It records a fixed state of all packages used by the project. As such, it should not be
# committed for packages, but should be committed for applications that require a static
# environment.
Manifest.toml
Manifest.toml
docs/src/assets/Project.toml
1 change: 1 addition & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[deps]
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
NonlinearSolve = "8913a72c-1f9b-4ce2-8d82-65094dcecaec"

Expand Down
11 changes: 9 additions & 2 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,15 @@ makedocs(sitename = "NonlinearSolve.jl",
authors = "Chris Rackauckas",
modules = [NonlinearSolve, NonlinearSolve.SciMLBase],
clean = true, doctest = false,
format = Documenter.HTML(analytics = "UA-90474609-3",
assets = ["assets/favicon.ico"],
strict = [
:doctest,
:linkcheck,
:parse_error,
:example_block,
# Other available options are
# :autodocs_block, :cross_references, :docs_block, :eval_block, :example_block, :footnote, :meta_block, :missing_docs, :setup_block
],
format = Documenter.HTML(assets = ["assets/favicon.ico"],
canonical = "https://docs.sciml.ai/NonlinearSolve/stable/"),
pages = pages)

Expand Down
4 changes: 2 additions & 2 deletions docs/src/basics/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
This is addressed in a [Twitter thread with the author of the improved fzero](https://twitter.com/ChrisRackauckas/status/1544743542094020615).
On the test example:

```julia
```@example
using NonlinearSolve, BenchmarkTools
N = 100_000;
Expand All @@ -22,7 +22,7 @@ end
function f2(out, levels, u0)
for i in 1:N
out[i] = solve(IntervalNonlinearProblem{false}(IntervalNonlinearFunction{false}(myfun),
out[i] = solve(NonlinearProblem{false}(IntervalNonlinearFunction{false}(myfun),
u0, levels[i]), SimpleNewtonRaphson()).u
end
end
Expand Down
5 changes: 3 additions & 2 deletions docs/src/tutorials/iterator_interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

There is an iterator form of the nonlinear solver which mirrors the DiffEq integrator interface:

```julia
```@example
using NonlinearSolve
f(u, p) = u .* u .- 2.0
u0 = 1.5 # brackets
u0 = 1.5
probB = NonlinearProblem(f, u0)
cache = init(probB, NewtonRaphson()) # Can iterate the solver object
solver = solve!(cache)
Expand Down
13 changes: 7 additions & 6 deletions docs/src/tutorials/nonlinear.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ A nonlinear system $$f(u) = 0$$ is specified by defining a function `f(u,p)`,
where `p` are the parameters of the system. For example, the following solves
the vector equation $$f(u) = u^2 - p$$ for a vector of equations:

```julia
```@example
using NonlinearSolve, StaticArrays
f(u,p) = u .* u .- p
u0 = @SVector[1.0, 1.0]
p = 2.0
probN = NonlinearProblem{false}(f, u0, p)
solver = solve(probN, NewtonRaphson(), tol = 1e-9)
solver = solve(probN, NewtonRaphson(), reltol = 1e-9)
```

where `u0` is the initial condition for the rootfind. Native NonlinearSolve.jl
Expand All @@ -24,9 +24,10 @@ AbstractArray for automatic differentiation.
For scalar rootfinding problems, bracketing methods exist. In this case, one passes
a bracket instead of an initial condition, for example:

```julia
f(u, p) = u .* u .- 2.0
u0 = (1.0, 2.0) # brackets
probB = IntervalNonlinearProblem(f, u0)
```@example
using NonlinearSolve
f(u, p) = u*u - 2.0
uspan = (1.0, 2.0) # brackets
probB = IntervalNonlinearProblem(f, uspan)
sol = solve(probB, Falsi())
```

0 comments on commit aa7945a

Please sign in to comment.