Page 1 of 1

Please help with solver

Posted: Sat Jan 26, 2019 2:41 pm
by asmaa5m3
Hello everyone
I created the following program or whatever you call it and compile it with no error, however I got zeros in my z solution
Positive variable x1, x2, x3;
free variable z;

Equations

Con1,
Con2,
Con3,
Obj;

;
Con1.. 75*x1 + 131*x2 + 169*x3 =L= 375;
Con2.. 9*x1 + 15*x2 + 20*x3 =L= 44;
Con3.. 7*x1 + 12*x2 + 15*x3 =L= 34;
Obj.. 0.2*x1 + 0.3*x2+ 0.5*x3 =E= z;

Model Time_minimization /
Con1,
Con2,
Con3,
Obj / ;

options lp = cplex;

Solve Time_minimization Using lp Minimizing z;

Display x1.L, x2.L, x3.L, z.L;


can anyone tell me what's wrong with it????

Re: Please help with solver

Posted: Sun Jan 27, 2019 12:08 pm
by Renger
Hi
There is nothing wrong with your solution: you have three less-than-or-equal constraints and a to minimize objective equation all with positive coefficients.
This means that {0,0,0} is the minimal and optimal solution. All constraints are met and the objective variable is minimized.
Perhaps you meant greater-than-or-equal in your constraints.

Cheers
Renger

Re: Please help with solver

Posted: Mon Jan 28, 2019 10:30 am
by asmaa5m3
Renger wrote: 5 years ago Hi
There is nothing wrong with your solution: you have three less-than-or-equal constraints and a to minimize objective equation all with positive coefficients.
This means that {0,0,0} is the minimal and optimal solution. All constraints are met and the objective variable is minimized.
Perhaps you meant greater-than-or-equal in your constraints.

Cheers
Renger
thanks for reply first of all
I go zeros for solution, what should I do to get optimal numbers for the three unknowns??

Re: Please help with solver

Posted: Mon Jan 28, 2019 11:35 am
by Renger
Hi
This is the optimal solution imagine a one-dimensional problem: x<5 and z=3x. 0 is the optimal solution.
It would make more sense if you would have >= constraints.
Cheers
Renger

Re: Please help with solver

Posted: Mon Jan 28, 2019 11:53 am
by asmaa5m3
Renger wrote: 5 years ago Hi
This is the optimal solution imagine a one-dimensional problem: x<5 and z=3x. 0 is the optimal solution.
It would make more sense if you would have >= constraints.
Cheers
Renger
thanks a lot for helping