Problem infeasible or unbounded

Problems with modeling
Post Reply
Luke
User
User
Posts: 1
Joined: 10 months ago

Problem infeasible or unbounded

Post by Luke »

I am using GAMS for the first time. Very appreciate if anyone could help me and have a look for what I did wrong.

Thanks a lot


$title Stromkostenminimierung

Set
t 'Stundenintervall' /Intervall_1,Intervall_2,Intervall_3,Intervall_4,Intervall_5,Intervall_6,Intervall_7,Intervall_8,Intervall_9,Intervall_10,Intervall_11,Intervall_12,Intervall_13,Intervall_14,Intervall_15,Intervall_16,Intervall_17,Intervall_18,Intervall_19,Intervall_20,Intervall_21,Intervall_22,Intervall_23,Intervall_24/;

Parameters
p_feed_in 'Einspeisevergütung in CHF pro kWh' /0.215/
Inv_pv 'Investitionskosten PV Module in CHF pro kWp' /3000/
An1_pv 'Annuität PV Anlage' /0.0333/
An2_pv 'Unterhaltskosten abhängig von den Investitionskosten' /0.013/;

Parameter
c_var_elec(t) 'Stromtarif in CHF pro kWh gültig in Stundenintervall t'
/Intervall_1 0.248
Intervall_2 0.248
Intervall_3 0.248
Intervall_4 0.248
Intervall_5 0.248
Intervall_6 0.248
Intervall_7 0.248
Intervall_8 0.283
Intervall_9 0.318
Intervall_10 0.318
Intervall_11 0.318
Intervall_12 0.318
Intervall_13 0.318
Intervall_14 0.318
Intervall_15 0.318
Intervall_16 0.318
Intervall_17 0.318
Intervall_18 0.318
Intervall_19 0.318
Intervall_20 0.283
Intervall_21 0.248
Intervall_22 0.248
Intervall_23 0.248
Intervall_24 0.248/;

Parameter
e_household(t) 'Stromverbrauch in kWh in Stundenintervall t'
/Intervall_1 146
Intervall_2 146
Intervall_3 146
Intervall_4 146
Intervall_5 146
Intervall_6 182
Intervall_7 182
Intervall_8 182
Intervall_9 182
Intervall_10 182
Intervall_11 263
Intervall_12 601
Intervall_13 146
Intervall_14 146
Intervall_15 146
Intervall_16 146
Intervall_17 146
Intervall_18 146
Intervall_19 255
Intervall_20 237
Intervall_21 219
Intervall_22 219
Intervall_23 219
Intervall_24 219/;

Parameter
e_pv(t) 'PV Stromproduktion in kWh pro kWp in Stundenintervall t'
/Intervall_1 0
Intervall_2 0
Intervall_3 0
Intervall_4 0
Intervall_5 0
Intervall_6 0
Intervall_7 2
Intervall_8 10
Intervall_9 25
Intervall_10 54
Intervall_11 88
Intervall_12 111
Intervall_13 123
Intervall_14 124
Intervall_15 128
Intervall_16 110
Intervall_17 88
Intervall_18 57
Intervall_19 20
Intervall_20 4
Intervall_21 0
Intervall_22 0
Intervall_23 0
Intervall_24 0/;

Variables
e_grid(t) 'Energiebezug aus dem Netz in kWh'
e_pv2grid(t) 'Energiefluss von PV-Anlage ins Netz in kWh'
e_pv2household(t) 'Energiefluss von PV-Anlage ins Haushaltsnetz in kWh'
p_peak 'Spitzenleistung der PV-Anlage in kWp'
z 'Total Stromkosten pro Jahr in CHF';

Equations
cost 'Zielfunktion'
capacity 'Kapazitätslimit'
demand 'Nachfrage'
peak 'Spitzenleistung in kWp';

cost.. z =e= sum(t,e_grid(t)*c_var_elec(t)-e_pv2grid(t)*p_feed_in)+(An1_pv+An2_pv)*Inv_pv*p_peak;
capacity.. sum(t,e_pv2household(t)+e_pv2grid(t)) =l= sum(t,e_pv(t)*p_peak);
demand.. sum(t,e_pv2household(t)+e_grid(t)) =g= sum(t,e_household(t));
peak.. p_peak =l= 5.5;

Model Stromkostenminimierung /all/;

solve Stromkostenminimierung using lp minimizing z;


