summaryrefslogtreecommitdiff
path: root/1670/CH9
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /1670/CH9
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 '1670/CH9')
-rwxr-xr-x1670/CH9/EX9.1/9_1.sce10
-rwxr-xr-x1670/CH9/EX9.10/9_10.sce22
-rwxr-xr-x1670/CH9/EX9.11/9_11.sce22
-rwxr-xr-x1670/CH9/EX9.12/9_12.sce20
-rwxr-xr-x1670/CH9/EX9.13/9_13.sce20
-rwxr-xr-x1670/CH9/EX9.14/9_14.sce20
-rwxr-xr-x1670/CH9/EX9.15/9_15.sce22
-rwxr-xr-x1670/CH9/EX9.16/9_16.sce15
-rwxr-xr-x1670/CH9/EX9.17/9_17.sce15
-rwxr-xr-x1670/CH9/EX9.18/9_18.sce15
-rwxr-xr-x1670/CH9/EX9.2/9_2.sce10
-rwxr-xr-x1670/CH9/EX9.3/9_3.sce10
-rwxr-xr-x1670/CH9/EX9.4/9_4.sce18
-rwxr-xr-x1670/CH9/EX9.5/9_5.sce20
-rwxr-xr-x1670/CH9/EX9.6/9_6.sce13
-rwxr-xr-x1670/CH9/EX9.8/9_8.sce18
-rwxr-xr-x1670/CH9/EX9.9/9_9.sce22
17 files changed, 292 insertions, 0 deletions
diff --git a/1670/CH9/EX9.1/9_1.sce b/1670/CH9/EX9.1/9_1.sce
new file mode 100755
index 000000000..cee4b5735
--- /dev/null
+++ b/1670/CH9/EX9.1/9_1.sce
@@ -0,0 +1,10 @@
+//Example 9.1
+//Recurrence formula
+//Page no. 288
+clc;clear;close;
+
+y(1)=5;
+for i=2:7
+ y(i)=2*y(i-1)
+ printf('\ny(%i) = %g\n',i-1,y(i-1))
+end \ No newline at end of file
diff --git a/1670/CH9/EX9.10/9_10.sce b/1670/CH9/EX9.10/9_10.sce
new file mode 100755
index 000000000..337abf1fb
--- /dev/null
+++ b/1670/CH9/EX9.10/9_10.sce
@@ -0,0 +1,22 @@
+//Example 9.10
+//Particular Solution
+//Page no. 294
+clc;clear;close;
+
+x=poly(0,'x')
+n=2;
+f=x^(n)-0*x^(n-1)-4*x^(n-2);
+z=roots(f)
+disp(z,f)
+printf('\n\n')
+printf(' n n\nC.F. = ')
+for i=1:n
+ printf('c%i(%g)',i,z(i))
+ if i~=n then
+ printf(' + ')
+ end
+end
+A=[-3,0,0;4,-3,0;4,2,-3];
+B=[9;0;0];
+C=inv(A)*B;
+printf('\n\n\t 2\nP.I = (%g)n+(%g)n+(%g)',C(1),C(2),C(3)) \ No newline at end of file
diff --git a/1670/CH9/EX9.11/9_11.sce b/1670/CH9/EX9.11/9_11.sce
new file mode 100755
index 000000000..05f80c16c
--- /dev/null
+++ b/1670/CH9/EX9.11/9_11.sce
@@ -0,0 +1,22 @@
+//Example 9.11
+//Particular Solution
+//Page no. 294
+clc;clear;close;
+
+x=poly(0,'x')
+n=2;
+f=x^(n)-0*x^(n-1)-4*x^(n-2);
+z=roots(f)
+disp(z,f)
+printf('\n\n')
+printf(' n n\nC.F. = ')
+for i=1:n
+ printf('c%i(%g)',i,z(i))
+ if i~=n then
+ printf(' + ')
+ end
+end
+A=[-3,0,0;4,-3,0;4,2,-3];
+B=[1;1;-1];
+C=inv(A)*B;
+printf('\n\n\t \t 2\nP.I = (%g)n+(%g)n+(%g)',C(1),C(2),C(3)) \ No newline at end of file
diff --git a/1670/CH9/EX9.12/9_12.sce b/1670/CH9/EX9.12/9_12.sce
new file mode 100755
index 000000000..474d34bf3
--- /dev/null
+++ b/1670/CH9/EX9.12/9_12.sce
@@ -0,0 +1,20 @@
+//Example 9.12
+//Particular Solution
+//Page no. 295
+clc;clear;close;
+
+x=poly(0,'x')
+n=2;s=['+','-'];
+f=x^(n)-4*x^(n-1)+5*x^(n-2);
+z=roots(f)
+disp(z,f)
+printf('\n\n')
+printf(' n n\nC.F. = ')
+for i=1:n
+ printf('c%i(%g %s i)',i,z(i),s(i))
+ if i~=n then
+ printf(' + ')
+ end
+end
+C=1;
+printf('\n\n\t \nP.I = %g',C) \ No newline at end of file
diff --git a/1670/CH9/EX9.13/9_13.sce b/1670/CH9/EX9.13/9_13.sce
new file mode 100755
index 000000000..4b532d33c
--- /dev/null
+++ b/1670/CH9/EX9.13/9_13.sce
@@ -0,0 +1,20 @@
+//Example 9.13
+//Particular Solution
+//Page no. 295
+clc;clear;close;
+
+x=poly(0,'x')
+n=2;
+f=x^(n)-7*x^(n-1)+10*x^(n-2);
+z=roots(f)
+disp(z,f)
+printf('\n\n')
+printf(' n n\nC.F. = ')
+for i=1:n
+ printf('c%i(%g)',i,z(i))
+ if i~=n then
+ printf(' + ')
+ end
+end
+C=-6;
+printf('\n\n\t n\t \nP.I = %g(4)',C) \ No newline at end of file
diff --git a/1670/CH9/EX9.14/9_14.sce b/1670/CH9/EX9.14/9_14.sce
new file mode 100755
index 000000000..04e943a09
--- /dev/null
+++ b/1670/CH9/EX9.14/9_14.sce
@@ -0,0 +1,20 @@
+//Example 9.14
+//Particular Solution
+//Page no. 296
+clc;clear;close;
+
+x=poly(0,'x')
+n=2;
+f=x^(n)+5*x^(n-1)+4*x^(n-2);
+z=roots(f)
+disp(z,f)
+printf('\n\n')
+printf(' n n\nC.F. = ')
+for i=1:n
+ printf('c%i(%g)',i,z(i))
+ if i~=n then
+ printf(' + ')
+ end
+end
+C=18;
+printf('\n\n\t n\t \nP.I = %g(3)',C) \ No newline at end of file
diff --git a/1670/CH9/EX9.15/9_15.sce b/1670/CH9/EX9.15/9_15.sce
new file mode 100755
index 000000000..0c29aa0ab
--- /dev/null
+++ b/1670/CH9/EX9.15/9_15.sce
@@ -0,0 +1,22 @@
+//Example 9.15
+//Particular Solution
+//Page no. 296
+clc;clear;close;
+
+x=poly(0,'x')
+n=2;
+f=x^(n)-1*x^(n-1)-2*x^(n-2);
+z=roots(f)
+disp(z,f)
+printf('\n\n')
+printf(' n n\nC.F. = ')
+for i=1:n
+ printf('c%i(%g)',i,z(i))
+ if i~=n then
+ printf(' + ')
+ end
+end
+A=[5/8,0;1/2,5/8];
+B=[3;0]
+C=inv(A)*B;
+printf('\n\n\t \t n\t \nP.I = (%gn%g)(4)',C(1),C(2)) \ No newline at end of file
diff --git a/1670/CH9/EX9.16/9_16.sce b/1670/CH9/EX9.16/9_16.sce
new file mode 100755
index 000000000..3c43c7fcb
--- /dev/null
+++ b/1670/CH9/EX9.16/9_16.sce
@@ -0,0 +1,15 @@
+//Example 9.16
+//Particular Solution
+//Page no. 297
+clc;clear;close;
+
+x=poly(0,'x')
+n=2;
+f=x^(n)-2*x^(n-1)+x^(n-2);
+z=roots(f)
+disp(z,f)
+printf('\t\t\nC.F. = (c1+n*c2) (%g)',z(1))
+A=[1,0,0;8,1,0;12,4,1];
+B=[1;0;0];
+C=inv(A)*B;
+printf('\n\n\t 2\nP.I = (%g)n+(%g)n+(%g)',C(1),C(2),C(3)) \ No newline at end of file
diff --git a/1670/CH9/EX9.17/9_17.sce b/1670/CH9/EX9.17/9_17.sce
new file mode 100755
index 000000000..4eb5f2e39
--- /dev/null
+++ b/1670/CH9/EX9.17/9_17.sce
@@ -0,0 +1,15 @@
+//Example 9.17
+//Particular Solution
+//Page no. 298
+clc;clear;close;
+
+x=poly(0,'x')
+n=2;
+f=x^(n)-3*x^(n-1)+2*x^(n-2);
+z=roots(f)
+disp(z,f)
+printf('\t\t n\nC.F. = (c1+n*c2) (%g)',z(1))
+A=[-4,0;2,-2];
+B=[2;0];
+C=inv(A)*B;
+printf('\n\n\t 2\nP.I = (%g)n+(%g)n',C(1),C(2)) \ No newline at end of file
diff --git a/1670/CH9/EX9.18/9_18.sce b/1670/CH9/EX9.18/9_18.sce
new file mode 100755
index 000000000..e4e1d5840
--- /dev/null
+++ b/1670/CH9/EX9.18/9_18.sce
@@ -0,0 +1,15 @@
+//Example 9.16
+//Particular Solution
+//Page no. 297
+clc;clear;close;
+
+x=poly(0,'x')
+n=1;
+f=x^(n)-4*x^(n-1);
+z=roots(f)
+disp(z,f)
+printf('\t n\nC.F. = (c1) (%g)',z(1))
+A=[1,1;0,1];
+B=[6;0];
+C=inv(A)*B;
+printf('\n\n\t \t n\nP.I = ((%g)n+(%g)n)*(4)',C(1),C(2)) \ No newline at end of file
diff --git a/1670/CH9/EX9.2/9_2.sce b/1670/CH9/EX9.2/9_2.sce
new file mode 100755
index 000000000..21e61ce89
--- /dev/null
+++ b/1670/CH9/EX9.2/9_2.sce
@@ -0,0 +1,10 @@
+//Example 9.3
+//Recurrence formula
+//Page no. 291
+clc;clear;close;
+
+x=poly(0,'x')
+f=16*x^2-8*x+1;
+z=roots(f)
+disp(z,f)
+printf('\t\tn\n(c1+n*c2) (%g)',z(1)) \ No newline at end of file
diff --git a/1670/CH9/EX9.3/9_3.sce b/1670/CH9/EX9.3/9_3.sce
new file mode 100755
index 000000000..21e61ce89
--- /dev/null
+++ b/1670/CH9/EX9.3/9_3.sce
@@ -0,0 +1,10 @@
+//Example 9.3
+//Recurrence formula
+//Page no. 291
+clc;clear;close;
+
+x=poly(0,'x')
+f=16*x^2-8*x+1;
+z=roots(f)
+disp(z,f)
+printf('\t\tn\n(c1+n*c2) (%g)',z(1)) \ No newline at end of file
diff --git a/1670/CH9/EX9.4/9_4.sce b/1670/CH9/EX9.4/9_4.sce
new file mode 100755
index 000000000..4065c5f69
--- /dev/null
+++ b/1670/CH9/EX9.4/9_4.sce
@@ -0,0 +1,18 @@
+//Example 9.4
+//Recurrence formula
+//Page no. 291
+clc;clear;close;
+
+x=poly(0,'x')
+n=3;
+f=x^(n)-2*x^(n-1)-x^(n-2)+2;
+z=roots(f)
+disp(z,f)
+printf('\n\n')
+printf(' n n n\n')
+for i=1:n
+ printf('c%i(%g)',i,z(i))
+ if i~=n then
+ printf(' + ')
+ end
+end \ No newline at end of file
diff --git a/1670/CH9/EX9.5/9_5.sce b/1670/CH9/EX9.5/9_5.sce
new file mode 100755
index 000000000..b7a05a065
--- /dev/null
+++ b/1670/CH9/EX9.5/9_5.sce
@@ -0,0 +1,20 @@
+//Example 9.5
+//Difference Equation
+//Page no. 291
+clc;clear;close;
+
+y(1)=1.5;y(2)=3;
+n=poly(0,'n')
+x=poly(0,'x')
+f=x^2-2*x+1;
+disp(f)
+x=roots(f)
+disp(x,"x = ")
+A=[1,1;1,2];
+B=[y(1);y(2)]
+C=inv(A)*B
+for i=1:2
+ printf('\nc(%i) = %g\n',i,C(i))
+end
+yn=C(1)+C(2)*n
+disp(yn,"yn = ") \ No newline at end of file
diff --git a/1670/CH9/EX9.6/9_6.sce b/1670/CH9/EX9.6/9_6.sce
new file mode 100755
index 000000000..597bf2afd
--- /dev/null
+++ b/1670/CH9/EX9.6/9_6.sce
@@ -0,0 +1,13 @@
+//Example 9.6
+//Recurrence formula
+//Page no. 292
+clc;clear;close;
+
+x=poly(0,'x')
+f=x^2-2*x+2;
+z=roots(f)
+disp(z,f)
+r=z(1)*z(2);
+r=sqrt(r);
+theta=atan(real(z(1)));
+printf('\n\n\t n\n(%g) (c1*cos(n*%g)+c2*sin(n*%g)) ',r,theta,theta) \ No newline at end of file
diff --git a/1670/CH9/EX9.8/9_8.sce b/1670/CH9/EX9.8/9_8.sce
new file mode 100755
index 000000000..2a07de634
--- /dev/null
+++ b/1670/CH9/EX9.8/9_8.sce
@@ -0,0 +1,18 @@
+//Example 9.8
+//Recurrence formula
+//Page no. 292
+clc;clear;close;
+
+x=poly(0,'x')
+n=2;
+f=x^(n)-5*x^(n-1)+6*x^(n-2);
+z=roots(f)
+disp(z,f)
+printf('\n\n')
+printf(' n n\nf(n) = ')
+for i=1:n
+ printf('c%i(%g)',i,z(i))
+ if i~=n then
+ printf(' + ')
+ end
+end \ No newline at end of file
diff --git a/1670/CH9/EX9.9/9_9.sce b/1670/CH9/EX9.9/9_9.sce
new file mode 100755
index 000000000..e090cc2c1
--- /dev/null
+++ b/1670/CH9/EX9.9/9_9.sce
@@ -0,0 +1,22 @@
+//Example 9.9
+//Particular Solution
+//Page no. 293
+clc;clear;close;
+
+x=poly(0,'x')
+n=2;
+f=x^(n)-x^(n-1)-2*x^(n-2);
+z=roots(f)
+disp(z,f)
+printf('\n\n')
+printf(' n n\nC.F. = ')
+for i=1:n
+ printf('c%i(%g)',i,z(i))
+ if i~=n then
+ printf(' + ')
+ end
+end
+A=[-2,0,0;10,-2,0;9,-5,2];
+B=[2;0;0];
+C=inv(A)*B;
+printf('\n\n\t 2\nP.I = (%g)n+(%g)n+(%g)',C(1),C(2),C(3)) \ No newline at end of file