summaryrefslogtreecommitdiff
path: root/243/CH12/EX12.5
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /243/CH12/EX12.5
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 '243/CH12/EX12.5')
-rwxr-xr-x243/CH12/EX12.5/12_05.sce24
1 files changed, 24 insertions, 0 deletions
diff --git a/243/CH12/EX12.5/12_05.sce b/243/CH12/EX12.5/12_05.sce
new file mode 100755
index 000000000..4e976faf2
--- /dev/null
+++ b/243/CH12/EX12.5/12_05.sce
@@ -0,0 +1,24 @@
+//Example No. 12_05
+//Simpson's 3/8 rule
+//Pg No. 386
+clear ;close ;clc ;
+
+funcprot(0)
+//case(a)
+deff('F = f(x)','F = x^3 + 1');
+a = 1 ;
+b = 2 ;
+h = (b-a)/3
+x1 = a + h
+x2 = a + 2*h
+Is2 = 3*h*( f(a) + 3*f(x1) + 3*f(x2) + f(b) )/8 ;
+disp(Is2,'Integral of x^3 +1 from 1 to 2 is')
+//case(b)
+deff('F = f(x)','F = sqrt( sin(x) )');
+a = 0 ;
+b = %pi/2 ;
+h = (b-a)/3
+x1 = a + h
+x2 = a + 2*h
+Is2 = 3*h*( f(a) + 3*f(x1) + 3*f(x2) + f(b) )/8 ;
+disp(Is2,'Integral of sqrt(sin(x)) from 0 to %pi/2 is') \ No newline at end of file