Appendix G

Computer Programs for One-Dimensional and Two-Dimensional Problems

G.1 COMPUTER PROGRAM FOR THE FLOW NETWORK ANALYSIS

For the pipe network problem considered in Chapter 6, Section 6.11, a computer program in one-dimensional has been developed using the Matlab package. The detailed program listing is given below. The program is tested with the problem mentioned in Section 6.11.1. The data file is embedded in the program listing.

 

%---------------------------Listing 1 Matlab Program-------------------------------------

% Program to analyse water distribution network

% written by B.V. Rao and modified by T.I. Eldho, C.E.Dept, I.I.T.,Bombay

% H - pressure heads in meters 1 × n

% pipe_length[1:m]

% Q Discharge in the pipe [1:m]

% A(n,n) ...

Get Finite Element Method with Applications in Engineering now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.