title: constrained optimization in R
body: <p>I am trying to use <a href="http://rss.acs.unt.edu/Rdoc/library/stats/html/constrOptim.html" rel="noreferrer">http://rss.acs.unt.edu/Rdoc/library/stats/html/constrOptim.html</a> in R to do optimization in R with some given linear constraints but not able to figure out how to set up the problem.</p>
  
  <p>For example, I need to maximize $f(x,y) = log(x) + \frac{x^2}{y^2}$ subject to constraints $g_1(x,y) = x+y &lt; 1$, $g_2(x,y) = x > 0$ and $g_3(x,y) = y > 0$. How do I do this in R? This is just a hypothetical example. Do not worry about its structure, instead I am interested to know how to set this up in R.</p>
  
  <p>thanks!</p>