
From:  Jeffrey Kantor 
Subject:  Re: [Helpglpk] [Fwd: How to rewrite a nonlinear expression in a linear one] 
Date:  Mon, 1 Apr 2013 18:47:28 0400 
 Forwarded Message 
From: Sina Burkhardt <address@hidden>
To: address@hidden
Subject: How to rewrite a nonlinear _expression_ in a linear one
Date: Mon, 1 Apr 2013 23:31:16 +0200
Hi all,
I’m currently writing my Master thesis and I hope someone can help me to
solve the following problem(s) with my model as quickly as possible.
I use glpk(gusek) and my model needs unfortunately two nonlinear
expressions.
Is there any possibility to rewrite these nonlinear expressions into
linear ones to solve it with gusek?
Or can I assign a solution value of var to an parameter or something
like that to avoid the nonlinear type?
Here’s an abstract of the model : (the “problems” are red labeled)
###Declarations####
param T, integer; #horizont of time
set D; # DemandPoints
/*Periodenzeitraum*/
set P, default{1..T}; # Planungshorizont T
var susceptible{j in D,t in 0..T}>=0,integer;
var N{j in D,t in 0..T}>=0,integer; # Population
at DemandPoint j in periode t
var I{j in D,t in 0..T}>=0; # Persons who are
infected at DemandPoint j in periode t
var I_nB{j in D,t in 0..T}>=0,integer #Infected without treatment at
DemandPoint j in periode t
var I_neu{j in D,t in P}>=0; # add.
infected persons in j in t
var lambda{j in D,t in P}>=0; #Infectionrate
/*Index of contagions*/
param c, >=0,<=1;
/*contactrate*/
param kappa{D};
param beta{j in D}:=kappa[j]*c;
/*Init. in t=0*/
init_Population{j in D}: N[j,0]=init_N0[j];
init_Infiziert{j in D}: I[j,0]=init_I0[j];
init_Gesund{j in D}: susceptible[j,0]=N[j,0]I[j,0];
population{j in D,t in P}: N[j,t]=susceptible[j,t]+I[j,t]; #with var
I{j in D,t in P}
Gesunde{j in D,t in P}: susceptible[j,t]= susceptible[j,t1]
I_neu[j,t];
#Calculate infectionrate
s.t. infekt_rate{j in D,t in P}: lambda[j,t]=beta[j]*
(I_nB[j,t1] /N[j,t1]); #Here’s the first Problem because its nonlinear
and glpk can not solve NLP.
#Calculate the new infected persons
Neuinfiziert{j in D,t in P}: I_neu[j,t]=
lambda[j,t]*susceptible[j,t1];
# example data
data;
set D:= D1;
param T:=3;
param c:=0.2;
param kappa:= D1 10;
param init_N0:= D1 100000;
param init_I0:= D1 1000;
end;
I would be very happy about your help.
Thanks in advance.
Regards,
Sina
_______________________________________________
Helpglpk mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/helpglpk
[Prev in Thread]  Current Thread  [Next in Thread] 