title: Optimization of multivariable quadratic equation in R subject to constraints
body: <p>I am running on R 3.0. I have a quadratic function like:</p>
  
  <pre><code>2*x[1]*x[1] -5 * x[1] + 8 * x[2] * x[2] - 7*x[3]*x[2] -5 * x[3] * x[3]..
  </code></pre>
  
  <p>The function has various quadratic terms and has some linear constraints such as:</p>
  
  <pre><code>1 &lt;= x[1] &lt;= 7
  -2 &lt;= x[2] &lt;= 9
  0 &lt;= x[3] &lt;= 32
  </code></pre>
  
  <p>Additionally,</p>
  
  <pre><code> x[1]+ x[2]+ x[3] = 100
  </code></pre>
  
  <p>Which package in R should I look at to solve this kind of an optimization problem? It is a large equation with many inequalities and I am running R 3.0.Can some thing like:</p>
  
  <pre><code>   x[1]+ x[2]+ x[3] = 100
  </code></pre>
  
  <p>be done with optim?</p>
  
  <p>I am somehow not able to figure out how to pass parameters to constrOptim or solve.QP in quadprog.</p>