diff options
author | priyanka | 2015-06-24 15:03:17 +0530 |
---|---|---|
committer | priyanka | 2015-06-24 15:03:17 +0530 |
commit | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch) | |
tree | ab291cffc65280e58ac82470ba63fbcca7805165 /50/CH5/EX5.17 | |
download | Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2 Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip |
initial commit / add all books
Diffstat (limited to '50/CH5/EX5.17')
-rwxr-xr-x | 50/CH5/EX5.17/ex_5_17.sce | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/50/CH5/EX5.17/ex_5_17.sce b/50/CH5/EX5.17/ex_5_17.sce new file mode 100755 index 000000000..f0e6d0b6f --- /dev/null +++ b/50/CH5/EX5.17/ex_5_17.sce @@ -0,0 +1,24 @@ +// example 5.17
+// caption: gauss-legendre method
+// I= integral 2*x/(1+x^4) in the range [1,2];
+// first we need ti transform the interval [1,2 ] to [-1,1], since gauss-legendre three point method is applicable in the range[-1,1],
+
+// let t=ax+b;
+// solving for a,b from the two ranges, we get a=1/2; b=3/2; x=(t+3)/2;
+
+// hence I=integral 2*x/(1+x^4) in the range [0,1]= integral 8*(t+3)/16+(t+3)^4 in the range [-1,1];
+
+
+deff('[y]=f(t)','y=8*(t+3)/(16+(t+3)^4) ');
+
+// 1) since , from gauss legendre one point rule;
+I1=2*f(0)
+
+// 2) since , from gauss legendre two point rule;
+I2=f(-1/sqrt(3))+f(1/sqrt(3))
+
+// 3) since , from gauss legendre three point rule;
+I=(1/9)*(5*f(-sqrt(3/5))+8*f(0)+5*f(sqrt(3/5)))
+
+
+// we know , exact solution is 0.5404;
\ No newline at end of file |