[R] problems with constrained optimization

2013-08-19 Thread IliaN
I tried ti run a simple example with function solnp() from Rsolnp: find max(x+y) on a unit circle x*x+y*y=1. The answer should be x=y=1/sqrt(2) with max=sqrt(2). Here are my code and results # test Rsolnp library(Rsolnp) fn1 - function(x) +

Re: [R] problems with constrained optimization

2013-08-19 Thread Erich Neuwirth
Bad starting value. Try c(3/5,4/5) On Aug 19, 2013, at 1:33 PM, il...@gertner.health.gov.il wrote: I tried ti run a simple example with function solnp() from Rsolnp: find max(x+y) on a unit circle x*x+y*y=1. The answer should be x=y=1/sqrt(2) with max=sqrt(2). Here are my code and results