TNC 1.2: a non-linear, bounds constrained optimizer

Jean-Sebastien Roy
Sat, 03 Apr 2004 19:02:17 +0200

I would like to announce the release of TNC v 1.2.

TNC is a non-linear, bound constrained optimizer written in C with a 
Python interface.

You can get it at:

The latest version is always available at:

An example and a few test cases are provided.



Example use:

import tnc

# A function to minimize
# Must return a tuple with the function value and the gradient
# (as a list) or None to abort the minimization
def function(x):
   f = x[0]**2+abs(x[1])**3
   g = [2*x[0], 3*abs(x[1])*x[1]]
   return f, g

# Optimizer call
rc, nf, x = tnc.minimize(function, x = [-7, 3], low = [-10, 1],
   up = [10, 10])

print "After", nf, "function evaluations, TNC returned:",
print "x =", x
print "exact value = [0, 1]"