You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's fine out what some of the local maxima and minima are. Optim.jl can be used to minimize functions, and the solution type has a continuous interpolation which can be used. Let's look for the local optima for the 4th variable around `t=20`. Thus our optimization function is:
52
52
53
53
```@example minmax
54
-
f = (t) -> sol(t,idxs=4)
54
+
f(t,_) = sol(first(t),idxs=4)
55
55
```
56
56
57
57
`first(t)` is the same as `t[1]` which transforms the array of size 1 into a number. `idxs=4` is the same as `sol(first(t))[4]` but does the calculation without a temporary array and thus is faster. To find a local minima, we can solve the optimization problem where the loss
@@ -61,7 +61,7 @@ function is `f`:
61
61
using Optimization, OptimizationNLopt, ForwardDiff
0 commit comments