abs() in MIQCP with CPLEX ???does it solve??

Archive of Gamsworld Google Group
Post Reply
Archiver
User
User
Posts: 7876
Joined: 7 years ago

abs() in MIQCP with CPLEX ???does it solve??

Post by Archiver »



Hello
i have Problem with CPLEX.
i would like to calculate a marketequilibrium
i would like in the equation EXPORT_ the condition that the exports
are possible only if the price difference and export direction
correspond.
I say
EXPORT_(c,c_)..
abs(deltaprice(c,c_))*Export(c,c_)=e=deltaprice(c_,c)*Export
(c_,c);

and cplex says me
function abs results in a nonlinear expression for equation
EXPORT_...........................

BARON has solved a small Modell with the same equations in test
version.
can i change the options of CPLEX, so that it works?
thanks
Dieter

*------------------------------------------------------------------------------------------------------
Equations
WELFARE_
WELFARE_Country
WELFARE_2
QUANTITY_Function
PRICE_Supply
PRICE_Demand
PRICE_
PRICE_2
PRICE_DIfferency
EXPORT_Allocation
EXPORT_Constraint
EXPORT_Balance_1
EXPORT_Balance
EXPORT_
;
WELFARE_..
welfare_all=e=sum(c,welfare(c));

WELFARE_Country(c)..
welfare(c)=e= sum(o, P_ask(c,o)*Q_ask(c,o)*X_ask(c,o))-sum(o,
P_bid(c,o)*Q_bid(c,o)*x_bid(c,o));
WELFARE_2(c)..
welfare(c)=g=0;

QUANTITY_Function(c)..
Export_all(c)=e= sum(o, Q_bid(c,o)*x_bid(c,o))- sum(o, Q_ask
(c,o)*x_ask(c,o));

PRICE_Supply(c)..
Price_s(c)=e=(P_start_Bid(c)+sum(o, DeltaP_bid(c,o)*x_bid
(c,o)));

PRICE_Demand(c)..
Price_d(c)=e=(P_start_Ask(c)+sum(o, DeltaP_ask(c,o)*x_ask
(c,o)));

PRICE_(c)..
Price_d(c)=e=Price_s(c);
PRICE_2(c)..
Price(c)=e=Price_d(c);

PRICE_Differency(c,c_)..
dP(c,c_)=e=Price(c)-Price(c_);
EXPORT_Allocation(c)..
Export_all(c)=e=sum(c_, Export(c,c_));

EXPORT_Constraint(c,c_)..
Export(c,c_) =l= T_Cap(c,c_);

EXPORT_Balance_1(c,c_)..
Export(c,c_) =e= -Export(c_,c);

EXPORT_Balance..
0=e= sum(c, export_all(c));
EXPORT_(c,c_)..
abs(dp(c,c_))*Export(c,c_)=e=dp(c_,c)*Export(c_,c);

Model NO_CONSTR
/
WELFARE_
WELFARE_Country
WELFARE_2
QUANTITY_Function
PRICE_Supply
PRICE_Demand
PRICE_
PRICE_2
EXPORT_Allocation
* EXPORT_Constraint
EXPORT_Balance_1
EXPORT_Balance
EXPORT_
/;
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to gamsworld@googlegroups.com
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en
-~----------~----~----~----~------~----~------~--~---


Archiver
User
User
Posts: 7876
Joined: 7 years ago

Re: abs() in MIQCP with CPLEX ???does it solve??

Post by Archiver »



Dieter,

Short answer is that abs is a nonlinear function and can therefore not
be used in an MIQCP. Only linear and quadratic terms are allowed.You
could change your model type to MINLP but then Cplex will still not be
able to solve the model since Cplex does not acept model type MINLP.

Longer answer: It seems that you need to enforce the that Export(c,c_)
has the same sign as dp(c,c_). You could do that by introducing
another binary variable with the following interpretation: b(c,c_)=0
=> dp(c,c_) dp(c,c_)>=0 and Export
(c,c_)>=0. Since you have already constraint EXPORT_Balance_1 b(c,c_)
and b(c_,c) will have different values (unless Export(c,c_)=Export
(c_,c)=dp(c,c_)=dp(c_,c)=0).

