Skip to content

Commit 2b8abdc

Browse files
committed
add docs
1 parent 8950c94 commit 2b8abdc

2 files changed

Lines changed: 74 additions & 0 deletions

File tree

docs/pages.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ pages = [
1010
"Basics" => Any[
1111
"basics/bvp_problem.md", "basics/bvp_functions.md",
1212
"basics/solve.md", "basics/autodiff.md", "basics/error_control.md",
13+
"basics/verbosity.md",
1314
],
1415
"Solver Summaries and Recommendations" => Any[
1516
"solvers/mirk.md", "solvers/firk.md", "solvers/shooting.md", "solvers/mirkn.md",

docs/src/basics/verbosity.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Verbosity Control
2+
3+
## Verbosity Specification with SciMLLogging.jl
4+
5+
BoundaryValueDiffEq.jl uses SciMLLogging.jl to provide users with fine-grained control over logging and diagnostic output during BVP solving. The `BVPVerbosity` struct allows you to customize which messages are displayed, from deprecation warnings to detailed debugging information about solver convergence, linear algebra issues, and internal NonlinearSolve.jl/Optimization.jl solver diagnostics.
6+
7+
## Basic Usage
8+
9+
Pass a `BVPVerbosity` object to `solve` or `init` using the `verbose` keyword argument:
10+
11+
```julia
12+
using BoundaryValueDiffEq
13+
14+
# Define a boundary value problem
15+
function f!(du, u, p, t)
16+
du[1] = u[2]
17+
du[2] = -u[1]
18+
end
19+
20+
function bc!(res, u, p, t)
21+
res[1] = u[1][1]
22+
res[2] = u[end][1] - 1
23+
end
24+
25+
u0 = [0.0, 1.0]
26+
tspan = (0.0, 1.0)
27+
prob = BVProblem(f!, bc!, u0, tspan)
28+
29+
# Solve with detailed verbosity to see convergence info
30+
verbose = BVPVerbosity(Detailed())
31+
sol = solve(prob, MIRK4(), dt = 0.1, verbose = verbose)
32+
33+
# Solve with completely silent output (no warnings or deprecations)
34+
sol = solve(prob, MIRK4(), dt = 0.1, verbose = BVPVerbosity(None()))
35+
36+
# Solve with default verbosity (standard preset)
37+
sol = solve(prob, MIRK4(), dt = 0.1) # equivalent to verbose = BVPVerbosity()
38+
```
39+
40+
## Controlling Internal Solver Verbosity
41+
42+
BoundaryValueDiffEq.jl solvers internally use NonlinearSolve.jl (for nonlinear systems) or Optimization.jl (when using optimization-based methods). You can control the verbosity of these internal solvers independently:
43+
44+
```julia
45+
# Silence BVP messages but show all NonlinearSolve convergence info
46+
verbose = BVPVerbosity(
47+
None(),
48+
nonlinear_verbosity = All()
49+
)
50+
sol = solve(prob, MIRK4(), dt = 0.1, verbose = verbose)
51+
52+
# Show standard BVP messages but silence NonlinearSolve output
53+
verbose = BVPVerbosity(
54+
Standard(),
55+
nonlinear_verbosity = None()
56+
)
57+
sol = solve(prob, MIRK4(), dt = 0.1, verbose = verbose)
58+
59+
# Control Optimization.jl verbosity when using optimization-based methods
60+
using Optimization, OptimizationOptimJL
61+
62+
verbose = BVPVerbosity(
63+
Standard(),
64+
optimization_verbosity = Detailed()
65+
)
66+
sol = solve(prob, MIRK4(optimize = OptimizationOptimJL.BFGS()), dt = 0.1, verbose = verbose)
67+
```
68+
69+
## API Reference
70+
71+
```@docs
72+
BVPVerbosity
73+
```

0 commit comments

Comments
 (0)