Dear experts!
I have a minimization problem with non-linear constraint and Objective 
function(theta)=lambda*(Constr)^2-f(x,theta). Theta is a vector of 
parameters.
I'd like to stop the optimization after the value of the constraint is less 
or equal some constant value, say d, and save the last computed value of the 
function.
For this purpose, I thought to define the Objective function like this:

if (Constraint>d) fun<- ....
else stop

but this does not work with error message:
Error in f(x, ...) : Object "fun" not found

I am using nlm for minimization.
Thanks a lot for help and suggestions,
Vicky Landsman.

	[[alternative HTML version deleted]]


