File: pipe_network.cat

package info (click to toggle)
scilab 2.6-4
  • links: PTS
  • area: non-free
  • in suites: woody
  • size: 54,632 kB
  • ctags: 40,267
  • sloc: ansic: 267,851; fortran: 166,549; sh: 10,005; makefile: 4,119; tcl: 1,070; cpp: 233; csh: 143; asm: 135; perl: 130; java: 39
file content (36 lines) | stat: -rw-r--r-- 1,388 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
pipe_network        Scilab Group        Scilab function        pipe_network
NAME
   pipe_network - solves the pipe network problem
  
CALLING SEQUENCE
 [x,pi] = pipe_network(g)
PARAMETERS
 g  : graph list
    
 x  : row vector of the value of the flow on the arcs
    
 pi : row vector of the value of the potential on the nodes
    
DESCRIPTION
   pipe_network returns the value of the flows and of the potentials for the
  pipe network problem: flow problem with two Kirchhoff laws. The graph
  must be directed. The problem must be feasible (the sum of the node
  demands must be equal to 0). The resistances on the arcs must be strictly
  positive and are given as the values of the element 'edge_weigth' of the
  graph list.  The problem is solved by using sparse matrices LU
  factorization.
  
EXAMPLE
 ta=[1 1 2 2 3 3 4 4 5 5 5 5 6 6 6 7 7 15 15 15 15 15 15];
 ta=[ta, 15 8 9 10 11 12 13 14];
 he=[10 13 9 14 8 11 9 11 8 10 12 13 8 9 12 8 11 1 2 3 4];
 he=[he, 5 6 7 16 16 16 16 16 16 16];
 n=16;
 g=make_graph('foo',1,n,ta,he);
 g('node_x')=[42 615 231 505 145 312 403 233 506 34 400 312 142 614 260 257];
 g('node_y')=[143 145 154 154 147 152 157 270 273 279 269 273 273 274 50 376];
 show_graph(g);
 g('node_demand')=[0 0 0 0 0 0 0 0 0 0 0 0 0 0 -100 100];
 w = [1 3 2 6 4 7 8 1 2 2 2 4 7 8 9 2 3 5 7 3 2 5 8 2 5 8];
 g('edge_weight')=[w, 6 4 3 5 6];
 [x,pi] = pipe_network(g)