summaryrefslogtreecommitdiff
path: root/1553/CH16/EX16.7/16Ex7.sce
blob: ee200456e83809e3406d5f2191cb448c5c610947 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//chapter 16 Ex 7
clc;
clear;
close;
//let pipes be A B and leak be C
t1=36; t2=45; //time taken by A and B to fill tank individually
t3=30;        //time taken by leak to empty the tank
A1min=1/t1; B1min=1/t2; //part filled by A and B in 1 min each individually
C1min=-1/t3; //part emptied by leak
AB1min=A1min+B1min;     //part filled by A and B in 1 min each together
AB7min=7*AB1min;
remainingPart=1-AB7min;
ABC1min=A1min+B1min+C1min;           //part filled by all 3 pipes in 1 min
totalTime=(1/ABC1min)*remainingPart+7;

mprintf("Thus total time taken to fill the tank is %.0f min",totalTime);