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:
- without exports (self-Sufficiently, dp=0, Export=0)
- with Export, without Transport–Congestion ( max Export(c,c_)=(-
inf…+inf)- the Value will be calculate, dP-Bound is it unknown)
- 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/12/,
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
-~----------~----~----~----~------~----~------~–~—
\