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 /60/CH4 | |
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 '60/CH4')
-rwxr-xr-x | 60/CH4/EX4.1/ex_1.sce | 6 | ||||
-rwxr-xr-x | 60/CH4/EX4.14/ex_14.sce | 6 | ||||
-rwxr-xr-x | 60/CH4/EX4.16/ex_16.sce | 10 | ||||
-rwxr-xr-x | 60/CH4/EX4.17/ex_17.sce | 4 | ||||
-rwxr-xr-x | 60/CH4/EX4.18/ex_18.sce | 8 | ||||
-rwxr-xr-x | 60/CH4/EX4.19/ex_19.sce | 4 | ||||
-rwxr-xr-x | 60/CH4/EX4.2/ex_2.sce | 10 | ||||
-rwxr-xr-x | 60/CH4/EX4.20/ex_20.sce | 8 | ||||
-rwxr-xr-x | 60/CH4/EX4.21/ex_21.sce | 8 | ||||
-rwxr-xr-x | 60/CH4/EX4.22/ex_22.sce | 4 | ||||
-rwxr-xr-x | 60/CH4/EX4.3/ex_3.sci | 16 | ||||
-rwxr-xr-x | 60/CH4/EX4.4/ex_4.sce | 17 | ||||
-rwxr-xr-x | 60/CH4/EX4.6/ex_6.sce | 7 | ||||
-rwxr-xr-x | 60/CH4/EX4.7/ex_7.sce | 8 | ||||
-rwxr-xr-x | 60/CH4/EX4.8/ex_8.sce | 24 |
15 files changed, 140 insertions, 0 deletions
diff --git a/60/CH4/EX4.1/ex_1.sce b/60/CH4/EX4.1/ex_1.sce new file mode 100755 index 000000000..2a0d286df --- /dev/null +++ b/60/CH4/EX4.1/ex_1.sce @@ -0,0 +1,6 @@ + +//Example (pg no.130) + + A=[3 0 2;1 2 0;0 1 1] + B=[2 1;0 1;1 0] + A*B
\ No newline at end of file diff --git a/60/CH4/EX4.14/ex_14.sce b/60/CH4/EX4.14/ex_14.sce new file mode 100755 index 000000000..67075dbc2 --- /dev/null +++ b/60/CH4/EX4.14/ex_14.sce @@ -0,0 +1,6 @@ +//example(3.14) + + c=[-3 1 0 1] + p3=poly(c,'y','coeff') + roots(p3) +
\ No newline at end of file diff --git a/60/CH4/EX4.16/ex_16.sce b/60/CH4/EX4.16/ex_16.sce new file mode 100755 index 000000000..8b7bf5dbd --- /dev/null +++ b/60/CH4/EX4.16/ex_16.sce @@ -0,0 +1,10 @@ +//Example (pg no.186) + + +//(1) + A=[1 4;2 3] + det(A) + +//(2) + A=[4 1;3 2] + det(A) diff --git a/60/CH4/EX4.17/ex_17.sce b/60/CH4/EX4.17/ex_17.sce new file mode 100755 index 000000000..ac8afa383 --- /dev/null +++ b/60/CH4/EX4.17/ex_17.sce @@ -0,0 +1,4 @@ +//Example (pg no.186) + + A=[3.1 4;3.2 3] + det(A)
\ No newline at end of file diff --git a/60/CH4/EX4.18/ex_18.sce b/60/CH4/EX4.18/ex_18.sce new file mode 100755 index 000000000..351e6c249 --- /dev/null +++ b/60/CH4/EX4.18/ex_18.sce @@ -0,0 +1,8 @@ +//Example (pg no.186) + + A=[1 2;2 2] + B=[1 2;1 1] + det(A)+det(B) + C=[1 2; 3 3] + det(C) + //det(A)+det(B)=det(C)
\ No newline at end of file diff --git a/60/CH4/EX4.19/ex_19.sce b/60/CH4/EX4.19/ex_19.sce new file mode 100755 index 000000000..c9f25dad3 --- /dev/null +++ b/60/CH4/EX4.19/ex_19.sce @@ -0,0 +1,4 @@ +//Example(4.11) (pg no.191) + + B=[1 2 0;2 1 0;0 0 -1] + lam = spec(B) diff --git a/60/CH4/EX4.2/ex_2.sce b/60/CH4/EX4.2/ex_2.sce new file mode 100755 index 000000000..7c2843a63 --- /dev/null +++ b/60/CH4/EX4.2/ex_2.sce @@ -0,0 +1,10 @@ +//Example (pg no.130) + + + A=[2 1;1 3] + B=[2 1;0 1] + A*B + B*A +//matrix multiplication is not commutative + //so A*B!=B*A + diff --git a/60/CH4/EX4.20/ex_20.sce b/60/CH4/EX4.20/ex_20.sce new file mode 100755 index 000000000..4b9dd2598 --- /dev/null +++ b/60/CH4/EX4.20/ex_20.sce @@ -0,0 +1,8 @@ +//Example(4.14) (pg no.201) + + +B=[1 2 0;2 1 0;0 0 -1] +lam = spec(B) +norm(B) + //Each eigen value of the matrix must have absolute value + // no bigger than the norm of that matrix
\ No newline at end of file diff --git a/60/CH4/EX4.21/ex_21.sce b/60/CH4/EX4.21/ex_21.sce new file mode 100755 index 000000000..aee0e9737 --- /dev/null +++ b/60/CH4/EX4.21/ex_21.sce @@ -0,0 +1,8 @@ +//Example(4.15) (pgno 202) + +B=[1 2 0;2 1 0;0 0 -1] +I=[1 0 0;0 1 0;0 0 1] + //here we are taking lamda=a + //det(B-a)*I=0 is characteristic equation to get lamda +deff('[y]=p(a)','p(a)=det(B-a)*I') +p(a)=0
\ No newline at end of file diff --git a/60/CH4/EX4.22/ex_22.sce b/60/CH4/EX4.22/ex_22.sce new file mode 100755 index 000000000..ed464bf5c --- /dev/null +++ b/60/CH4/EX4.22/ex_22.sce @@ -0,0 +1,4 @@ +//Example(4.16)(page no.203) + +A=[4 -1 -1 -1;-1 4 -1 -1;-1 -1 4 -1;-1 -1 -1 4] +spec(A)
\ No newline at end of file diff --git a/60/CH4/EX4.3/ex_3.sci b/60/CH4/EX4.3/ex_3.sci new file mode 100755 index 000000000..5bdfc325f --- /dev/null +++ b/60/CH4/EX4.3/ex_3.sci @@ -0,0 +1,16 @@ +//Example (pg no.133) + + A=[1 1;0 1] + inv(A) + B=[1 0;1 1] + inv(B) + A*B + inv(A*B) + inv(A)*inv(B) + //inv(A*B)=inv(B)*inv(A) + inv(B)*inv(A) + //Hence inv(A)*inv(B) = inv(A)*inv(B) + I=eye(3,3) + C=(A*B)*(inv(A)*inv(B)) + //C!=I + //so, inv(A)*inv(B) cannot be the inverse of (A*B)
\ No newline at end of file diff --git a/60/CH4/EX4.4/ex_4.sce b/60/CH4/EX4.4/ex_4.sce new file mode 100755 index 000000000..5d04187e4 --- /dev/null +++ b/60/CH4/EX4.4/ex_4.sce @@ -0,0 +1,17 @@ + + //Example (pg no.136) + + // x1 + 2(x2) = 3 + //2(x1) + 4(x2) = 6 + + A=[1 2;2 4] + //coefficient matrix of above equations + b=[3 6]' + x=A\b + //for corresponding homogenous system + // x1 + 2(x2) = 0 + //2(x1) + 4(x2) = 0 + A=[1 2;2 4] + //coefficient matrix of above equations + b=[0 0]' + x=A\b
\ No newline at end of file diff --git a/60/CH4/EX4.6/ex_6.sce b/60/CH4/EX4.6/ex_6.sce new file mode 100755 index 000000000..a23148baa --- /dev/null +++ b/60/CH4/EX4.6/ex_6.sce @@ -0,0 +1,7 @@ +//Example (pg no.140) + + A=[1 2;2 4] + det(A) + // Here A is a singular matrix i.e, det(A)=0 + //inv(A)=(adj(A))/det(A) + //so A is not invertible
\ No newline at end of file diff --git a/60/CH4/EX4.7/ex_7.sce b/60/CH4/EX4.7/ex_7.sce new file mode 100755 index 000000000..c4d2e09fe --- /dev/null +++ b/60/CH4/EX4.7/ex_7.sce @@ -0,0 +1,8 @@ +//Example (pg no.144) + +A = [1 2 3;4 5 6;7 8 9] +[L,U,E] = lu(A) + // L is lower triangular matrix(mxn) + // U is upper triangular matrix(mxmin(m,n)) + // E is permutation matrix(min(m,n)xn) +A*E
\ No newline at end of file diff --git a/60/CH4/EX4.8/ex_8.sce b/60/CH4/EX4.8/ex_8.sce new file mode 100755 index 000000000..7271a528a --- /dev/null +++ b/60/CH4/EX4.8/ex_8.sce @@ -0,0 +1,24 @@ +//example 4.1 (pg 149) + + //2x1 + 3x2 - x3 = 5 + //-2x2 - x3 = -7 + //-5x3 = -15 + +A = [2 3 -1;0 -2 -1;0 0 -5] +b = [5 -7 -15]' +a=[A b] +[nA,mA]=size(A) +n=nA + + //Backward substitution + +x(3) = a(n,n+1)/a(n,n); + +for i = n-1:-1:1 + sumk=0; + for k=i+1:n + sumk=sumk+a(i,k)*x(k); + end + x(i)=(a(i,n+1)-sumk)/a(i,i); +end + disp(x)
\ No newline at end of file |