Subj: Help for optim Dear all, I want to optimize a function using optim. I have two problems: 1-how can i minimize function which fn value be zero not negative. Because i want optimize parameters which lead to zero fn. 2- how can i change it to maximization? Best,