Skip to content

Commit a7bd098

Browse files
authored
Merge pull request #501 from control-toolbox/500-general-pretty-urls-in-documentation
pretty urls
2 parents f37ff06 + ac2a9d3 commit a7bd098

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

docs/make.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ makedocs(;
2121
sitename="OptimalControl.jl",
2222
format=Documenter.HTML(;
2323
repolink="https://" * repo_url,
24-
prettyurls=false,
24+
prettyurls=true,
2525
size_threshold_ignore=[
2626
"api-ctbase/types.md", "dev-ctmodels.md", "tutorial-plot.md"
2727
],

docs/src/tutorial-goddard.md

+10-7
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,12 @@ We import the [OptimalControl.jl](https://control-toolbox.org/OptimalControl.jl)
3737
[NLPModelsIpopt.jl](https://github.com/JuliaSmoothOptimizers/NLPModelsIpopt.jl) to solve it.
3838
We import the [Plots.jl](https://github.com/JuliaPlots/Plots.jl) package to plot the solution.
3939
The [OrdinaryDiffEq.jl](https://github.com/SciML/OrdinaryDiffEq.jl) package is used to
40-
define the shooting function for the indirect method and the
41-
[NonlinearSolve.jl](https://github.com/SciML/NonlinearSolve.jl) and
42-
[MINPACK.jl](https://github.com/sglyon/MINPACK.jl) packages permit to solve the shooting
43-
equation.
40+
define the shooting function for the indirect method and the [MINPACK.jl](https://github.com/sglyon/MINPACK.jl) package permits to solve the shooting equation.
4441

4542
```@example main
4643
using OptimalControl # to define the optimal control problem and more
4744
using NLPModelsIpopt # to solve the problem via a direct method
4845
using OrdinaryDiffEq # to get the Flow function from OptimalControl
49-
using NonlinearSolve # interface to NLE solvers
5046
using MINPACK # NLE solver: use to solve the shooting equation
5147
using Plots # to plot the solution
5248
```
@@ -295,14 +291,21 @@ the shooting equation. To compute the Jacobian of the shooting function we use t
295291
[ForwardDiff.jl](https://github.com/JuliaDiff/ForwardDiff.jl) backend.
296292

297293
```@setup main
294+
using NonlinearSolve # interface to NLE solvers
295+
struct MYSOL
296+
x::Vector{Float64}
297+
end
298298
function fsolve(f, j, x; kwargs...)
299299
try
300300
MINPACK.fsolve(f, j, x; kwargs...)
301301
catch e
302302
println("Error using MINPACK")
303303
println(e)
304-
println("hybrj not supported. Replaced by hybrd even if it is not visible on the doc.")
305-
MINPACK.fsolve(f, x; kwargs...)
304+
println("hybrj not supported. Replaced by NonlinearSolve even if it is not visible on the doc.")
305+
nle! = (s, ξ, λ) -> f(s, ξ)
306+
prob = NonlinearProblem(nle!, ξ)
307+
sol = solve(prob; abstol=1e-8, reltol=1e-8, show_trace=Val(true))
308+
return MYSOL(sol.u)
306309
end
307310
end
308311
```

0 commit comments

Comments
 (0)