summaryrefslogtreecommitdiff
path: root/964/CH21/EX21.9
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /964/CH21/EX21.9
downloadScilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip
initial commit / add all books
Diffstat (limited to '964/CH21/EX21.9')
-rwxr-xr-x964/CH21/EX21.9/21_9.sce34
1 files changed, 34 insertions, 0 deletions
diff --git a/964/CH21/EX21.9/21_9.sce b/964/CH21/EX21.9/21_9.sce
new file mode 100755
index 000000000..c9a62a048
--- /dev/null
+++ b/964/CH21/EX21.9/21_9.sce
@@ -0,0 +1,34 @@
+clc;
+clear;
+function t=f(x,y)
+ t=2*x*y+2*x-x^2-2*y^2+72
+endfunction
+len=8;//m,length
+wid=6;//m,width
+a=0;
+b=len;
+n=2;
+h=(b-a)/n;
+a1=0;
+b1=wid;
+h1=(b1-a1)/n;
+
+fa=f(a,0);
+fb=f(b,0);
+fh=f(h,0);
+lx1=(b-a)*(fa+2*fh+fb)/(2*n);
+
+fa=f(a,h1);
+fb=f(b,h1);
+fh=f(h,h1);
+lx2=(b-a)*(fa+2*fh+fb)/(2*n);
+
+fa=f(a,b1);
+fb=f(b,b1);
+fh=f(h,b1);
+lx3=(b-a)*(fa+2*fh+fb)/(2*n);
+
+l=(b1-a1)*(lx1+2*lx2+lx3)/(2*n);
+
+avg_temp=l/(len*wid);
+disp(avg_temp,"The average termperature is=")