summaryrefslogtreecommitdiff
path: root/1332/CH13
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /1332/CH13
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 '1332/CH13')
-rwxr-xr-x1332/CH13/EX13.1/13_1.pdfbin0 -> 6014 bytes
-rwxr-xr-x1332/CH13/EX13.1/13_1.sce12
-rwxr-xr-x1332/CH13/EX13.2/13_2.pdfbin0 -> 6590 bytes
-rwxr-xr-x1332/CH13/EX13.2/13_2.sce47
-rwxr-xr-x1332/CH13/EX13.3/13_3.pdfbin0 -> 6418 bytes
-rwxr-xr-x1332/CH13/EX13.3/13_3.sce44
-rwxr-xr-x1332/CH13/EX13.4/13_4.pdfbin0 -> 6194 bytes
-rwxr-xr-x1332/CH13/EX13.4/13_4.sce27
-rwxr-xr-x1332/CH13/EX13.5/13_5.pdfbin0 -> 6405 bytes
-rwxr-xr-x1332/CH13/EX13.5/13_5.sce30
-rwxr-xr-x1332/CH13/EX13.6/13_6.pdfbin0 -> 6009 bytes
-rwxr-xr-x1332/CH13/EX13.6/13_6.sce11
-rwxr-xr-x1332/CH13/EX13.7/13_7.pdfbin0 -> 6135 bytes
-rwxr-xr-x1332/CH13/EX13.7/13_7.sce21
-rwxr-xr-x1332/CH13/EX13.8/13_8.pdfbin0 -> 6216 bytes
-rwxr-xr-x1332/CH13/EX13.8/13_8.sce31
16 files changed, 223 insertions, 0 deletions
diff --git a/1332/CH13/EX13.1/13_1.pdf b/1332/CH13/EX13.1/13_1.pdf
new file mode 100755
index 000000000..c09c4f2d0
--- /dev/null
+++ b/1332/CH13/EX13.1/13_1.pdf
Binary files differ
diff --git a/1332/CH13/EX13.1/13_1.sce b/1332/CH13/EX13.1/13_1.sce
new file mode 100755
index 000000000..e7e8a0f1f
--- /dev/null
+++ b/1332/CH13/EX13.1/13_1.sce
@@ -0,0 +1,12 @@
+//Example 13.1
+//Differentiation
+//Page no. 420
+clc;close;clear;
+
+deff('y=f(x)','y=x^2+5')
+deff('y=f1(x,h)','y=(f(x+h)-f(x))/h')
+h=0.01;x=2.4
+d=f1(x,h)
+d1=(f1(x+h,h)-f1(x))/h
+printf('dy\n -- = %g\n dx',d)
+printf('\n\n\n d2y\n --- = %g\n dx2',d1) \ No newline at end of file
diff --git a/1332/CH13/EX13.2/13_2.pdf b/1332/CH13/EX13.2/13_2.pdf
new file mode 100755
index 000000000..536787c2b
--- /dev/null
+++ b/1332/CH13/EX13.2/13_2.pdf
Binary files differ
diff --git a/1332/CH13/EX13.2/13_2.sce b/1332/CH13/EX13.2/13_2.sce
new file mode 100755
index 000000000..a7b49e452
--- /dev/null
+++ b/1332/CH13/EX13.2/13_2.sce
@@ -0,0 +1,47 @@
+//Example 13.2
+//Calculation of x-coordinate of Minimum Point
+//Page no. 422
+clc;close;clear;
+
+for i=1:7
+ for j=1:6
+ z(i,j)=0
+ end
+end
+h=0.2
+printf(' x y d d2 d3 d4\n')
+printf('--------------------------------------------------------------')
+for i=1:7
+ z(i,1)=i/5;
+end
+z(1,2)=2.10022
+z(2,2)=1.98730
+z(3,2)=1.90940
+z(4,2)=1.86672
+z(5,2)=1.85937
+z(6,2)=1.88755
+z(7,2)=1.95147
+for i=3:6
+ for j=1:9-i
+ z(j,i)=z(j+1,i-1)-z(j,i-1)
+ end
+end
+disp(z)
+
+s=poly(0,'s')
+p=z(5,2);k=4;
+for i=3:5
+ r=1;
+ for j=1:i-2
+ r=r*(s+(j-1))
+ end
+ r=r*z(k,i)/factorial(j);
+ k=k-1;
+ p=p+r;
+
+end
+disp(p)
+s=(-z(4,3)+z(3,4)/2)/z(3,4)
+disp(s,'s=')
+x=z(5,1)+s*h
+disp(x,'x=') \ No newline at end of file
diff --git a/1332/CH13/EX13.3/13_3.pdf b/1332/CH13/EX13.3/13_3.pdf
new file mode 100755
index 000000000..4dc22e60f
--- /dev/null
+++ b/1332/CH13/EX13.3/13_3.pdf
Binary files differ
diff --git a/1332/CH13/EX13.3/13_3.sce b/1332/CH13/EX13.3/13_3.sce
new file mode 100755
index 000000000..e25ea55b4
--- /dev/null
+++ b/1332/CH13/EX13.3/13_3.sce
@@ -0,0 +1,44 @@
+//Example 13.3
+//Newton's Forward Difference Formula
+//Page no. 423
+clc;close;clear;
+printf(' x\t\t y\t\t d\t\t d2\t\t d3\t\t d4\n')
+printf('------------------------------------------------------------------------------------------')
+h=0.05;
+z=[1.00,1.00000;1.05,1.02470;1.10,1.04881;1.15,1.07238;1.20,1.09544;1.25,1.11803;1.30,1.14018]
+deff('y=f1(x,s)','y=(z(x,3)+(s-1/2)*z(x,4)+z(x,5)*(3*s^2-6*s+2)/6)/h')
+deff('y=f2(x,s)','y=(z(x,4)+z(x,5)*(s-1))/h^2')
+deff('y=f3(x,s)','y=z(x,5)/h^3')
+for i=3:6
+ for j=1:9-i
+ z(j,i)=z(j+1,i-1)-z(j,i-1)
+ end
+end
+printf('\n')
+for i=1:7
+ for j=1:6
+ if z(i,j)==0 then
+ printf(' \t')
+ else
+ printf('%.7f\t',z(i,j))
+ end
+ end
+ printf('\n')
+end
+s=poly(0,'s')
+p=z(5,2);k=4;
+for i=3:5
+ r=1;
+ for j=1:i-2
+ r=r*(s+(j-1))
+ end
+ r=r*z(k,i)/factorial(j);
+ k=k-1;
+ p=p+r;
+
+end
+disp(p,'y(s) = ')
+printf('\n\ny1(1) = %g',f1(1,0))
+printf('\n\ny2(1) = %g',f2(1,0))
+printf('\n\ny3(1) = %g',f3(1,0))
+printf('\n\ny1(1.025) = %g',f1(1,0.5)) \ No newline at end of file
diff --git a/1332/CH13/EX13.4/13_4.pdf b/1332/CH13/EX13.4/13_4.pdf
new file mode 100755
index 000000000..18afad65e
--- /dev/null
+++ b/1332/CH13/EX13.4/13_4.pdf
Binary files differ
diff --git a/1332/CH13/EX13.4/13_4.sce b/1332/CH13/EX13.4/13_4.sce
new file mode 100755
index 000000000..bd42bdd24
--- /dev/null
+++ b/1332/CH13/EX13.4/13_4.sce
@@ -0,0 +1,27 @@
+//Example 13.4
+//Newton's Backward Difference Formula
+//Page no. 425
+clc;close;clear;
+printf(' x\t\t y\t\t d\t\t d2\t\t d3\t\t d4\n')
+printf('------------------------------------------------------------------------------------------')
+h=0.02;
+z=[0.96,1.8025;0.98,1.7939;1.00,1.7851;1.02,1.7763;1.04,1.7673];
+deff('y=f1(x,s)','y=(z(x,3)+(s+1/2)*z(x,4))/h')
+for i=3:6
+ for j=1:7-i
+ z(j,i)=z(j+1,i-1)-z(j,i-1)
+ end
+end
+printf('\n')
+for i=1:5
+ for j=1:6
+ if z(i,j)==0 then
+ printf(' \t')
+ else
+ printf('%.7f\t',z(i,j))
+ end
+ end
+ printf('\n')
+end
+printf('\n\ny1(1) = %g',f1(2,0))
+printf('\n\ny1(1.03) = %g',f1(4,0.5)) \ No newline at end of file
diff --git a/1332/CH13/EX13.5/13_5.pdf b/1332/CH13/EX13.5/13_5.pdf
new file mode 100755
index 000000000..626c1c82d
--- /dev/null
+++ b/1332/CH13/EX13.5/13_5.pdf
Binary files differ
diff --git a/1332/CH13/EX13.5/13_5.sce b/1332/CH13/EX13.5/13_5.sce
new file mode 100755
index 000000000..1b588f1a6
--- /dev/null
+++ b/1332/CH13/EX13.5/13_5.sce
@@ -0,0 +1,30 @@
+//Example 13.5
+//Stirlings Central Difference Derivatives
+//Page no. 426
+clc;close;clear;
+printf(' x\t\t y\t\t d\t\t d2\t\t d3\n')
+printf('---------------------------------------------------------------------------')
+h=0.01;s=0.5;
+deff('y=f1(x,s)','y=((z(x,3)+z(x-1,3))/2+s*z(x-1,4)+(z(x-1,5)+z(x-2,5))*(3*s^2-1)/12)/h')
+deff('y=f2(x,s)','y=(z(x-1,4))/h^2')
+deff('y=f3(x,s)','y=(z(x-1,5)+z(x-2,5))/(2*h^3)')
+z=[1.00,1.00000;1.01,1.00499;1.02,1.00995;1.03,1.01489;1.04,1.01980;1.05,1.02470;1.06,1.02956;1.07,1.03441;1.08,1.03923;1.09,1.04403;1.10,1.04881;1.11,1.05357;1.12,1.05830;1.13,1.06301;1.14,1.06771;1.15,1.07238;1.16,1.07703];
+for i=3:5
+ for j=1:19-i
+ z(j,i)=z(j+1,i-1)-z(j,i-1)
+ end
+end
+printf('\n')
+for i=1:17
+ for j=1:5
+ if z(i,j)==0 then
+ printf(' \t')
+ else
+ printf('%.7f\t',z(i,j))
+ end
+ end
+ printf('\n')
+end
+printf('\n\ny1(1.125) = %g (exact value = 0.4771404)',f1(13,0.5))
+printf('\n\ny2(1.125) = %g (exact value = -0.20951)',f2(13,0.5))
+printf('\n\ny3(1.125) = %g (exact value = 0.27935)',f3(13,0.5)) \ No newline at end of file
diff --git a/1332/CH13/EX13.6/13_6.pdf b/1332/CH13/EX13.6/13_6.pdf
new file mode 100755
index 000000000..07b130004
--- /dev/null
+++ b/1332/CH13/EX13.6/13_6.pdf
Binary files differ
diff --git a/1332/CH13/EX13.6/13_6.sce b/1332/CH13/EX13.6/13_6.sce
new file mode 100755
index 000000000..1bcad51ee
--- /dev/null
+++ b/1332/CH13/EX13.6/13_6.sce
@@ -0,0 +1,11 @@
+//Example 13.6
+//Extrapolation
+//Page no. 430
+clc;close;clear;
+x=[-0.8,-0.6,-0.4,-0.2,0,0.2,0.4,0.6,0.8];
+y=[0.2019,0.30119,0.44933,0.67032,1,1.49182,2.22554,3.32012,4.95303]
+for i=1:4
+ printf('\nh = %g\n',x(10-i))
+ y1=(y(10-i)-y(i))/(2*x(10-i))
+ printf('f1(0) = %g\n\n',y1)
+end \ No newline at end of file
diff --git a/1332/CH13/EX13.7/13_7.pdf b/1332/CH13/EX13.7/13_7.pdf
new file mode 100755
index 000000000..39686800f
--- /dev/null
+++ b/1332/CH13/EX13.7/13_7.pdf
Binary files differ
diff --git a/1332/CH13/EX13.7/13_7.sce b/1332/CH13/EX13.7/13_7.sce
new file mode 100755
index 000000000..88c1182b6
--- /dev/null
+++ b/1332/CH13/EX13.7/13_7.sce
@@ -0,0 +1,21 @@
+//Example 13.7
+//Richardson Extrapolation
+//Page no. 431
+clc;close;clear;
+
+deff('y=f(x)','y=exp(2*x)')
+e=10^-4;h=0.8;
+D1=0;
+for i=1:4
+ printf('\n')
+ for j=1:i
+ if j==1 then
+ D(i,j)=(f(h)-f(-h))/(2*h)
+ else
+ D(i,j)=D(i,j-1)+(D(i,j-1)-D(i-1,j-1))/(2^(2*(j-1))-1)
+ end
+ printf('%g\t\t',D(i,j))
+ end
+ h=h/2
+end
+printf('\n\n\t\t\t\t\t\t 2x\nHence, the derivative of the function y = f(x) = e at x=0 is D(3,3) = %g',D(i,j))
diff --git a/1332/CH13/EX13.8/13_8.pdf b/1332/CH13/EX13.8/13_8.pdf
new file mode 100755
index 000000000..aff2c3b88
--- /dev/null
+++ b/1332/CH13/EX13.8/13_8.pdf
Binary files differ
diff --git a/1332/CH13/EX13.8/13_8.sce b/1332/CH13/EX13.8/13_8.sce
new file mode 100755
index 000000000..502a1f6d7
--- /dev/null
+++ b/1332/CH13/EX13.8/13_8.sce
@@ -0,0 +1,31 @@
+//Example 13.8
+//Application
+//Page no. 433
+clc;close;clear;
+
+deff('y=f(x)','y=2/x^2')
+a=1;b=2;a1=1;b1=0;
+N=4;
+h=(b-a)/(N+1);
+for j=1:N
+ s(j)=f(a+j*h)
+end
+for i=1:N
+ for j=1:N
+ if abs(i-j)==1 then
+ A(i,j)=-1
+ end
+ if i==j then
+ A(i,j)=2+s(i)*h^2
+ end
+ end
+ if i==1 then
+ k(i,1)=s(i)+a1/h^2
+ elseif i==N
+ k(i,1)=s(i)+b1/h^2
+ else
+ k(i,1)=s(i)
+ end
+end
+disp(A,'A = ')
+disp(k,'k = ') \ No newline at end of file