339 presolve messages suppressed

Hello, this is my .run and .mod

# CONJUNTOS

set T ordered ; # periodos
set B default {} ; # barras

set G  ; # generadores
set D  ; # demandas

set Gn within {G, B} ; # conexion de generadores
set Dn within {D, B} ; # conexion de demandas

set L dimen 2;
set FROM = setof {(i,j) in L} j;
set TO = setof {(i,j) in L} i;

# ----------------------------------------------------
# PARAMETROS

# Parametros del generador

param po {G,T} >= 0 ; # precio de oferta
param pmin	{G} >= 0 ; # potencia minima de generacion de cada G
param pmax  {G} >= 0 ; # capacidad ofertada
param fmax  {L} >= 0 ; # capacidad por linea
param xlin  {L} >= 0 ; # reactancia de la linea

# Parametros de la demanda
param dem  {D} >= 0 ; # potencia consumida
param prfl_dem {D,T} >= 0 ; # perfil de demanda / dem

var An {B, T} ; # angulo de la tension en el nodo
var Pi {g in G, t in T}      >=  pmin[g],          <= pmax[g] ; # potencia inyectada
var Fl {(n, m) in L, t in T} >= -fmax[n, m], <= fmax[n, m] ; # flujo por lineas

# ----------------------------------------------------

minimize Costos_Oper {t in T}:	
    sum {g in G} po[g,t]*Pi[g,t];
 
s.t. Balance_Demanda {n in B, t in T }:
	sum {(g, n) in Gn} Pi[g, t] - sum{(d, n) in Dn} dem[d]*prfl_dem[d, t] 
		= sum{(n, m) in L} Fl[n, m, t] + sum{(m, n) in L} -Fl[m, n, t] ;
	
s.t. Flujo_Lineas {(n, m) in L, t in T }:
	Fl[n, m, t] = (An[n, t] - An[m, t])/xlin[n, m] ;
**.run
reset;
load amplxl.dll;
model a.mod;

table Tiempo IN "amplxl" "DTU-Perfiles.xlsx" "periods":
T <- [T];
read table Tiempo;
#------------------------------------------------------------------------------

table Generacion IN "amplxl" "libro.xlsx" "gen":
[G] IN, pmax,pmin;

table Demandas IN "amplxl" "libro.xlsx" "dem":
[D] IN, dem;

table Perfil_Demandas IN "amplxl" "DTU-Perfiles.xlsx" "dem" "2D":
[D, T], prfl_dem;

table GeneracionCX IN "amplxl" "libro.xlsx" "gen":
Gn <- [G, B];

table DemandaCX    IN "amplxl" "libro.xlsx" "dem":
Dn <- [D, B];

table precio IN "amplxl" "DTU-Perfiles.xlsx" "pre" "2D":[G,T], po;

read table Generacion;
read table Demandas;
read table Perfil_Demandas;
read table GeneracionCX;
read table DemandaCX;
read table precio;

#------------------------------------------------------------------------------

table Lineas IN "amplxl" "libro.xlsx" "lin":
L <- [FROM, TO], fmax, xlin;

read table Lineas;
let B := FROM union TO;
#------------------------------------------------------------------------------
fix {t in T} An['n1', t] := 0.0;

option solver HiGHS;                
solve;

display Pi, dem, An, Fl;

This is my Spreadsheet “precio”

image

Im trying to solve a non linear problem, but it seems like its unable to solve. Im not sure if im making a mistake in my code or the license im using isn´t able to solve the problem

Hi @Natalia ,
Can you please post the error message that you are getting?
Thank you!

Hi @Nicolau_Santos,
This is the error message

presolve: constraint Balance_Demanda[‘n15’,‘hour 22’] cannot hold:

body >= 244.191 cannot be <= 215.095; difference = 29.0956

presolve: constraint Balance_Demanda[‘n15’,‘hour 21’] cannot hold:

body >= 267.727 cannot be <= 215.095; difference = 52.632

presolve: constraint Balance_Demanda[‘n15’,‘hour 20’] cannot hold:

body >= 282.437 cannot be <= 215.095; difference = 67.3423

presolve: constraint Balance_Demanda[‘n15’,‘hour 19’] cannot hold:

body >= 294.205 cannot be <= 215.095; difference = 79.1105

presolve: constraint Balance_Demanda[‘n15’,‘hour 18’] cannot hold:

body >= 294.205 cannot be <= 215.095; difference = 79.1105

339 presolve messages suppressed.

Hi @Natalia

The error message indicates that the problem has no feasible solution and that the cause for that are the mentioned constraints.

You probably should first check if all the data is being passed correctly to AMPL. You can do that with the display command, for example

display T;

and so on for the remaining data.

If all the data is correct you need to check if the “Balance_Demanda” constraint was translated from the mathematical model as intended and that the constraint is doing what you think it should do. For that you can use the expand command, for example

expand Balance_Demanda['n15','hour 22'];

to expand a single constraint or

expand Balance_Demanda;

to expand all of them.