Skip to content

Commit 43c3017

Browse files
abelsiqueiraJSOTutorials bot
andauthored
🤖 Tutorials deployment from aa27d1c3ac4132ce5ee3dcc7e3e9f92a9429664f (#203)
Co-authored-by: JSOTutorials bot <[email protected]>
1 parent efc329a commit 43c3017

File tree

3 files changed

+37
-16
lines changed

3 files changed

+37
-16
lines changed
246 KB
Loading
22.4 KB
Loading

tutorials/introduction-to-jsosolvers/index.md

Lines changed: 37 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55
\preamble{Tangi Migot}
66

77

8-
![CSV 0.10.11](https://img.shields.io/badge/CSV-0.10.11-000?style=flat-square&labelColor=999)
9-
[![SolverCore 0.3.7](https://img.shields.io/badge/SolverCore-0.3.7-006400?style=flat-square&labelColor=389826)](https://jso.dev/SolverCore.jl/stable/)
10-
![DataFrames 1.6.1](https://img.shields.io/badge/DataFrames-1.6.1-000?style=flat-square&labelColor=999)
11-
![Plots 1.39.0](https://img.shields.io/badge/Plots-1.39.0-000?style=flat-square&labelColor=999)
12-
[![ADNLPModels 0.7.0](https://img.shields.io/badge/ADNLPModels-0.7.0-8b0000?style=flat-square&labelColor=cb3c33)](https://jso.dev/ADNLPModels.jl/stable/)
13-
[![JSOSolvers 0.11.0](https://img.shields.io/badge/JSOSolvers-0.11.0-006400?style=flat-square&labelColor=389826)](https://jso.dev/JSOSolvers.jl/stable/)
8+
![CSV 0.10.15](https://img.shields.io/badge/CSV-0.10.15-000?style=flat-square&labelColor=999)
9+
![LinearAlgebra 1.12.0](https://img.shields.io/badge/LinearAlgebra-1.12.0-000?style=flat-square&labelColor=999)
10+
[![SolverCore 0.3.8](https://img.shields.io/badge/SolverCore-0.3.8-006400?style=flat-square&labelColor=389826)](https://jso.dev/SolverCore.jl/stable/)
11+
![DataFrames 1.8.1](https://img.shields.io/badge/DataFrames-1.8.1-000?style=flat-square&labelColor=999)
12+
![Plots 1.41.1](https://img.shields.io/badge/Plots-1.41.1-000?style=flat-square&labelColor=999)
13+
![Logging 1.11.0](https://img.shields.io/badge/Logging-1.11.0-000?style=flat-square&labelColor=999)
14+
[![ADNLPModels 0.7.2](https://img.shields.io/badge/ADNLPModels-0.7.2-8b0000?style=flat-square&labelColor=cb3c33)](https://jso.dev/ADNLPModels.jl/stable/)
15+
[![JSOSolvers 0.11.2](https://img.shields.io/badge/JSOSolvers-0.11.2-006400?style=flat-square&labelColor=389826)](https://jso.dev/JSOSolvers.jl/stable/)
1416

1517

1618

@@ -54,6 +56,20 @@ The solvers `tron` and `trunk` both have a specialized implementation for input
5456

5557
The following examples illustrate this specialization.
5658

59+
To list the allowed least-squares subsolvers for these specializations:
60+
61+
```julia
62+
JSOSolvers.trunkls_allowed_subsolvers
63+
JSOSolvers.tronls_allowed_subsolvers
64+
```
65+
66+
```plaintext
67+
Error: UndefVarError: `JSOSolvers` not defined in `Main.var"##WeaveSandBox#277"`
68+
Suggestion: check for spelling errors or missing imports.
69+
```
70+
71+
72+
5773
```julia
5874
using JSOSolvers, ADNLPModels
5975
f(x) = (x[1] - 1)^2 + 4 * (x[2] - x[1]^2)^2
@@ -157,6 +173,11 @@ ADNLSModel - Nonlinear least-squares model with automatic differentiation backen
157173
EmptyADbackend,
158174
ForwardDiffADHessian,
159175
EmptyADbackend,
176+
ForwardDiffADHvprod,
177+
ForwardDiffADJprod,
178+
ForwardDiffADJtprod,
179+
ForwardDiffADJacobian,
180+
ForwardDiffADHessian,
160181
}
161182
Problem name: Generic
162183
All variables: ████████████████████ 7 All constraints: ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅ 0 All residuals: ████████████████████ 37
@@ -195,13 +216,13 @@ stats.solution
195216

196217
```plaintext
197218
7-element Vector{Float64}:
198-
1288.1396826441605
199-
1491.255092722479
200-
583.3669627041016
201-
75.44128919391854
202-
0.9664368403070315
203-
0.39804057172490376
204-
0.049747755368081494
219+
1288.1385483966494
220+
1491.3131010827399
221+
583.4094645888615
222+
75.44940840742956
223+
0.9664846431099525
224+
0.3980623204595821
225+
0.049754315246586134
205226
```
206227

207228

@@ -212,7 +233,7 @@ scatter(x, y, c=:blue, m=:square, title="Nonlinear regression", lab="data")
212233
plot!(x, t -> m(stats.solution, t), c=:red, lw=2, lab="fit")
213234
```
214235

215-
![](figures/index_8_1.png)
236+
![](figures/index_9_1.png)
216237

217238

218239

@@ -235,7 +256,7 @@ stats = solve!(solver, nlp)
235256

236257

237258

238-
The following table provides the correspondance between the solvers and the solvers structures:
259+
The following table provides the correspondence between the algorithms and their solver structures:
239260

240261
| Algorithm | Solver structure |
241262
| ------------------- | ---------------- |
@@ -305,4 +326,4 @@ contour!(xg, yg, (x1,x2) -> f([x1; x2]), levels=100)
305326
plot!(X, Y, c=:red, l=:arrow, m=4)
306327
```
307328

308-
![](figures/index_12_1.png)
329+
![](figures/index_13_1.png)

0 commit comments

Comments
 (0)