Search found 11 matches

by Only_God
3 years ago
Forum: Modeling
Topic: QCP under CPLEX
Replies: 3
Views: 2805

Re: QCP under CPLEX

Thank you very much I thought since sqrt(x*x+y*y)<=t is convex then x^2+y^2<=t^2 is also convex... But I was absolutely wrong!! The reason is because the function is not convex. In standard form for an NLP, it's x^2 + y^2 - z^2 <= 0 The function has a Hessian that is indefinite, having eigenvalues e...
by Only_God
3 years ago
Forum: Modeling
Topic: QCP under CPLEX
Replies: 3
Views: 2805

QCP under CPLEX

Dear Users/admins; As you know cplex can solve convex QCP. I have written the following simple example in gams: x*x + y*y=l=z*z; As you know the above function is second order cone and so convex. But when solving it with cplex under qcp it says the model is not convex!! Can someone help me? Am I los...
by Only_God
3 years ago
Forum: Modeling
Topic: SOCP' best solvers
Replies: 2
Views: 3775

Re: SOCP' best solvers

Thank you vary much Michael
by Only_God
3 years ago
Forum: Modeling
Topic: SOCP' best solvers
Replies: 2
Views: 3775

SOCP' best solvers

Dear GAMS users, I have a simple question and I really appreciate your help. I have an SOCP model (second order cone programming) and so my model is convex. My question is that which solver is more suitable for these kinds of problems i.e., SOCP? Or every nonlinear solver is able to solve it easily ...
by Only_God
3 years ago
Forum: Modeling
Topic: Sum of r largest components
Replies: 0
Views: 2218

Sum of r largest components

Dear GAMS users, I have a problem which I don't know how to model in GAMS and here it is: Assume x(i) is a variable. I want to find the sum of r largest components. For instance, assume x(i)=(x1, x2, x3, x4, x5, x6, x7) and I wish to find the sum of 3 largest components (i.e., x2+x7+x5 where x2 is t...
by Only_God
6 years ago
Forum: Modeling
Topic: converting an integer variable into a binary variable
Replies: 8
Views: 5475

Re: converting an integer variable into a binary variable

Dear Manassaldi,
Thank you very much to reply my post.
Your idea is great and I would try to apply it to my model. :)
Sincerely yours.
Manassaldi wrote: 6 years ago Hi, try these equations:

eq.. X =l= M*Y
eq.. X =g= Y

M is a parameter and the upper bound of X

If Y =1
X =l= M
X =g= 1

if Y = 0
X =l= 0
X =g= 0

Bye!
by Only_God
6 years ago
Forum: Modeling
Topic: converting an integer variable into a binary variable
Replies: 8
Views: 5475

converting an integer variable into a binary variable

Dear GAMS experts, I have a modeling problem which seems not to be difficult to solve, but I cannot find a way to handle it. :| Assume there are two variables in your model that one of the variables is integer (X) and another one is binary (Y). If X is 0 then Y is 0 as well, otherwise if X=1,2,3, .....
by Only_God
6 years ago
Forum: Modeling
Topic: Objective Function with Domain
Replies: 2
Views: 2755

Re: Objective Function with Domain

Dear Renger, Thanks for your answer. My problem was already solved by the helpful reply of Michael in the previous post using the dynamic set. However, please note that I cannot use your way because OBJ is defined over the set s. Sincerely yours. Hi Just use a loop loop(s, solve mymodel using nlp ma...
by Only_God
6 years ago
Forum: Modeling
Topic: Objective Function with Domain
Replies: 2
Views: 2697

Re: Objective Function with Domain

Dear Michael, I really appreciate your very useful suggestion. That was a great idea and my code is properly working. Thanks a lot. Hi, You need to do two things: 1) Work with a dynamic set sx(s) that contains only the elements of s you want in your single solve (it seems that in your case you just ...
by Only_God
6 years ago
Forum: Modeling
Topic: Objective Function with Domain
Replies: 2
Views: 2755

Objective Function with Domain

Dear GAMS users, Hi, As you know objective function in GAMS should be a free variable without domain. However, I have a model in which the objective function is defined over the all elements of a set. For instance, assume that set s /s1*s100/; The objective function is OF(s). Indeed, for each s, the...