Pipe Network Code
Pipe Network Code
R = [3,4,6,5,4,6,5,3,7,6,3,4,3,6,5,4,5,7]
Q1 =[20,10,35,5,45,5,25,5,15,30,20,10,5,25,5,10,25,5]
# Loop Definitions (each row defines a loop with pipe indices and signs)
loops = [
[3,6,-5,-4], # Loop 2
[7,8,-9], # Loop 3
[9,-13,-10,-6], # Loop 4
[10,-12,-11], # Loop 5
[14,15,-16,13], # Loop 6
[16,-17,-18]] # Loop 7
# Convergence Parameters
tolerance = 1e-6
max_iterations = 100
iteration_results = []
max_correction = 0
Q=Q1.copy()
sum_head_loss = 0
sum_RQ = 0
# Process each pipe in the loop
direction = pipe/abs(pipe)
pipe_idx = abs(pipe) - 1
direction = pipe/abs(pipe)
Q1=Q.copy()
iteration_results.append(Q.copy())
break
else:
print(Q)