Ravi Varadhan wrote: > > .... > require(BB) > > f2 <- function(x) { > f <- rep(NA, length(x)) > f[1] <- 1 + 2 * x[1] * x[3] # x[3] is the Lagrangian multiplier > f[2] <- 1 + 2 * x[2] * x[3] > f[3] <- x[1]^2 + x[2]^2 - 1 # the equality constraint > f > } > >
You can also try my package "nleqslv" for solving systems of non linear equations (using Broyden or Newton with a selection of global strategies). library(nleqslv) xinit <- rep(1,3) # or rep(0,3) for a singular start nleqslv(xinit,f2,control=list(trace=1)) # f2 defined as above (You don't need the trace=1; but especially when doing first explorations of a system it can come in handy). Berend -- View this message in context: http://www.nabble.com/Non-Linear-Optimization---Query-tp22550273p22566620.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.