The linearized constraints look as follows:

Export(c,c_) =l= 0 + bigMexport*b(c,c_);
dp(c,c_) =l= 0 + bigMdp*b(c,c_);

Export(c,c_) =g= 0 - bigMexport*(1-b(c,c_));
dp(c,c_) =g= 0 - bigMdp*(1-b(c,c_));

with bigMexport/dp a save bound on maximal export/dp between c and c_.

>From your equations it is not clear what is variable and what
parameter. Even if everything is quadratic, Cplex might still reject
the problem because it is not convex. Cplex only solves convex QCPs.

Hope this helps anyway,
Michael Bussieck - GAMSWorld Coordinator

On Jan 6, 9:08 am, "dieter.kunstm...@googlemail.com"
wrote:
> > Hello
> > i have Problem with CPLEX.
> > i would like to calculate a marketequilibrium
> > i would like in the equation EXPORT_ the condition that the exports
> > are possible only if the price difference and export direction
> > correspond.
> > I say
> > EXPORT_(c,c_)..
> > abs(deltaprice(c,c_))*Export(c,c_)=e=deltaprice(c_,c)*Export
> > (c_,c);
> >
> > and cplex says me
> > function abs results in a nonlinear expression for equation
> > EXPORT_...........................
> >
> > BARON has solved a small Modell with the same equations in test
> > version.
> > can i change the options of CPLEX, so that it works?
> > thanks
> > Dieter
> >
> > *--------------------------------------------------------------------------­----------------------------
> > Equations
> > WELFARE_
> > WELFARE_Country
> > WELFARE_2
> > QUANTITY_Function
> > PRICE_Supply
> > PRICE_Demand
> > PRICE_
> > PRICE_2
> > PRICE_DIfferency
> > EXPORT_Allocation
> > EXPORT_Constraint
> > EXPORT_Balance_1
> > EXPORT_Balance
> > EXPORT_
> > ;
> > WELFARE_..
> > welfare_all=e=sum(c,welfare(c));
> >
> > WELFARE_Country(c)..
> > welfare(c)=e= sum(o, P_ask(c,o)*Q_ask(c,o)*X_ask(c,o))-sum(o,
> > P_bid(c,o)*Q_bid(c,o)*x_bid(c,o));
> > WELFARE_2(c)..
> > welfare(c)=g=0;
> >
> > QUANTITY_Function(c)..
> > Export_all(c)=e= sum(o, Q_bid(c,o)*x_bid(c,o))- sum(o, Q_ask
> > (c,o)*x_ask(c,o));
> >
> > PRICE_Supply(c)..
> > Price_s(c)=e=(P_start_Bid(c)+sum(o, DeltaP_bid(c,o)*x_bid
> > (c,o)));
> >
> > PRICE_Demand(c)..
> > Price_d(c)=e=(P_start_Ask(c)+sum(o, DeltaP_ask(c,o)*x_ask
> > (c,o)));
> >
> > PRICE_(c)..
> > Price_d(c)=e=Price_s(c);
> > PRICE_2(c)..
> > Price(c)=e=Price_d(c);
> >
> > PRICE_Differency(c,c_)..
> > dP(c,c_)=e=Price(c)-Price(c_);
> > EXPORT_Allocation(c)..
> > Export_all(c)=e=sum(c_, Export(c,c_));
> >
> > EXPORT_Constraint(c,c_)..
> > Export(c,c_) =l= T_Cap(c,c_);
> >
> > EXPORT_Balance_1(c,c_)..
> > Export(c,c_) =e= -Export(c_,c);
> >
> > EXPORT_Balance..
> > 0=e= sum(c, export_all(c));
> > EXPORT_(c,c_)..
> > abs(dp(c,c_))*Export(c,c_)=e=dp(c_,c)*Export(c_,c);
> >
> > Model NO_CONSTR
> > /
> > WELFARE_
> > WELFARE_Country
> > WELFARE_2
> > QUANTITY_Function
> > PRICE_Supply
> > PRICE_Demand
> > PRICE_
> > PRICE_2
> > EXPORT_Allocation
> > * EXPORT_Constraint
> > EXPORT_Balance_1
> > EXPORT_Balance
> > EXPORT_
> > /;
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to gamsworld@googlegroups.com
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en
-~----------~----~----~----~------~----~------~--~---


