Skip to content
Prev 388106 / 398502 Next

Testing optimization solvers with equality constraints

In case it is of interest this problem can be solved with an
unconstrained optimizer,
here optim, like this:

    proj <- function(x) x / sqrt(sum(x * x))
    opt <- optim(c(0, 0, 1), function(x) f(proj(x)))
    proj(opt$par)
    ## [1] 5.388907e-09 7.071068e-01 7.071068e-01
On Fri, May 21, 2021 at 11:01 AM Hans W <hwborchers at gmail.com> wrote: