summaryrefslogtreecommitdiff
path: root/3733/CH2/EX2.15/Ex2_15.sce
diff options
context:
space:
mode:
authorprashantsinalkar2017-10-10 12:27:19 +0530
committerprashantsinalkar2017-10-10 12:27:19 +0530
commit7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch)
treedbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /3733/CH2/EX2.15/Ex2_15.sce
parentb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (diff)
downloadScilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.gz
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.bz2
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.zip
initial commit / add all books
Diffstat (limited to '3733/CH2/EX2.15/Ex2_15.sce')
-rw-r--r--3733/CH2/EX2.15/Ex2_15.sce34
1 files changed, 34 insertions, 0 deletions
diff --git a/3733/CH2/EX2.15/Ex2_15.sce b/3733/CH2/EX2.15/Ex2_15.sce
new file mode 100644
index 000000000..7a9c67028
--- /dev/null
+++ b/3733/CH2/EX2.15/Ex2_15.sce
@@ -0,0 +1,34 @@
+// Example 2_15
+clc;funcprot(0);
+//Given data
+w=[1 2 3 4 5 6 7 8 9 10 11 12];// Week
+b=[6000 4000 5400 2000 1500 1000 1200 4500 8000 4000 3000 2000];// Weekly flow in m^3/sec
+
+//Calculation
+for(i=1:12)
+ c(i)=b(i)*7;
+end
+Cv(1)=c(1);// day-sec-metres
+Cv(2)=Cv(1)+c(2);// day-sec-metres
+Cv(3)=Cv(2)+c(3);// day-sec-metres
+Cv(4)=Cv(3)+c(4);// day-sec-metres
+Cv(5)=Cv(4)+c(5);// day-sec-metres
+Cv(6)=Cv(5)+c(6);// day-sec-metres
+Cv(7)=Cv(6)+c(7);// day-sec-metres
+Cv(8)=Cv(7)+c(8);// day-sec-metres
+Cv(9)=Cv(8)+c(9);// day-sec-metres
+Cv(10)=Cv(9)+c(10);// day-sec-metres
+Cv(11)=Cv(10)+c(11);// day-sec-metres
+Cv(12)=Cv(11)+c(12);// day-sec-metres
+w=[0 1 2 3 4 5 6 7 8 9 10 11 12];// Week for plot
+CV=[0 Cv(1) Cv(2) Cv(3) Cv(4) Cv(5) Cv(6) Cv(7) Cv(8) Cv(9) Cv(10) Cv(11) Cv(12)];// Cumulative volume in day-sec-metres for plot
+ylabel('Flow in thousands & day-sec-meter');
+plot(w,CV/1000)
+// The total flow in the week,Q=7*day-sec-metres.
+// From fig.prob.2.15
+C=42*10^3;// The capacity of the reservoir in day-sec-metre
+bc=5.7*20*10^3;// day-sec-metre
+ac=5.5;// day
+Q=bc/(ac*7);// Flow rate available in m^3/sec
+printf('\n The capacity of the reservoir=%0.1e day-sec-metre \nFlow rate available=%0.0f m^3/sec',C,Q);
+// The answer vary due to round off error