Non linear optimization

17 views
Skip to first unread message

chro...@yahoo.com

unread,
Dec 15, 2009, 5:23:36 PM12/15/09
to kni...@googlegroups.com
I am using your trial version and I had a couple of questions.

First, I am trying to minimize a non-linear problem so from what I understood from the manual I have to set my objective function f(x) = 0 and what do I set the type to? General? Linear? Quadratic? Then I have my non-linear function be one of the equality contraints? So I set cLo and cUp to 0 and set the type to be quadratic? Is this correct.

Second, I created a constraint function that would return 0 only if all contraints were met. So in my initializaton of constraints I make it a linear equality constraint (setting cLo and cUp to 0) and the type to be linear. But the thing is when doing some test cases it fails constraints (returns something other than 0) and does nothing that I see about it. How can I make sure the final result I get back passes these constraints.

Thanks
Don



Artelys Knitro support team

unread,
Dec 17, 2009, 8:08:48 AM12/17/09
to KNITRO Nonlinear Optimization Solver
Could you please be more precise on what you are willing to do?
Do you use a modeller like AMPL?

Nicolas Omont

chro...@yahoo.com

unread,
Dec 23, 2009, 12:11:59 PM12/23/09
to kni...@googlegroups.com
I am using the Knitro callable library in a C++ application. I created a dll file similar to the example program ExampleHS35 and loaded it similar to what the example program driverExample did using LoadLibrary.


Artelys Knitro support team

unread,
Jan 5, 2010, 5:36:08 AM1/5/10
to KNITRO Nonlinear Optimization Solver
Dear Don,

If you set the objective to 0, it means that you try to solve a non
linear system of equations.
KNITRO solves only problems in which the objective and the constraints
are continuous and differentiable. Does your problem fall in this
category? What does the constraint function returns when the
constraints are nearly satisfied?
At this step, you should set the type of problem to "general".
At the end of the computation, KNITRO prints the final status which
should be "solved". It also returns this status to your code.
Finally, did you consider using a modeler like AMPL to write your
problem. It would make things muche easier to you. A student version
is available on www.ampl.com.

Best regards.

Nicolas Omont


On Dec 23 2009, 6:11 pm, "chrono...@yahoo.com" <chrono...@yahoo.com>
wrote:

chrono137

unread,
Jan 12, 2010, 2:03:03 PM1/12/10
to KNITRO Nonlinear Optimization Solver
I believe my problem is continuous and differentiable. I was able to
derive the first order derivatives of my objective function.

I have two ways I am implementing my constraints:

First I have one constraint: -Inf < c <=0
In my constraint function my X values are evaluated based on certain
conditions. If any condition fails I return a number greater than 0,
hence failing the constraint.

Second I have N-constraints: -Inf < c <=0
In my previous implementation, the first time anything fails I return.
Previously all my conditions were wrapped in one constraint. Now I
made each condition a constraint. If if failed, it set the constraint
as a number greater than 0.

I noticed that I liked my results coming from the first implementation
of constraints better than the second one. I don't know whats the
difference but the results look better when plotting them.

I do notice the optimizer does not always "listen" to my constraints.
Sometimes it returns answers that fail my constraints. Is it because I
am not giving my optimizer enough iterations to complete? I set my
iteration count to 50 so I guess sometimes it cuts off.

Also I am using the active-set algorithm. I can't seem to get the
other algorithms to solve my objective correctly. The results are
wacky. Any thoughts?

On Jan 5, 2:36 am, Artelys Knitro support team <support-

Artelys Knitro support team

unread,
Jan 13, 2010, 4:03:34 AM1/13/10
to KNITRO Nonlinear Optimization Solver
You cannot return a number strictly greater than 0 if the constraint
fails and a negeative number if OK.
The functions X->c(X) must be continuous and differentiable too.

Nicolas Omont.

> > > I am using the Knitro callable library in a C++ application. I created a dll file similar to the example program ExampleHS35 and loaded it similar to what the example program driverExample did using LoadLibrary.- Hide quoted text -
>
> - Show quoted text -

Reply all
Reply to author
Forward
0 new messages