To Find the max (min) a six-variable-function

Hi there,

I am trying to the maximum (or/and minimum) of a six-variable function, under some specific constraints on its six inputs. To be honest, I am a physics student and this problem is very important for my project, but so far, I have not found a way to do this. I do appreciate in having any help or suggestion for you.

The function is defined as follows:
Let’s K=K(a,b,c,d,e,f)= abef + ade - adef + bcf - bcef + cdf + cde - cd - cde*f;
be a six-variable function whose inputs are constrained as follows -1<= a,b,c,d <=1; 0<=e,f<=1;
Find the max/min of K in the defined region.

I do thank you for your helps.

This problem, specifically, the objective function, is neither convex nor concave, so CVX can not be used to minimize or maximize it. This problem is easy enough for a global optimizer to handle it. There are also many nonlinear local optimizers which can handle the bound constraints you have.

Because you’re new around here, I’ll tell you the answer, and hope you come back when you have a convex optimization problem suitable for CVX.

It attains its global minimum at [a b c d e f] = [“anything in [-1,1]” “anything in [-1,1]” -1 -1. 0 0], with objective value -1, and its global maximum at [a b c d e f] = [1 1 “anything in [-1,1]” “anything in [-1,1]” 1 1] with objective value 1. It’s possible the global optima also occur at other argument values, but in any event, -1 and 1 are the global min and max objective function values respectively.


Oh, thank you so much for your help and giving this nice information. BTW, can you please tell me the exact name of the optimizer software which you used for solving this problem? I ask this, becasue I need to change the constraints and the function for different situations. Hence, I need that specific software’s name. Again, thanks :slight_smile:

This is not the right place to provide advice on software other than CVX or TFOCS.

I recommend you learn something about optimization. Study a book or take a course.

There is plenty of optimization software available which runs under MATLAB. After you have learned something about optimization and if you need help solving a specific problem, you could ask for help on or or a forum dedicated to a specific piece of software.

If you had gained even the most basic knowledge in optimization and looked at the CVX User Guide, you would have known it was inappropriate for your problem. I see now you asked this same question at . Again, with even the most rudimentary knowledge of optimization and CPLEX, you would know that this problem is outside the scope of CPLEX.

1 Like

You are right, I don’t know the theory of optimization. Actually, even my works are not related to this specific part of mathematics, rather I need to solve some inequalities in which this extremum-problem appears. BTW thanks for your advices, I do appreciate them.