summaryrefslogtreecommitdiff
path: root/2279/CH3
diff options
context:
space:
mode:
authorprashantsinalkar2017-10-10 12:27:19 +0530
committerprashantsinalkar2017-10-10 12:27:19 +0530
commit7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch)
treedbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /2279/CH3
parentb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (diff)
downloadScilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.gz
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.bz2
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.zip
initial commit / add all books
Diffstat (limited to '2279/CH3')
-rw-r--r--2279/CH3/EX3.10/Ex3_10.sce37
-rw-r--r--2279/CH3/EX3.11/Ex3_11.sce37
-rw-r--r--2279/CH3/EX3.13/Ex3_13.sce33
-rw-r--r--2279/CH3/EX3.14/Ex3_14.sce48
-rw-r--r--2279/CH3/EX3.15/Ex3_15.sce17
-rw-r--r--2279/CH3/EX3.16/Ex3_16.sce21
-rw-r--r--2279/CH3/EX3.17/Ex3_17.sce18
-rw-r--r--2279/CH3/EX3.18/Ex3_18.sce14
8 files changed, 225 insertions, 0 deletions
diff --git a/2279/CH3/EX3.10/Ex3_10.sce b/2279/CH3/EX3.10/Ex3_10.sce
new file mode 100644
index 000000000..08efe6700
--- /dev/null
+++ b/2279/CH3/EX3.10/Ex3_10.sce
@@ -0,0 +1,37 @@
+//Example 3.10
+clc
+clear all
+t=0:0.01:20;
+function y=signal(x)
+ y=x
+endfunction
+//Assume v(t) as ramp signal
+v1=t;
+v2=t+2;
+//Assume R=1
+i1=signal(v1)
+i2=signal(v2)
+a=2;
+b=2;
+subplot(4,2,1)
+plot(t,a*v1)
+xtitle("a*v1(t)","t in sec","a*v1(t)");
+subplot(4,2,2)
+plot(t,signal(a*v1))
+xtitle("a*i1(t)","t in sec","a*i1(t)");
+subplot(4,2,3)
+plot(t,b*v2)
+xtitle("b*v2(t)","t in sec","b*v2(t)");
+subplot(4,2,4)
+plot(t,signal(b*v2))
+xtitle("b*i2(t)","t in sec","b*i2(t)");
+c=(a*v1)+(b*v2);
+subplot(4,2,5)
+plot(t,c)
+xtitle("v3(t)","t in sec","v3(t)");
+subplot(4,2,6)
+plot(t,signal(c))
+xtitle("i3(t)","t in sec","i3(t)");
+subplot(4,2,8)
+plot(t,signal(a*v1)+signal(b*v2))
+xtitle("LINEAR SYSTEM","t in sec","a*i1(t)+b*i2(t)");
diff --git a/2279/CH3/EX3.11/Ex3_11.sce b/2279/CH3/EX3.11/Ex3_11.sce
new file mode 100644
index 000000000..c60dfd651
--- /dev/null
+++ b/2279/CH3/EX3.11/Ex3_11.sce
@@ -0,0 +1,37 @@
+//Example 3.11
+clc
+clear all
+t=0:0.001:0.5;
+function i=signal(v)
+ i=exp(v);
+endfunction
+//Assume v(t) as ramp signal
+x1=2*ones(1,length(t));
+x2=t+2;
+//Assume R=1
+y1=signal(x1)
+y2=signal(x2)
+a=2;
+b=2;
+subplot(4,2,1)
+plot(t,a*x1)
+xtitle("a*x1(t)","t in sec","a*x1(t)");
+subplot(4,2,2)
+plot(t,signal(a*x1))
+xtitle("a*y1(t)","t in sec","a*y1(t)");
+subplot(4,2,3)
+plot(t,b*x2)
+xtitle("b*x2(t)","t in sec","b*x2(t)");
+subplot(4,2,4)
+plot(t,signal(b*x2))
+xtitle("b*y2(t)","t in sec","b*y2(t)");
+c=(a*x1)+(b*x2);
+subplot(4,2,5)
+plot(t,c)
+xtitle("x3(t)","t in sec","x3(t)");
+subplot(4,2,6)
+plot(t,signal(c))
+xtitle("y3(t)","t in sec","y3(t)");
+subplot(4,2,8)
+plot(t,signal(a*x1)+signal(b*x2))
+xtitle("NON-LINEAR SYSTEM","t in sec","a*y1(t)+b*y2(t)");
diff --git a/2279/CH3/EX3.13/Ex3_13.sce b/2279/CH3/EX3.13/Ex3_13.sce
new file mode 100644
index 000000000..86f976a05
--- /dev/null
+++ b/2279/CH3/EX3.13/Ex3_13.sce
@@ -0,0 +1,33 @@
+//Example 3.13
+clear;
+clc;
+x1 = [1,1,1,1];
+x2 = [2,2,2,2];
+a = 1;
+b = 1;
+for n = 1:length(x1)
+ x3(n) = a*x1(n)+b*x2(n);
+end
+for n = 1:length(x1)
+ y1(n) = x1(n)^2;
+ y2(n) = x2(n)^2;
+ y3(n) = x3(n)^2;
+end
+for n = 1:length(y1)
+ z(n) = a*y1(n)+b*y2(n);
+end
+count = 0;
+for n =1:length(y1)
+ if(y3(n)== z(n))
+ count = count+1;
+ end
+end
+if(count == length(y3))
+ disp('Since It satisifies the superposition principle')
+ disp('The given system is a Linear system')
+ y3
+ z
+ else
+ disp('Since It does not satisify the superposition principle')
+ disp('The given system is a Non-Linear system')
+end
diff --git a/2279/CH3/EX3.14/Ex3_14.sce b/2279/CH3/EX3.14/Ex3_14.sce
new file mode 100644
index 000000000..94cefa850
--- /dev/null
+++ b/2279/CH3/EX3.14/Ex3_14.sce
@@ -0,0 +1,48 @@
+//Example 3.14
+clear;
+clc;
+to = 2; //Assume the amount of time shift =2
+T=10;
+t=0:0.1:T;
+for i=1:length(t)
+ if (t(i)>=0 & t(i)<1)
+ x1(i) = t(i);
+ x2(i)=0;
+ elseif (t(i)>=1 & t(i)<2) then
+ x1(i)=1;
+ x2(i)=t(i)-1;
+ elseif (t(i)>=2 & t(i)<3) then
+ x1(i)=2;
+ x2(i)=1;
+ elseif (t(i)>=3 & t(i)<4)
+ x1(i)=0;
+ x2(i)=2;
+ else
+ x1(i)=0;
+ x2(i)=0;
+ end
+y1(i) = 2*(x1(i));
+y2(i)=2*x2(i);
+end
+figure(0);
+subplot(2,1,1);
+plot(t,x1);
+xtitle("x1(t)","t","x1(t)");
+subplot(2,1,2);
+plot(t,y1);
+xtitle("y1(t)=2*x1(t)","t","y1(t)");
+figure(1);
+subplot(2,1,1);
+plot(t,x2);
+xtitle("x2(t)","t","x2(t)");
+subplot(2,1,2);
+plot(t,y2);
+xtitle("y2(t)=2*x2(t)=2*x1(t-1)=y1(t-1)","t","y2(t)");
+//First shift the input signal only
+Input_shift = 2*(x1(T-to));
+Output_shift = y1(T-to);
+if(Input_shift == Output_shift)
+ disp('The given system is a Time In-variant system');
+else
+ disp('The given system is a Time Variant system');
+end
diff --git a/2279/CH3/EX3.15/Ex3_15.sce b/2279/CH3/EX3.15/Ex3_15.sce
new file mode 100644
index 000000000..564986888
--- /dev/null
+++ b/2279/CH3/EX3.15/Ex3_15.sce
@@ -0,0 +1,17 @@
+//Example 3.15
+clear;
+clc;
+to = 2; //Assume the amount of time shift =2
+T=10;
+for t = 1:0.01:T
+ x(t) = sin(t);
+ y(t) = sin(2*t);
+end
+//First shift the input signal only
+Input_shift = x(T-to);
+Output_shift = y(T-to);
+if(Input_shift == Output_shift)
+ disp('The given system is a Time In-variant system');
+else
+ disp('The given system is a Time Variant system');
+end
diff --git a/2279/CH3/EX3.16/Ex3_16.sce b/2279/CH3/EX3.16/Ex3_16.sce
new file mode 100644
index 000000000..a1ce9199a
--- /dev/null
+++ b/2279/CH3/EX3.16/Ex3_16.sce
@@ -0,0 +1,21 @@
+//Example 3.16
+clear;
+clc;
+no = 2; //Assume the amount of time shift =2
+L = 10; //Length of given signal
+for n = 1:L
+ x(n)=sin(n);
+ end
+ n=2;
+ for i=1:L
+ y(i)=x(n-1);
+ n=n+1;
+ end
+//First shift the input signal only
+Input_shift = x(L-no);
+Output_shift = y(L-no);
+if(Input_shift == Output_shift)
+ disp('The given discrete system is a Time In-variant system');
+else
+ disp('The given discrete system is a Time Variant system');
+end
diff --git a/2279/CH3/EX3.17/Ex3_17.sce b/2279/CH3/EX3.17/Ex3_17.sce
new file mode 100644
index 000000000..ab7272f88
--- /dev/null
+++ b/2279/CH3/EX3.17/Ex3_17.sce
@@ -0,0 +1,18 @@
+//Example 3.17
+clear;
+clc;
+no = 2; //Assume the amount of time shift =2
+L = 10; //Length of given signal
+for n = 1:L
+ x(n)=sin(n);
+ y(n)=-sin(n);
+ end
+
+//First shift the input signal only
+Input_shift = x(L-no);
+Output_shift = y(L-no);
+if(Input_shift == Output_shift)
+ disp('The given discrete system is a Time In-variant system');
+else
+ disp('The given discrete system is a Time Variant system');
+end
diff --git a/2279/CH3/EX3.18/Ex3_18.sce b/2279/CH3/EX3.18/Ex3_18.sce
new file mode 100644
index 000000000..ea9b05583
--- /dev/null
+++ b/2279/CH3/EX3.18/Ex3_18.sce
@@ -0,0 +1,14 @@
+//Example 3.18
+clc
+clear
+t=0:0.01:10;
+for i=1:length(t)
+ x(i)=sin(i);
+ y(i)=2*x(i);
+ z(i)=0.5*y(i);
+end
+if (x==z) then
+ disp("The given system is invertible");
+else
+ disp("the Given system is non-invertible");
+end