--- Job Stromkostenminimierung ohne Speicher.gms Start 06/24/23 03:22:45 43.2.0 859d62d5 WEX-WEI x86 64bit/MS Windows
--- Applying:
C:\GAMS\43\gmsprmNT.txt
--- GAMS Parameters defined
Input "C:\Users\lukas\OneDrive\Dokumente\Master-Arbeit\Stromkostenminimierung ohne Speicher.gms"
PageSize 0
ScrDir C:\Users\lukas\OneDrive\Dokumente\Master-Arbeit\225a\
SysDir C:\GAMS\43\
LogOption 3
ErrMsg 1
ErrorLog 99
IDE 1
GDX "C:\Users\lukas\OneDrive\Dokumente\Master-Arbeit\Stromkostenminimierung ohne Speicher.gdx"
LstTitleLeftAligned 1
Licensee: GAMS Demo license for Lukas Jaeger G230614|0002CO-GEN
Universitaet Basel, Switzerland DL094421
C:\Users\lukas\OneDrive\Dokumente\GAMS\gamslice.txt
lukas.jaeger@stud.unibas.ch, Lukas Jaeger
Demo license for demonstration and instructional purposes only
Processor information: 1 socket(s), 2 core(s), and 4 thread(s) available
GAMS 43.2.0 Copyright (C) 1987-2023 GAMS Development. All rights reserved
--- Starting compilation
--- Stromkostenminimierung ohne Speicher.gms(113) 3 Mb[FIL:"C:\Users\lukas\OneDrive\Dokumente\Master-Arbeit\Stromkostenminimierung ohne Speicher.gms",113,0]
--- Starting execution: elapsed 0:00:00.042[LST:122]
--- Generating LP model Stromkostenminimierung[LST:122]
--- Stromkostenminimierung ohne Speicher.gms(113) 4 Mb[FIL:"C:\Users\lukas\OneDrive\Dokumente\Master-Arbeit\Stromkostenminimierung ohne Speicher.gms",113,0]
--- 4 rows 74 columns 148 non-zeroes
--- Range statistics (absolute non-zero finite values)
--- RHS [min, max] : [ 5.500E+00, 4.748E+03] - Zero values observed as well
--- Bound [min, max] : [ NA, NA]
--- Matrix [min, max] : [ 2.150E-01, 9.440E+02]
--- Executing CPLEX (Solvelink=2): elapsed 0:00:00.060[LST:235]

IBM ILOG CPLEX 43.2.0 859d62d5 May 4, 2023 WEI x86 64bit/MS Window

--- *** This solver runs with a demo license. No commercial use.
--- GMO setup time: 0.00s
--- GMO memory 0.51 Mb (peak 0.51 Mb)
--- Dictionary memory 0.00 Mb
--- Cplex 22.1.1.0 link memory 0.00 Mb (peak 0.01 Mb)
--- Starting Cplex

Version identifier: 22.1.1.0 | 2022-11-27 | 9160aff4d
CPXPARAM_Advance 0
CPXPARAM_Simplex_Display 2
CPXPARAM_Threads 1
CPXPARAM_MIP_Display 4
CPXPARAM_MIP_Pool_Capacity 0
CPXPARAM_MIP_Tolerances_AbsMIPGap 0
Dual infeasible due to empty column 'e_grid(Intervall_8)'.
Presolve time = 0.00 sec. (0.01 ticks)

--- LP status (4): unbounded or infeasible.
--- Cplex Time: 0.00sec (det. 0.01 ticks)

*** WARNING: Presolve found the problem infeasible or unbounded
--- Cplex diagnoses the model to be either infeasible or unbounded.
--- There is no such GAMS Model Status so returning with a status of infeasible.
--- Model has been proven to be either infeasible or unbounded
--- Reading solution for model Stromkostenminimierung[LST:247]
--- GDX File C:\Users\lukas\OneDrive\Dokumente\Master-Arbeit\Stromkostenminimierung ohne Speicher.gdx[FIL:"C:\Users\lukas\OneDrive\Dokumente\Master-Arbeit\Stromkostenminimierung ohne Speicher.gdx",0,0]
*** Status: Normal completion[LST:293]
--- Job Stromkostenminimierung ohne Speicher.gms Stop 06/24/23 03:22:45 elapsed 0:00:00.112
User avatar
bussieck
Moderator
Moderator
Posts: 1043
Joined: 7 years ago

Re: Problem infeasible or unbounded

Post by bussieck »

Nothing. You should use code boxes for your model and output though. You model in unbounded. Just limit the objective variable (e.g. z.lo = -1e6;) and see what "run away" variables you get. Check your application why this should not happen, turn your insight into constraints/model logic.

-Michael
Post Reply