Skip to content

Commit 2e9cfc4

Browse files
committed
docs(advanced-jsosolvers): clarify JSOSolvers 0.11 compatibility and improve documentation
- Add note that tutorial works with JSOSolvers 0.11 using subsolver_type parameter - Keep correct API: subsolver_type = CglsSolver (not subsolver = :cgls) - Add explicit TRUNK and TRON examples showing subsolver_type usage - Link to Krylov.jl documentation for subsolver details - Fix grammar: "solver TRUNK" (singular), "subsolvers are", "was...instances" - Fix heading: "in JSOSolvers" instead of "JSOSolvers solvers" The tutorial now correctly documents the API that actually works with JSOSolvers 0.11.
1 parent ce718de commit 2e9cfc4

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

tutorials/advanced-jsosolvers/index.jmd

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,17 @@ tags: ["solvers", "krylov", "benchmark", "least squares"]
44
author: "Tangi Migot"
55
---
66

7-
# Comparing subsolvers for nonlinear least squares JSOSolvers solvers
7+
# Comparing subsolvers for nonlinear least squares in JSOSolvers
88

99
This tutorial showcases some advanced features of solvers in JSOSolvers.
1010

11+
**Note**: This tutorial is compatible with JSOSolvers 0.11. The subsolver is selected using the `subsolver_type` parameter with Krylov solver types (e.g., `CglsSolver`, `LsmrSolver`).
12+
1113
```julia
1214
using JSOSolvers
1315
```
1416

15-
We benchmark different subsolvers used in the solvers TRUNK for unconstrained nonlinear least squares problems.
17+
We benchmark different subsolvers used in the solver TRUNK for unconstrained nonlinear least squares problems.
1618
The first step is to select a set of problems that are nonlinear least squares.
1719

1820
```julia
@@ -38,13 +40,14 @@ For this task, several solvers are available.
3840
JSOSolvers.trunkls_allowed_subsolvers
3941
```
4042

41-
This benchmark could also be followed for the solver TRON where the following subsolver are available.
43+
This benchmark could also be followed for the solver TRON where the following subsolvers are available.
4244

4345
```julia
4446
JSOSolvers.tronls_allowed_subsolvers
4547
```
4648

4749
These linear least squares solvers are implemented in the package [Krylov.jl](https://github.com/JuliaSmoothOptimizers/Krylov.jl).
50+
For detailed descriptions of each subsolver's algorithm and when to use it, see the [Krylov.jl documentation](https://jso.dev/Krylov.jl/stable/).
4851

4952
```julia
5053
using Krylov
@@ -53,6 +56,20 @@ using Krylov
5356
We define a dictionary of the different solvers that will be benchmarked.
5457
We consider here four variants of TRUNK using the different subsolvers.
5558

59+
For example, to call TRUNK with an explicit subsolver:
60+
61+
```julia
62+
stats = trunk(nls, subsolver_type = CglsSolver)
63+
```
64+
65+
The same subsolver selection pattern applies to TRON's least-squares specialization:
66+
67+
```julia
68+
stats_tron = tron(nls, subsolver_type = LsmrSolver)
69+
```
70+
71+
Now we define the solver dictionary for benchmarking:
72+
5673
```julia
5774
solvers = Dict(
5875
:trunk_cgls => model -> trunk(model, subsolver_type = CglsSolver),
@@ -91,5 +108,5 @@ profile_solvers(stats, costs, costnames)
91108
```
92109

93110
The CRLS and CGLS variants are the ones solving more problems, and even though the difference is rather small the CGLS variant is consistently faster which seems to indicate that it is the most appropriate subsolver for TRUNK.
94-
The size of the problems were rather small here, so this should be confirmed on larger instance.
111+
The size of the problems was rather small here, so this should be confirmed on larger instances.
95112
Moreover, the results may vary depending on the origin of the test problems.

0 commit comments

Comments
 (0)