Question: Direct Search Optimisation - Equality Constraints

Hi,

I am using Direct Search Optimisation package to minimize a function however I am trying to define an equality constraint for it, but I am facing a problem when I run it. Please see the code below.

    result := DirectSearch:-Search(CHWP,[sum(d[i], i = 1 .. 7)  = 220], variables = [d = Vector(7)], assume =nonnegint,
            strategy = globalsearch, method = cdos, evaluationlimit = 10000, objectivetarget = 10^(-10));

CHWP is the name of my procedure which works with any other type of constraint. d is my variable which I have defined as a vector. when I run this it starts with different combination of numbers for d[i]s however the error comes in when it all of a sudden assigns some numbers to d[i]s which their sum exceeds the limit which I have defined (220) in this case and when this happens the procedure will give an error which is normal for the function which I have defined since a number bigger than 220 does not make sense in this case. I would be glad if you can help me with this. Many thanks.

 

Please Wait...