Modeling Multi-period Profit Maximization for Two Companies Under Non-cooperative Game

Dear Teacher/Expert, Hello! The following is my consultation on the core problem and modeling ideas of the “dynamic game of water-electricity joint operation between two non-cooperative companies”, attached with the reference GAMS code framework. I doubt whether the previously attempted weighted normalization method is suitable for non-cooperative scenarios, and sincerely request your guidance.

I. Core Problem

There are two non-cooperative companies (A and B) in the system, both aiming to maximize their own total profits (A: power generation profit + water transfer compensation; B: water sales revenue - water transfer compensation). Company B needs to transfer water from Company A’s reservoir (total annual water transfer volume is fixed, distributed independently per ten-day period). Decisions have inter-temporal impacts (power generation/water transfer/abandonment affect reservoir water level, which in turn affects subsequent power generation). The previously attempted “weighted normalization” (integrating dual objectives into a single objective) is essentially cooperative optimization, which cannot reflect the logic of non-cooperative games. I need to consult a reasonable modeling scheme.

II. Consultation on Modeling Ideas

For the above non-cooperative dynamic game, it is proposed to model using the Stackelberg game (A as leader, B as follower) or Nash equilibrium framework. Core ideas: 1. Game type: Since Company A controls reservoir resources, it can be set that A decides power generation flow first, and B decides water transfer volume later (Stackelberg); if equal in status, Nash equilibrium (simultaneous decision-making) is adopted; 2. Dynamics: Correlate decisions of each period through water level time-series recurrence; 3. Solution: Solve the optimal decision sequence based on subgame perfect equilibrium. Sincerely request your guidance on the rationality and optimization direction of this idea.

III. Explanation of GAMS Code Framework for Non-Cooperative Dynamic Game

The following is the GAMS code framework based on the “Stackelberg game (A as leader, B as follower)”. The core logic is “hierarchical solution” (first solve for Company A’s optimal power generation flow, then solve for Company B’s optimal water transfer volume). I sincerely request your guidance on the rationality and optimization direction of the code.

$eolcom // 
// 1. Set Definition (36 ten-day periods in a year)
SET t /t1*t36/;

// 2. Parameter Definition (pre-fixed constants, cannot be modified by constraints)
PARAMETER
*Power factor (fixed constant)
k /0.8/                          
*Company A's power generation unit price (yuan/kWh, known in advance)
price_pow_A(t) /t1 0.5, t2 0.52, t3*t36 0.51/  
*Company B's total annual water transfer volume (10,000 m³, fixed constraint value)
Y_total /1000/                   
*Inflow discharge per ten-day period (10,000 m³, natural input, known in advance)
Q_in(t) /t1 50, t2 55, t3*t36 52/ 
*Reservoir area-related parameter (10,000 m³/m, fixed engineering parameter)
S /10/                           
*Company A's maximum power generation flow (10,000 m³/ten-day period, engineering upper limit)
X_max /30/                       
*Maximum water transfer flow (10,000 m³/ten-day period, engineering upper limit)
Y_max /50/                       
*Company B's water sales unit price (yuan/m³, known in advance)
price_water_B /0.8/               
*Company B's power purchase price (yuan/kWh, known in advance)
price_pow_B(t) /t1 0.6, t2 0.63, t3*t36 0.62/  
*Coefficient of power purchase volume and water transfer flow (Power purchase volume = 0.1×y(t), fixed ratio)
coeff_power /0.1/                
*Big M parameter (take the maximum possible value of water transfer price, used for conditional constraint conversion, avoiding endogenous $ operation)
M /10/;                          

// 3. Variable Definition (endogenous variables, values determined by model solution)
VARIABLES
*Company A's power generation flow in the t-th ten-day period (10,000 m³)
x(t)          
*Company B's water transfer volume in the t-th ten-day period (10,000 m³)
y(t)          
*Company A's abandoned water flow in the t-th ten-day period (10,000 m³)
q_abandon(t)  
*Company A's total profit (yuan)
pi_A          
*Company B's total profit (yuan)
pi_B          
*Total objective function (after dual-objective conversion)
obj_total   
*Company A's water transfer price in the t-th ten-day period (yuan/m³, endogenous, varying with water abandonment status)
price_wat_A(t)
*Reservoir water level in the t-th ten-day period (m, endogenous, varying with time-series decisions)
h(t)
*Binary variable: indicates whether there is water abandonment (1=abandonment, 0=no abandonment), used for conditional constraint conversion
delta(t)
;                         

