#### Topic: Unexpected inequality constraints in Ipopt with FuncDesigner

I'm experimenting with solving Thomson problem (electrons with Coulomb potential on a sphere) from http://www.mcs.anl.gov/~more/cops/ using OpenOpt with Ipopt solver. However I get very bad performance when I try to use AD. Here is the code:

```
from openopt import NLP
from numpy import *
from FuncDesigner import *
from math import pi
np = 50 # number of electrons
# Set the starting point to a quasi-uniform distribution
# of electrons on a unit sphere
random.seed(861276191)
theta = 2*pi*random.random_sample(np)
phi = pi*random.random_sample(np)
x, y, z = oovar(size=np), oovar(size=np), oovar(size=np)
f = sum([sum([1.0/sqrt((x[i] - x[j])**2 + (y[i] - y[j])**2 + (z[i] - z[j])**2) \
for j in range(i+1, np)]) for i in range(np-1)])
x0 = {x : cos(theta)*sin(phi), y : sin(theta)*sin(phi), z : cos(phi)}
p = NLP(f, x0)
p.constraints = [x**2 + y**2 + z**2 == ones(np)]
r = p.solve('ipopt', options = 'output_file = result.txt, file_print_level = 5')
x_opt, y_opt, z_opt = r(x,y,z)
print(x_opt, y_opt, z_opt)
```

Ipopt output:

```
...
Number of nonzeros in equality constraint Jacobian...: 7500
Number of nonzeros in inequality constraint Jacobian.: 183750
Number of nonzeros in Lagrangian Hessian.............: 0
Total number of variables............................: 150
variables with only lower bounds: 0
variables with lower and upper bounds: 0
variables with only upper bounds: 0
Total number of equality constraints.................: 50
Total number of inequality constraints...............: 1225
inequality constraints with only lower bounds: 0
inequality constraints with lower and upper bounds: 0
inequality constraints with only upper bounds: 1225
...
Total CPU secs in IPOPT (w/o function evaluations) = 985.358
Total CPU secs in NLP function evaluations = 1562.662
```

I can't understand why 1225 inequality constraints appear. I suppose they slow down the solution process greatly. Another strange thing is 7500 nonzeros in Jacobian of equality constraints. Because there should be only 50 nonzeros. Are this two anomalies ok? Or maybe I've used OpenOpt incorrectly?

I use OpenOpt 0.32 with Python 2.6.6 and Ipopt 3.8.3 with sequential MUMPS 4.9.2 on Debian Squeeze.