File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ using OrdinaryDiffEq # to get the Flow function from OptimalControl
4949using NonlinearSolve # interface to NLE solvers
5050using MINPACK # NLE solver: use to solve the shooting equation
5151using Plots # to plot the solution
52+ using BenchmarkTools # do some benchmarking
5253```
5354
5455## Optimal control problem
@@ -302,8 +303,7 @@ nothing # hide
302303
303304Let us do some benchmarking. This will be useful to compare the performance with the MINPACK.jl package below.
304305
305- ``` @example main
306- using BenchmarkTools
306+ ``` @setup main
307307function nlsolve(prob; kwargs...)
308308 try
309309 NonlinearSolve.solve(prob; kwargs...)
318318For small nonlinear systems, it could be faster to use the
319319[ ` SimpleNewtonRaphson() ` descent algorithm] ( https://docs.sciml.ai/NonlinearSolve/stable/tutorials/code_optimization/ ) .
320320
321- ``` @example main
321+ ``` @setup main
322322function nlsolve(prob, meth; kwargs...)
323323 try
324324 NonlinearSolve.solve(prob, meth; kwargs...)
You can’t perform that action at this time.
0 commit comments