POSITIVE VARIABLES x, y, q_abandon, price_wat_A, h; // Non-negative variables: flow, price, water level cannot be negative
BINARY VARIABLE delta(t);  // Declare binary variable separately (value is only 0 or 1)

// 4. Constraint Conditions
EQUATIONS
*Company A's profit calculation formula
eq_pi_A        
*Company B's profit calculation formula
eq_pi_B        
*Company B's total annual water transfer volume constraint
eq_Y_total     
*Reservoir water balance constraint
eq_water_bal(t)
*Company A's power generation flow upper limit constraint
eq_x_max(t)    
*Company B's water transfer flow upper limit constraint
eq_y_max(t)    
*Water level time-series recurrence constraint
eq_h_recur(t)  
*Constraint 1 for water transfer price = 0 when there is water abandonment
eq_price_wat1(t)
*Constraint 2 for water transfer price = 0 when there is water abandonment
eq_price_wat2(t);

// Constraint Expressions
eq_pi_A..        pi_A =E= SUM(t, price_pow_A(t)*k*x(t)*h(t) + price_wat_A(t)*y(t)); // Company A's profit = power generation profit + water transfer compensation
eq_pi_B..        pi_B =E= SUM(t, price_water_B*y(t) - price_wat_A(t)*y(t) - price_pow_B(t)*coeff_power*y(t)); // Company B's profit = water sales revenue - water transfer compensation - power purchase cost
eq_Y_total..     SUM(t, y(t)) =E= Y_total; // Company B's total annual water transfer volume is fixed
eq_water_bal(t)..Q_in(t) =E= x(t) + y(t) + q_abandon(t) + (h(t+1)-h(t))*S; // Reservoir water balance: inflow = power generation + water transfer + abandonment + capacity change
eq_x_max(t)..    x(t) =L= X_max; // Power generation flow does not exceed upper limit
eq_y_max(t)..    y(t) =L= Y_max; // Water transfer flow does not exceed upper limit
eq_h_recur(t)..  h(t+1) =E= h(t) + (Q_in(t)-x(t)-y(t)-q_abandon(t))/S; // Water level recurrence: next period's water level = current water level + capacity change/area parameter
// Water transfer price = 0 when there is water abandonment: converted by Big M method (replacing original endogenous $ operation to avoid Error 53)
// Logic 1: If there is water abandonment (delta(t)=1), then price_wat_A(t) ≤ 0 (since price is non-negative, price_wat_A(t)=0)
eq_price_wat1(t)..price_wat_A(t) =L= M*(1 - delta(t));
// Logic 2: If there is no water abandonment (delta(t)=0), then q_abandon(t) ≤ 1e-6 (avoid numerical errors, regarded as no water abandonment)
eq_price_wat2(t)..q_abandon(t) =L= 1e-6 + M*delta(t);

// 5. Dual-objective Conversion and Solution (model type revised to DNLP, adapting to conditional constraints)
// Simplify dual-objective conversion to single objective using weighted sum method, weights w1 and w2 can be adjusted
PARAMETER w1 /0.5/, w2 /0.5/; 

EQUATION eq_obj_total;
eq_obj_total.. obj_total =E= w1*pi_A + w2*pi_B; // Weighted sum total objective function

// Model Definition and Solution (select DNLP solver to support conditional constraints with binary variables)
MODEL game_model /all/;
SOLVE game_model MAXIMIZE obj_total USING MINLP; // Select DNLP solver to adapt to binary variables and conditional constraints

// Result Output
DISPLAY x.l, y.l, q_abandon.l, h.l, price_wat_A.l, delta.l, pi_A.l, pi_B.l; // Output solution values of variables (.l denotes level value)