Archiver
User
User
Posts: 7876
Joined: 7 years ago

Re: abs() in MIQCP with CPLEX ???does it solve??

Post by Archiver »



Thank You very much Michael,
my primary Variables are the Values X_BID and X_ASK, wich i
charaterise Order-Allocation in each Country.
*--------------------------------------------
Semicont Variables
X_Ask(c,o), X_Bid(c,o)
;
X_ask.lo(c,o)=0;
X_ask.up(c,o)=1;
X_Bid.lo(c,o)=0;
X_Bid.up(c,o)=1;
*-------------------------------------------
i would like to calculate three different Markt.Equilibrium:
1) without exports (self-Sufficiently, dp=0, Export=0)
2) with Export, without Transport--Congestion ( max Export(c,c_)=(-
inf...+inf)- the Value will be calculate, dP-Bound is it unknown)
3) with Export, but with Transport-Congestion ( max Export(c,c_)=le=
Transport_Capacity(c,_c), dP-Bound also is't unknown)

i can not pre estimate, how high the Value are ..:-(

can the problem other be solved?

my Test-Quellcode
*-------------------------------------------------------
SETs
t/1*2/,
c/DE,FR,CH/,
o OrderID/1*10/;
Table Price_askDown(t,c,o)
1 2 3 4 5
1.DE 14.000 10.500 4.000
1.FR 14.500 12.000 5.000
1.CH 22.000 16.000 14.000 7.000 3.000
2.DE 14.000 10.500 4.000
2.FR 14.500 12.000 5.000
2.CH 22.000 16.000 14.000 7.000 3.000
;
Table Quantity_askDown(t,c,o)
1 2 3 4 5
1.DE 3.500 15.500 5.000
1.FR 5.000 13.000 5.500
1.CH 8.000 9.000 7.000 8.000 1.000
2.DE 3.500 15.500 5.000
2.FR 5.000 13.000 5.500
2.CH 8.000 9.000 7.000 8.000 1.000;
Table Price_bidUp (t,c,o)
1 2 3 4 5
1.DE 4.500 10.500 13.500
1.FR 4.500 10.400 13.500 16.000
1.CH 3.000 6.000 9.000 10.000 11.000
2.DE 4.500 10.500 13.500
2.FR 4.500 10.400 13.500 16.000
2.CH 3.000 6.000 9.000 10.000 11.000;
Table Quantity_bidUp (t,c,o)
1 2 3 4 5
1.DE 6.000 15.000 4.000
1.FR 2.500 5.000 10.500 6.500
1.CH 8.000 8.000 3.000 2.000 1.000
2.DE 6.000 15.000 4.000
2.FR 2.500 5.000 10.500 6.500
2.CH 8.000 8.000 3.000 2.000 1.000;

Alias(c,c_);
Parameter
DeltaPrice_Bid(t,c,o), DeltaPrice_Ask(t,c,o)
;

Loop(t,
loop(c,
loop(o,
if ((ord(o)=1),
Deltaprice_bid(t,c,o)=Price_bidup(t,c,o);
Else Deltaprice_bid(t,c,o)=Price_bidup(t,c,o)-Price_bidup
(t,c,o-1);
if (Price_bidup(t,c,o) = 0,
Deltaprice_bid(t,c,o)=0;
);
);
);
);
);

Loop(t,
loop(c,
loop(o,
if((ord(o)=card(o) or Price_askdown(t,c,o)=0),
DEltaprice_ask(t,c,o)=0-Price_askdown(t,c,o);
Else DEltaprice_ask(t,c,o)=Price_askdown(t,c,o+1)-
Price_askdown(t,c,o)
);
);
);

);
Parameter
T_Capacity(t,c,c_)
;
T_Capacity(t,c,c_)=0;

Parameter
P_Ask(c,o), Q_Ask(c,o)
P_Bid(c,o), Q_Bid(c,o)
P_Start_Ask(c),P_Start_Bid(c)
T_Cap(c,c_)
DeltaP_Ask(c,o)
DeltaP_Bid(c,o)
;

Semicont Variables
X_Ask(c,o)
X_Bid(c,o)
;
X_ask.lo(c,o)=0;
X_ask.up(c,o)=1;
X_Bid.lo(c,o)=0;
X_Bid.up(c,o)=1;

Variables
Welfare_all
welfare(c)
Export_all(c) Export All
Export(c,c_) Export between Countrys m and m_
dP(c,c_) Preisunterschied zwischen den Ländern
Price_s(c)
Price_d(c)
Price(c)
dP(c,c_)
;

Equations
WELFARE_ Welfare all
WELFARE_Country Country Welfare
WELFARE_2
QUANTITY_Function Quantity Balance(Export-Ability)
PRICE_Supply
PRICE_Demand
PRICE_ Price Equilibrium in Country
PRICE_2
PRICE_DIfferency
EXPORT_Allocation
EXPORT_Constraint Capacity-Constraint
EXPORT_Balance_1 Export between Country
EXPORT_Balance Export Balance over all Country
EXPORT_ BAD EQUATION!!!!
;
WELFARE_..
welfare_all=e=sum(c,welfare(c));

WELFARE_Country(c)..
welfare(c)=e= sum(o, P_ask(c,o)*Q_ask(c,o)*X_ask(c,o))-sum(o,
P_bid(c,o)*Q_bid(c,o)*x_bid(c,o));
WELFARE_2(c)..
welfare(c)=g=0;

QUANTITY_Function(c)..
Export_all(c)=e= sum(o, Q_bid(c,o)*x_bid(c,o))- sum(o, Q_ask
(c,o)*x_ask(c,o));

PRICE_Supply(c)..
Price_s(c)=e=(P_start_Bid(c)+sum(o, DeltaP_bid(c,o)*x_bid
(c,o)));

PRICE_Demand(c)..
Price_d(c)=e=(P_start_Ask(c)+sum(o, DeltaP_ask(c,o)*x_ask
(c,o)));

PRICE_(c)..
Price_d(c)=e=Price_s(c);
PRICE_2(c)..
Price(c)=e=Price_d(c);
PRICE_Differency(c,c_)..
dP(c,c_)=e=Price(c)-Price(c_);
EXPORT_Allocation(c)..
Export_all(c)=e=sum(c_, Export(c,c_));

EXPORT_Constraint(c,c_)..
Export(c,c_) =l= T_Cap(c,c_);

EXPORT_Balance_1(c,c_)..
Export(c,c_) =e= -Export(c_,c);

EXPORT_Balance..
0=e= sum(c, export_all(c));
EXPORT_(c,c_)..
abs(dp(c,c_))*Export(c,c_)=e=dp(c_,c)*Export(c_,c);

Model NO_CONSTR
/
WELFARE_
WELFARE_Country
WELFARE_2
QUANTITY_Function
PRICE_Supply
PRICE_Demand
PRICE_
PRICE_2
EXPORT_Allocation
* EXPORT_Constraint
EXPORT_Balance_1
EXPORT_Balance
* EXPORT_ -bad Equation
/;
option miqcp=cplex;
*display_parameter
Parameter
welfare_all_(t), welfare__(t,c), Price__(t,c), export__(t,c,c_);


loop(t,
P_ask(c,o)=0; P_bid(c,o)=0; Q_ask(c,o)=0; Q_bid(c,o)=0;
P_ask(c,o)=price_askdown(t,c,o);
Q_ask(c,o)=quantity_askdown(t,c,o);
P_bid(c,o)=price_bidup(t,c,o);
Q_bid(c,o)=quantity_bidup(t,c,o);
P_Start_Ask(c)=price_askdown(t,c,"1");
P_Start_Bid(c)=0;
DeltaP_bid(c,o)=0; DeltaP_ask(c,o)=0;
DeltaP_bid(c,o)=deltaprice_bid(t,c,o);
DEltaP_ask(c,o)=deltaprice_ask(t,c,o);
T_Cap(c,c_)=T_capacity(t,c,c_);
solve no_constr using miqcp maximizing Welfare_all;
welfare_all_(t)=welfare_all.l;
welfare__(t,c)=welfare.l(c);
Price__(t,c)=price.l(c);
Export__(t,c,c_)=export.l(c,c_);
);

display welfare_all_, welfare__, Price__, export__
*------------------------------------------------------------------------------
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to gamsworld@googlegroups.com
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en
-~----------~----~----~----~------~----~------~--~---


Archiver
User
User
Posts: 7876
Joined: 7 years ago

Re: abs() in MIQCP with CPLEX ???does it solve??

Post by Archiver »



Dieter,

Your model (with the exception of the abs()) part is linear. Soi if
you do the trick I explained in my earlier email, you end up with a
MIP which can be solved by Cplex. You also should look at your choice
of variable type for X_Ask and X_Bid. You selected semi-conituous
variables and you set the lower bound to 0. That does not make sense.
Please revisit the documentation about semi-continuous variables. They
either take the value 0 or some value between the lower bound and the
upper bound. If the lower bound it set to zero they are just
continuous variables.
On the bounds for dp and Export. You have explicit bounds for Export
(limited by T_Cap). The constraints PRICE_Supply and PRICE_Demand
together with bounds on X_* give you bounds on price and therefor
bounds on dp. So you can figure out a bigM.

I don't understand too much about your application area and it is not
possible for me to dive into this, so I can't give you advise on the
big picture.

Hope this helps anyway.
Michael Bussieck - GAMSWorld Coordinator

On Jan 7, 5:43 am, "dieter.kunstm...@googlemail.com"
wrote:
> > Thank You very much Michael,
> > my primary Variables are the Values X_BID and X_ASK, wich i
> > charaterise Order-Allocation in each Country.
> > *--------------------------------------------
> > Semicont Variables
> > X_Ask(c,o), X_Bid(c,o)
> > ;
> > X_ask.lo(c,o)=0;
> > X_ask.up(c,o)=1;
> > X_Bid.lo(c,o)=0;
> > X_Bid.up(c,o)=1;
> > *-------------------------------------------
> > i would like to calculate three different Markt.Equilibrium:
> > 1) without exports (self-Sufficiently, dp=0, Export=0)
> > 2) with Export, without Transport--Congestion ( max Export(c,c_)=(-
> > inf...+inf)- the Value will be calculate, dP-Bound is it unknown)
> > 3) with Export, but with Transport-Congestion ( max Export(c,c_)=le=
> > Transport_Capacity(c,_c), dP-Bound also is't unknown)
> >
> > i can not pre estimate, how high the Value are ..:-(
> >
> > can the problem other be solved?
> >
> > my Test-Quellcode
> > *-------------------------------------------------------
> > SETs
> > t/1*2/,
> > c/DE,FR,CH/,
> > o OrderID/1*10/;
> > Table Price_askDown(t,c,o)
> > 1 2 3 4 5
> > 1.DE 14.000 10.500 4.000
> > 1.FR 14.500 12.000 5.000
> > 1.CH 22.000 16.000 14.000 7.000 3.000
> > 2.DE 14.000 10.500 4.000
> > 2.FR 14.500 12.000 5.000
> > 2.CH 22.000 16.000 14.000 7.000 3.000
> > ;
> > Table Quantity_askDown(t,c,o)
> > 1 2 3 4 5
> > 1.DE 3.500 15.500 5.000
> > 1.FR 5.000 13.000 5.500
> > 1.CH 8.000 9.000 7.000 8.000 1.000
> > 2.DE 3.500 15.500 5.000
> > 2.FR 5.000 13.000 5.500
> > 2.CH 8.000 9.000 7.000 8.000 1.000;
> > Table Price_bidUp (t,c,o)
> > 1 2 3 4 5
> > 1.DE 4.500 10.500 13.500
> > 1.FR 4.500 10.400 13.500 16.000
> > 1.CH 3.000 6.000 9.000 10.000 11.000
> > 2.DE 4.500 10.500 13.500
> > 2.FR 4.500 10.400 13.500 16.000
> > 2.CH 3.000 6.000 9.000 10.000 11.000;
> > Table Quantity_bidUp (t,c,o)
> > 1 2 3 4 5
> > 1.DE 6.000 15.000 4.000
> > 1.FR 2.500 5.000 10.500 6.500
> > 1.CH 8.000 8.000 3.000 2.000 1.000
> > 2.DE 6.000 15.000 4.000
> > 2.FR 2.500 5.000 10.500 6.500
> > 2.CH 8.000 8.000 3.000 2.000 1.000;
> >
> > Alias(c,c_);
> > Parameter
> > DeltaPrice_Bid(t,c,o), DeltaPrice_Ask(t,c,o)
> > ;
> >
> > Loop(t,
> > loop(c,
> > loop(o,
> > if ((ord(o)=1),
> > Deltaprice_bid(t,c,o)=Price_bidup(t,c,o);
> > Else Deltaprice_bid(t,c,o)=Price_bidup(t,c,o)-Price_bidup
> > (t,c,o-1);
> > if (Price_bidup(t,c,o) = 0,
> > Deltaprice_bid(t,c,o)=0;
> > );
> > );
> > );
> > );
> > );
> >
> > Loop(t,
> > loop(c,
> > loop(o,
> > if((ord(o)=card(o) or Price_askdown(t,c,o)=0),
> > DEltaprice_ask(t,c,o)=0-Price_askdown(t,c,o);
> > Else DEltaprice_ask(t,c,o)=Price_askdown(t,c,o+1)-
> > Price_askdown(t,c,o)
> > );
> > );
> > );
> >
> > );
> > Parameter
> > T_Capacity(t,c,c_)
> > ;
> > T_Capacity(t,c,c_)=0;
> >
> > Parameter
> > P_Ask(c,o), Q_Ask(c,o)
> > P_Bid(c,o), Q_Bid(c,o)
> > P_Start_Ask(c),P_Start_Bid(c)
> > T_Cap(c,c_)
> > DeltaP_Ask(c,o)
> > DeltaP_Bid(c,o)
> > ;
> >
> > Semicont Variables
> > X_Ask(c,o)
> > X_Bid(c,o)
> > ;
> > X_ask.lo(c,o)=0;
> > X_ask.up(c,o)=1;
> > X_Bid.lo(c,o)=0;
> > X_Bid.up(c,o)=1;
> >
> > Variables
> > Welfare_all
> > welfare(c)
> > Export_all(c) Export All
> > Export(c,c_) Export between Countrys m and m_
> > dP(c,c_) Preisunterschied zwischen den Ländern
> > Price_s(c)
> > Price_d(c)
> > Price(c)
> > dP(c,c_)
> > ;
> >
> > Equations
> > WELFARE_ Welfare all
> > WELFARE_Country Country Welfare
> > WELFARE_2
> > QUANTITY_Function Quantity Balance(Export-Ability)
> > PRICE_Supply
> > PRICE_Demand
> > PRICE_ Price Equilibrium in Country
> > PRICE_2
> > PRICE_DIfferency
> > EXPORT_Allocation
> > EXPORT_Constraint Capacity-Constraint
> > EXPORT_Balance_1 Export between Country
> > EXPORT_Balance Export Balance over all Country
> > EXPORT_ BAD EQUATION!!!!
> > ;
> > WELFARE_..
> > welfare_all=e=sum(c,welfare(c));
> >
> > WELFARE_Country(c)..
> > welfare(c)=e= sum(o, P_ask(c,o)*Q_ask(c,o)*X_ask(c,o))-sum(o,
> > P_bid(c,o)*Q_bid(c,o)*x_bid(c,o));
> > WELFARE_2(c)..
> > welfare(c)=g=0;
> >
> > QUANTITY_Function(c)..
> > Export_all(c)=e= sum(o, Q_bid(c,o)*x_bid(c,o))- sum(o, Q_ask
> > (c,o)*x_ask(c,o));
> >
> > PRICE_Supply(c)..
> > Price_s(c)=e=(P_start_Bid(c)+sum(o, DeltaP_bid(c,o)*x_bid
> > (c,o)));
> >
> > PRICE_Demand(c)..
> > Price_d(c)=e=(P_start_Ask(c)+sum(o, DeltaP_ask(c,o)*x_ask
> > (c,o)));
> >
> > PRICE_(c)..
> > Price_d(c)=e=Price_s(c);
> > PRICE_2(c)..
> > Price(c)=e=Price_d(c);
> > PRICE_Differency(c,c_)..
> > dP(c,c_)=e=Price(c)-Price(c_);
> > EXPORT_Allocation(c)..
> > Export_all(c)=e=sum(c_, Export(c,c_));
> >
> > EXPORT_Constraint(c,c_)..
> > Export(c,c_) =l= T_Cap(c,c_);
> >
> > EXPORT_Balance_1(c,c_)..
> > Export(c,c_) =e= -Export(c_,c);
> >
> > EXPORT_Balance..
> > 0=e= sum(c, export_all(c));
> > EXPORT_(c,c_)..
> > abs(dp(c,c_))*Export(c,c_)=e=dp(c_,c)*Export(c_,c);
> >
> > Model NO_CONSTR
> > /
> > WELFARE_
> > WELFARE_Country
> > WELFARE_2
> > QUANTITY_Function
> > PRICE_Supply
> > PRICE_Demand
> > PRICE_
> > PRICE_2
> > EXPORT_Allocation
> > * EXPORT_Constraint
> > EXPORT_Balance_1
> > EXPORT_Balance
> > * EXPORT_ -bad Equation
> > /;
> > option miqcp=cplex;
> > *display_parameter
> > Parameter
> > welfare_all_(t), welfare__(t,c), Price__(t,c), export__(t,c,c_);
> >
> > loop(t,
> > P_ask(c,o)=0; P_bid(c,o)=0; Q_ask(c,o)=0; Q_bid(c,o)=0;
> > P_ask(c,o)=price_askdown(t,c,o);
> > Q_ask(c,o)=quantity_askdown(t,c,o);
> > P_bid(c,o)=price_bidup(t,c,o);
> > Q_bid(c,o)=quantity_bidup(t,c,o);
> > P_Start_Ask(c)=price_askdown(t,c,"1");
> > P_Start_Bid(c)=0;
> > DeltaP_bid(c,o)=0; DeltaP_ask(c,o)=0;
> > DeltaP_bid(c,o)=deltaprice_bid(t,c,o);
> > DEltaP_ask(c,o)=deltaprice_ask(t,c,o);
> > T_Cap(c,c_)=T_capacity(t,c,c_);
> > solve no_constr using miqcp maximizing Welfare_all;
> > welfare_all_(t)=welfare_all.l;
> > welfare__(t,c)=welfare.l(c);
> > Price__(t,c)=price.l(c);
> > Export__(t,c,c_)=export.l(c,c_);
> > );
> >
> > display welfare_all_, welfare__, Price__, export__
> > *--------------------------------------------------------------------------­----
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to gamsworld@googlegroups.com
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en
-~----------~----~----~----~------~----~------~--~---


Archiver
User
User
Posts: 7876
Joined: 7 years ago

Re: abs() in MIQCP with CPLEX ???does it solve??

Post by Archiver »



Thank Your very much Michael!!

i have solved my Problem with dp(c,c_)/Exp(c,c_)=g=0 :-)

many Thanks
Dieter
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to gamsworld@googlegroups.com
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en
-~----------~----~----~----~------~----~------~--~---


Post Reply