Maxplus Function
Last update : 18/05/2014

fluide - network nonlinear flow ( water )

Calling Sequence

[v,q,niter]=fluide(H,d,r,a,err)

Parameters

Description

Compute the water flows in a distribution network by solving the following optimization problem:

Min_q 1/3 q'diag(|q|/r) q

Hq=d

Where the nonlinear operations appearing in the criterium must be understood componentwise.

The method used is the Hamam method which is a newton method in the space in the space (q,v) , where v denotes the dual variable associated to the constraints Hq=d .

a must be taken small. It regularizes the matrices giving the potentials.

Examples

m=500; n=1000;
// generates a random admittance matrix
r=max(rand(n,1),0.1);
// generates a random incidence matrix
H=spzeros(m,n);
for j=1:n
  ij=ceil(m*rand(2,1));
  H(ij(1),j)=1;
  H(ij(2),j)=-1;
end
// generates a random demand of nul average
d=rand(m,1);
moy=d'*ones(m,1)/m;
d=d-moy;
// compute the flows and potentials and gives the
// computation time
timer();[v,q,iter1]=fluide(H,d,r,0.01,0.001);timer()  

 

See Also

costo,  howard,  Wardrop,