diff options
author | prashantsinalkar | 2017-10-10 12:27:19 +0530 |
---|---|---|
committer | prashantsinalkar | 2017-10-10 12:27:19 +0530 |
commit | 7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch) | |
tree | dbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /260/CH11/EX11.11/11_11.sce | |
parent | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (diff) | |
download | Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.gz Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.bz2 Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.zip |
initial commit / add all books
Diffstat (limited to '260/CH11/EX11.11/11_11.sce')
-rw-r--r-- | 260/CH11/EX11.11/11_11.sce | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/260/CH11/EX11.11/11_11.sce b/260/CH11/EX11.11/11_11.sce new file mode 100644 index 000000000..162596d51 --- /dev/null +++ b/260/CH11/EX11.11/11_11.sce @@ -0,0 +1,37 @@ +//Eg-11.11
+//pg-493
+
+clear
+clc
+
+//The function to be integrated is
+
+deff('out = func(in)','out = 8.168*in*(1-in/2.5)^0.17')
+
+a = 0;
+b = 2.5; //Limits of integration
+
+//Taking the values of w and x from the table 11.3
+//The value of the subscripts is increased by 1 because the index 0 is not valid.
+
+w(1) = 0.2369269;
+w(2) = 0.4786287;
+w(3) = 0.5688889;
+w(4) = 0.4786287;
+w(5) = 0.2369269;
+
+x(1) = -0.90617985;
+x(2) = -0.53846931;
+x(3) = 0.00000000;
+x(4) = 0.53846931;
+x(5) = 0.90617985;
+
+sum1 = 0;
+
+for(i = 1:5)
+ sum1 = sum1 + w(i)*func((x(i)*(b-a)+b+a)/2);
+end
+
+I = (b-a)/2*sum1;
+
+printf('The value of the flowrate is %f cm^3/s',I)
\ No newline at end of file |