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”
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