summaryrefslogtreecommitdiff
path: root/70/CH2
diff options
context:
space:
mode:
Diffstat (limited to '70/CH2')
-rwxr-xr-x70/CH2/EX2.1.1/2_1_1.sci13
-rwxr-xr-x70/CH2/EX2.1.2/2_1_2.sci7
-rwxr-xr-x70/CH2/EX2.3.1/2_3_1.sci7
-rwxr-xr-x70/CH2/EX2.3.2/2_3_2.sci17
-rwxr-xr-x70/CH2/EX2.3.3/2_3_3.sci7
-rwxr-xr-x70/CH2/EX2.3.4/2_3_4.sci9
-rwxr-xr-x70/CH2/EX2.3.5/2_3_5.sci10
-rwxr-xr-x70/CH2/EX2.3.6/2_3_6.sci6
-rwxr-xr-x70/CH2/EX2.3.7/2_3_7.sci6
-rwxr-xr-x70/CH2/EX2.3.8/2_3_8.sci6
-rwxr-xr-x70/CH2/EX2.3.9/2_3_9.sci8
-rwxr-xr-x70/CH2/EX2.4.1/2_4_1.sci20
-rwxr-xr-x70/CH2/EX2.4.2/2_4_2.sci15
-rwxr-xr-x70/CH2/EX2.5.1/2_5_1.sci21
14 files changed, 152 insertions, 0 deletions
diff --git a/70/CH2/EX2.1.1/2_1_1.sci b/70/CH2/EX2.1.1/2_1_1.sci
new file mode 100755
index 000000000..21a509019
--- /dev/null
+++ b/70/CH2/EX2.1.1/2_1_1.sci
@@ -0,0 +1,13 @@
+//page 70
+clear;
+close;
+clc;
+disp('Consider all vectors in R^2 whose components are positive or zero')
+disp('The subset is first Quadrant of x-y plane,the co-ordinates satisfy x>=0 and y>=0.It is not a subspace.')
+v=[1,1];
+disp(v,'If the Vector=');
+disp('Taking a scalar,c=-1')
+c=-1; //scalar
+disp(c*v,'c*v=')
+disp('It lies in third Quadrant instead of first,Hence violating the rule(ii).')
+//end \ No newline at end of file
diff --git a/70/CH2/EX2.1.2/2_1_2.sci b/70/CH2/EX2.1.2/2_1_2.sci
new file mode 100755
index 000000000..aeaa6d5b8
--- /dev/null
+++ b/70/CH2/EX2.1.2/2_1_2.sci
@@ -0,0 +1,7 @@
+//page 71
+clear;
+close;
+clc;
+disp('Take vector space of 3X3 matrices')
+disp('One possible subspace is the set of lower triangular matrices,Another is set of symmetric matrices')
+disp('A+B,cA are both lower triangular if A and B are lower triangular ,and are symmetric if A and B are symmetric and Zero matrix is in both subspaces') \ No newline at end of file
diff --git a/70/CH2/EX2.3.1/2_3_1.sci b/70/CH2/EX2.3.1/2_3_1.sci
new file mode 100755
index 000000000..ced224803
--- /dev/null
+++ b/70/CH2/EX2.3.1/2_3_1.sci
@@ -0,0 +1,7 @@
+//page 92
+clear;
+close;
+clc;
+disp('For linear independence,C1V1+C2V2+......CkVk=0')
+disp('If we choose V1=zero vector,then the set is linearly dependent.We may choose C1=3 and all other Ci=0;this is a non-trival solution that produces zero.')
+//end \ No newline at end of file
diff --git a/70/CH2/EX2.3.2/2_3_2.sci b/70/CH2/EX2.3.2/2_3_2.sci
new file mode 100755
index 000000000..d77e861b0
--- /dev/null
+++ b/70/CH2/EX2.3.2/2_3_2.sci
@@ -0,0 +1,17 @@
+//page 92
+clear;
+close;
+clc;
+A=[1 3 3 2;2 6 9 5;-1 -3 3 0];
+disp('Given matrix:')
+disp(A)
+B=A;
+disp('C2->C2-3*C1')
+A(:,2)=A(:,2)-3*A(:,1);
+disp(A)
+disp('Here,C2=3*C1,Therefore the columns are linearly dependent.')
+disp('R3->R3-2*R2+5*R1')
+B(3,:)=B(3,:)-2*B(2,:)+5*B(1,:);
+disp(B)
+disp('Here R3=R3-2*R2+5*R1,therefore the rows are linearly dependent.')
+//end \ No newline at end of file
diff --git a/70/CH2/EX2.3.3/2_3_3.sci b/70/CH2/EX2.3.3/2_3_3.sci
new file mode 100755
index 000000000..1ae8111a3
--- /dev/null
+++ b/70/CH2/EX2.3.3/2_3_3.sci
@@ -0,0 +1,7 @@
+clear;
+close;
+clc;
+A=[3 4 2;0 1 5;0 0 2];
+disp(A,'A=');
+disp('The columns of the triangular matrix are linearly independent,it has no zeros on the diagonal');
+//end \ No newline at end of file
diff --git a/70/CH2/EX2.3.4/2_3_4.sci b/70/CH2/EX2.3.4/2_3_4.sci
new file mode 100755
index 000000000..b066bde99
--- /dev/null
+++ b/70/CH2/EX2.3.4/2_3_4.sci
@@ -0,0 +1,9 @@
+//page 93
+clear;
+close;
+clc;
+disp('The columns of the nxn identity matrix are independent.')
+n=input('Enter n:');
+I=eye(n,n);
+disp(I,'I=');
+//end \ No newline at end of file
diff --git a/70/CH2/EX2.3.5/2_3_5.sci b/70/CH2/EX2.3.5/2_3_5.sci
new file mode 100755
index 000000000..420270172
--- /dev/null
+++ b/70/CH2/EX2.3.5/2_3_5.sci
@@ -0,0 +1,10 @@
+//page 93
+clear;
+close;
+clc;
+disp('Three columns in R2 cannot be independent.')
+A=[1 2 1;1 2 3];
+disp(A,'Given matrix:')
+[L,U]=lu(A);
+disp(U,'U=');
+disp('If c3 is 1 ,then back-substitution Uc=0 gives c2=-1,c1=1,With these three weights,the first column minus the second plus the third equals zero ,therefore linearly dependent.') \ No newline at end of file
diff --git a/70/CH2/EX2.3.6/2_3_6.sci b/70/CH2/EX2.3.6/2_3_6.sci
new file mode 100755
index 000000000..577c595fa
--- /dev/null
+++ b/70/CH2/EX2.3.6/2_3_6.sci
@@ -0,0 +1,6 @@
+//page 93
+clear;
+close;
+clc;
+disp('The vectors w1=(1,0,0),w2=(0,1,0),w3=(-2,0,0) span a plane (x-y plane) in R3. The first two vectors also span this plane, whereas w1 and w3 span only a line.');
+//end \ No newline at end of file
diff --git a/70/CH2/EX2.3.7/2_3_7.sci b/70/CH2/EX2.3.7/2_3_7.sci
new file mode 100755
index 000000000..5643403e2
--- /dev/null
+++ b/70/CH2/EX2.3.7/2_3_7.sci
@@ -0,0 +1,6 @@
+//page 93
+clear;
+close;
+clc;
+disp('The column space of A is excatly the space that is spanned by its columns.The row space is spanned by the rows.The definition is made to order.Multiplying A by any x gives a combination of columns; it is a vector Ax in the column space. The coordinate vectors e_1,....e_n coming from the identity matrix span Rn. Every vector b=(b_1.....,b_n) is a combination of those columns.In this example the weights are the components b_i themselves:b=b_1e_1+.....+b_ne_n.But the columns of other matrices also span R_.')
+//end \ No newline at end of file
diff --git a/70/CH2/EX2.3.8/2_3_8.sci b/70/CH2/EX2.3.8/2_3_8.sci
new file mode 100755
index 000000000..91e9da307
--- /dev/null
+++ b/70/CH2/EX2.3.8/2_3_8.sci
@@ -0,0 +1,6 @@
+//page 93
+clear;
+close;
+clc;
+disp('Here,the vector v1 by itself is linearly independent , but it fails to span R2.The three vectors v1,v2,v3 certainly span R2, but are not independent. Any two of these vectors say v1 and v2 have both properties -they span and they are independent.So they form a basis.(A vector space does not have a unique basis)')
+//end \ No newline at end of file
diff --git a/70/CH2/EX2.3.9/2_3_9.sci b/70/CH2/EX2.3.9/2_3_9.sci
new file mode 100755
index 000000000..0ebfdd8db
--- /dev/null
+++ b/70/CH2/EX2.3.9/2_3_9.sci
@@ -0,0 +1,8 @@
+//page 96
+clear;
+close;
+clc;
+disp('These four columns span the column space U,but they are not independent.')
+U=[1 3 3 2;0 0 3 1;0 0 0 0];
+disp(U,'U=');
+disp('The columns that contains pivots (here 1st & 3rd) are a basis for the column space. These columns are independent, and it is easy to see that they span the space.In fact,the column space of U is just the x-y plane withinn R3. C(U) is not the same as the column space C(A) before elimination-but the number of independent columns did not change.') \ No newline at end of file
diff --git a/70/CH2/EX2.4.1/2_4_1.sci b/70/CH2/EX2.4.1/2_4_1.sci
new file mode 100755
index 000000000..aae98fbdf
--- /dev/null
+++ b/70/CH2/EX2.4.1/2_4_1.sci
@@ -0,0 +1,20 @@
+//page 107
+clear;
+close;
+clc;
+A=[1 2;3 6];
+disp(A,'A=');
+[m,n]=size(A);
+disp(m,'m=');
+disp(n,'n=');
+[v,pivot]=rref(A);
+r=length(pivot);
+disp(r,'rank=')
+cs=A(:,pivot);
+disp(cs,'Column space=');
+ns=kernel(A);
+disp(ns,'Null space=');
+rs=v(1:r,:)';
+disp(rs,'Row space=')
+lns=kernel(A');
+disp(lns,'Left null sapce=');
diff --git a/70/CH2/EX2.4.2/2_4_2.sci b/70/CH2/EX2.4.2/2_4_2.sci
new file mode 100755
index 000000000..0b18a01c4
--- /dev/null
+++ b/70/CH2/EX2.4.2/2_4_2.sci
@@ -0,0 +1,15 @@
+//page 108
+clear;
+close;
+clc;
+A=[4 0 0;0 5 0];
+disp(A,'A=');
+[m,n]=size(A);
+disp(m,'m=');
+disp(n,'n=')
+r=rank(A);
+disp(r,'rank=');
+disp('since m=r=2 ,there exists a right inverse .');
+C=A'*inv(A*A');
+disp(C,'Best right inverse=')
+//end \ No newline at end of file
diff --git a/70/CH2/EX2.5.1/2_5_1.sci b/70/CH2/EX2.5.1/2_5_1.sci
new file mode 100755
index 000000000..8452e5853
--- /dev/null
+++ b/70/CH2/EX2.5.1/2_5_1.sci
@@ -0,0 +1,21 @@
+//page 121
+clear;
+close;
+clc;
+disp('Applying current law A''y=f at nodes 1,2,3:')
+A=[-1 1 0;0 -1 1; -1 0 1;0 0 -1;-1 0 0];
+disp(A','A''=');
+C=diag(rand(5,1)); //Taking some values for the resistances.
+b=zeros(5,1);
+b(3,1)=rand(1);//Taking some value of the battery.
+f=zeros(3,1);
+f(2,1)=rand(1);//Taking some value of the current source.
+B=[b;f];
+disp('The other equation is inv(C)y+Ax=b.The block form of the two equations is:')
+C=[inv(C) A;A' zeros(3,3)];
+disp(C);
+X=['y1';'y2';'y3';'y4';'y5';'x1';'x2';'x3'];
+disp(X,'X=')
+X=C\B;
+disp(X,'X=');
+//end \ No newline at end of file