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 /1592/CH2 | |
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 '1592/CH2')
24 files changed, 284 insertions, 0 deletions
diff --git a/1592/CH2/EX2.1/example_2_1.sce b/1592/CH2/EX2.1/example_2_1.sce new file mode 100755 index 000000000..cbd2edd34 --- /dev/null +++ b/1592/CH2/EX2.1/example_2_1.sce @@ -0,0 +1,12 @@ +//Scilab Code for Example 2.1 of Signals and systems by
+//P.Ramakrishna Rao
+//Laplace Transform
+clear;
+clc;
+syms t s X
+X=laplace(exp(-3*t)*cos(2*%pi*100*t),t,s)
+disp('On Simplification')
+//After Simplifying the above equation
+X=(s+3)/((s+3)^2 + (200*%pi)^2);
+disp("Re(s)>-3",X,"X(s)");
+//Re(s)>-3
diff --git a/1592/CH2/EX2.10/example_2_10.sce b/1592/CH2/EX2.10/example_2_10.sce new file mode 100755 index 000000000..c947cc9a9 --- /dev/null +++ b/1592/CH2/EX2.10/example_2_10.sce @@ -0,0 +1,14 @@ +//Scilab Code for Example 2.10 of Signals and systems by
+//P.Ramakrishna Rao
+//The value of X(s) is found by solving the differential equation
+clear;
+clc;
+syms t s;
+s= %s;
+X=pfss((s^2+8*s+6)/((s+2)*(s+3)*s));
+X(1)=1/s;
+f1=ilaplace(X(1))
+f2=ilaplace(X(2))
+f3=ilaplace(X(3))
+fz=f1+f2+f3;
+disp(fz*'u(t)',"c) x(t)=");
diff --git a/1592/CH2/EX2.15/Fig2_15.jpg b/1592/CH2/EX2.15/Fig2_15.jpg Binary files differnew file mode 100755 index 000000000..c044b28c2 --- /dev/null +++ b/1592/CH2/EX2.15/Fig2_15.jpg diff --git a/1592/CH2/EX2.15/example_2_15.sce b/1592/CH2/EX2.15/example_2_15.sce new file mode 100755 index 000000000..79c06a1df --- /dev/null +++ b/1592/CH2/EX2.15/example_2_15.sce @@ -0,0 +1,12 @@ +//Scilab Code for Example 2.15 of Signals and systems by
+//P.Ramakrishna Rao
+clear;
+clc;
+syms t y;
+s=%s;
+y=laplace(5*exp(-3*t),t,s);
+disp(y,"X(s)=");
+disp("Re(s)>-3");
+y=5/(s+3);
+plzr(y);
+
diff --git a/1592/CH2/EX2.16/Example_2_16.sce b/1592/CH2/EX2.16/Example_2_16.sce new file mode 100755 index 000000000..c57c1b999 --- /dev/null +++ b/1592/CH2/EX2.16/Example_2_16.sce @@ -0,0 +1,10 @@ +//Scilab Code for Example 2.16 of Signals and systems by
+//P.Ramakrishna Rao
+clear;
+clc;
+syms t y;
+s=%s;
+y=laplace(2*exp(-2*t)+3*exp(-3*t),t,s);
+disp(y,"X(s)=");
+y=(2/(s+2))+(3/(s+3));
+plzr(y);
diff --git a/1592/CH2/EX2.16/Fig2_16.jpg b/1592/CH2/EX2.16/Fig2_16.jpg Binary files differnew file mode 100755 index 000000000..6835c9391 --- /dev/null +++ b/1592/CH2/EX2.16/Fig2_16.jpg diff --git a/1592/CH2/EX2.17/Example_2_17.sce b/1592/CH2/EX2.17/Example_2_17.sce new file mode 100755 index 000000000..4fa6bfb13 --- /dev/null +++ b/1592/CH2/EX2.17/Example_2_17.sce @@ -0,0 +1,11 @@ +//Scilab Code for Example 2.17 of Signals and systems by
+//P.Ramakrishna Rao
+clear;
+clc;
+syms t y;
+s=%s;
+y=laplace(-2*exp(2*t)-3*exp(3*t),t,s);
+disp(y,"X(s)=");
+disp("Re(s)<2");
+y=(-2/(s-2))+(-3/(s-3));
+plzr(y);
diff --git a/1592/CH2/EX2.17/Fig2_17.jpg b/1592/CH2/EX2.17/Fig2_17.jpg Binary files differnew file mode 100755 index 000000000..c051925b5 --- /dev/null +++ b/1592/CH2/EX2.17/Fig2_17.jpg diff --git a/1592/CH2/EX2.19/Example_2_19.sce b/1592/CH2/EX2.19/Example_2_19.sce new file mode 100755 index 000000000..9705ff2eb --- /dev/null +++ b/1592/CH2/EX2.19/Example_2_19.sce @@ -0,0 +1,10 @@ +//Scilab Code for Example 2.19 of Signals and systems by
+//P.Ramakrishna Rao
+clear;
+clc;
+syms t y;
+s=%s;
+y=laplace(exp(-t)-exp(2*t),t,s);
+disp(y,"X(s)=");
+y=(1/(s+1))-(1/(s-2));
+plzr(y);
diff --git a/1592/CH2/EX2.19/Fig2_19.jpg b/1592/CH2/EX2.19/Fig2_19.jpg Binary files differnew file mode 100755 index 000000000..a1d87749b --- /dev/null +++ b/1592/CH2/EX2.19/Fig2_19.jpg diff --git a/1592/CH2/EX2.2/example_2_2.sce b/1592/CH2/EX2.2/example_2_2.sce new file mode 100755 index 000000000..e12d1d842 --- /dev/null +++ b/1592/CH2/EX2.2/example_2_2.sce @@ -0,0 +1,10 @@ +//Scilab Code for Example 2.2 of Signals and systems by
+//P.Ramakrishna Rao
+//Inverse Laplace Transform
+clc;
+clear;
+syms t s
+X=(s+2)/(s^2+8*s+25)
+f4=ilaplace(X);
+disp(f4*'u(t)',"x(t)=");
+//t>=0
diff --git a/1592/CH2/EX2.21/Example_2_21.sce b/1592/CH2/EX2.21/Example_2_21.sce new file mode 100755 index 000000000..2c3dcc584 --- /dev/null +++ b/1592/CH2/EX2.21/Example_2_21.sce @@ -0,0 +1,15 @@ +//Scilab Code for Example 2.21 of Signals and systems by
+//P.Ramakrishna Rao
+//Z- transform of a^n u(n)
+clear;
+clc ;
+close ;
+syms a n z;
+x1 =1/2;
+x2=1/3;
+X1= symsum (x1*(z^(-n)),n ,0, %inf );
+X2= symsum (x2*(z^(-n)),n ,0, %inf );
+X=X1+X2;
+//Display the result
+disp (X,"Z-transform of u(n) is:");
+disp('ROC is the Region |z|> 1/2');
diff --git a/1592/CH2/EX2.29/example_2_29.sce b/1592/CH2/EX2.29/example_2_29.sce new file mode 100755 index 000000000..6f6cb0ad0 --- /dev/null +++ b/1592/CH2/EX2.29/example_2_29.sce @@ -0,0 +1,13 @@ +//Scilab Code for Example 2.29 of Signals and systems by
+//P.Ramakrishna Rao
+//Z- transform of a^n u(n)
+clear;
+clc ;
+close ;
+syms a n z;
+x =1;
+X= symsum (x*(z^(-n)),n ,0, %inf );
+//Display the result
+disp (X,"Z-transform of u(n) is:");
+disp('ROC is the Region |z|> 1')
+
diff --git a/1592/CH2/EX2.3/example_2_3.sce b/1592/CH2/EX2.3/example_2_3.sce new file mode 100755 index 000000000..f526f8b5d --- /dev/null +++ b/1592/CH2/EX2.3/example_2_3.sce @@ -0,0 +1,19 @@ +//Scilab Code for Example 2.3 of Signals and systems by
+//P.Ramakrishna Rao
+clear;
+clc;
+syms s0;
+s=%s;
+I=(s+8)/(s^2+6*s+13)
+i=pfss(s*I)
+disp(i(1),"sF(s)(1)=")
+disp(i(2),"sF(s)(2)=")
+I1=(2*s0-13)/(s0^2+6*s0+13);
+I2=1;
+Io1=limit(I1,s0,10^8);
+Io2=limit(I2,s0,10^8);
+Ix=2-((25*s0+26)/(s0^2+6*s0+13));
+f0=(Io1)+(Io2);
+f0_dash=limit(Ix,s0,10^8);
+disp(f0,'INITIAL VALUE OF f(t) i.e. f(0)=');
+disp(abs(f0_dash),'INITIAL VALUE OF f(t) i.e. f''(0)=');
diff --git a/1592/CH2/EX2.37/example_2_37.sce b/1592/CH2/EX2.37/example_2_37.sce new file mode 100755 index 000000000..6ae95d033 --- /dev/null +++ b/1592/CH2/EX2.37/example_2_37.sce @@ -0,0 +1,24 @@ +//Scilab Code for Example 2.37 of Signals and systems by
+//P.Ramakrishna Rao
+//Inverse Z Transform:ROC 1<|z|<2
+clear;
+clc;
+z = %z;
+syms n z1;
+//To find out Inverse z transform z must be linear z = z1
+X =(z*(z^2-z+1))/((z-0.5)*(z-2)*(z-1))
+X1 = denom(X);
+zp = roots(X1);
+X1 = (z1*(z1^2-z1+1))/((z1-0.5)*(z1-2)*(z1-1))
+F1 = X1*(z1^(n-1))*(z1-zp(1))
+F2 = X1*(z1^(n-1))*(z1-zp(2))
+F3 = X1*(z1^(n-1))*(z1-zp(3))
+h1 = limit(F1,z1,zp(1));
+disp(h1*'u(-n-1)','h1[n]=')
+h2 = limit(F2,z1,zp(2));
+disp((h2)*'u(n)','h2[n]=')
+h3 = limit(F3,z1,zp(3));
+disp((h3)*'u(n)','h3[n]=')
+disp((h3)*'u(n)'+(h2)*'u(n)'-(h1)*'u(-n-1)','h[n]=')
+////Result
+// h[n]=1* 0.5 ^n *u(n) - 2*u(n) - 2* 2^n *u(- n - 1)
diff --git a/1592/CH2/EX2.38.a/example_2_38_i_.sce b/1592/CH2/EX2.38.a/example_2_38_i_.sce new file mode 100755 index 000000000..74a4d079d --- /dev/null +++ b/1592/CH2/EX2.38.a/example_2_38_i_.sce @@ -0,0 +1,21 @@ +//Scilab Code for Example 2.38(i) of Signals and systems by
+//P.Ramakrishna Rao
+//Inverse Z Transform:ROC |z|>2
+clear;
+clc;
+z = %z;
+syms n z1;
+//To find out Inverse z transform z must be linear z = z1
+X =z^2/(z^2+3*z+2);
+X1 = denom(X);
+zp = roots(X1)
+X1 = z1^2/(z1^2+3*z1+2);
+F1 = X1*(z1^(n-1))*(z1-zp(1));
+F2 = X1*(z1^(n-1))*(z1-zp(2));
+h1 = limit(F1,z1,zp(1));
+disp(h1*'u(n)','h1[n]=')
+h2 = limit(F2,z1,zp(2));
+disp((h2)*'u(n)','h2[n]=');
+disp((h1)*'u(n)'+(h2)*'u(n)','h[n]=');
+////Result
+// h[n]= (2(- 2)^n+1 - (- 1)^n)*u(n)
diff --git a/1592/CH2/EX2.38.b/example_2_38_ii_.sce b/1592/CH2/EX2.38.b/example_2_38_ii_.sce new file mode 100755 index 000000000..457edbdad --- /dev/null +++ b/1592/CH2/EX2.38.b/example_2_38_ii_.sce @@ -0,0 +1,17 @@ +//Scilab Code for Example 2.38(ii) of Signals and systems by
+//P.Ramakrishna Rao
+//Inverse Z Transform:ROC |z|>2
+clear;
+clc;
+z = %z;
+syms n z1;
+//To find out Inverse z transform z must be linear z = z1
+X =(z+1)/(z^2+5*z+4)
+X1 = denom(X);
+zp = roots(X1)
+X1 = 1/(z1+4);
+F1 = X1*(z1^(n))*(z1-zp(1));
+h1 = limit(F1,z1,zp(1))
+disp(-(h1)*'u(-n-1)','h[n]=');
+////Result
+// h[n]= (- (- 4)^n)*u(-n-1)
diff --git a/1592/CH2/EX2.39/Example_2_39.sce b/1592/CH2/EX2.39/Example_2_39.sce new file mode 100755 index 000000000..926d8ec86 --- /dev/null +++ b/1592/CH2/EX2.39/Example_2_39.sce @@ -0,0 +1,17 @@ +//Scilab Code for Example 2.39 of Signals and systems by
+//P.Ramakrishna Rao
+//Inverse Z Transform:ROC |z|>2
+clear;
+clc;
+z = %z;
+syms n z1;
+//To find out Inverse z transform z must be linear z = z1
+X =2/(z^-1+2);
+X1 = denom(X);
+zp = roots(X1)
+X1 =z1/(z1+0.5);
+F1 = X1*(z1^(n-1))*(z1-zp(1));
+h1 = limit(F1,z1,zp(1))
+disp(-(h1)*'u(-n-1)','h[n]=');
+////Result
+// h[n]= (- (- 0.5)^n)*u(-n-1)
diff --git a/1592/CH2/EX2.4/example_2_4.sce b/1592/CH2/EX2.4/example_2_4.sce new file mode 100755 index 000000000..78ce3d9c0 --- /dev/null +++ b/1592/CH2/EX2.4/example_2_4.sce @@ -0,0 +1,8 @@ +//Scilab Code for Example 2.4 of Signals and systems by
+//P.Ramakrishna Rao
+clear;
+clc;
+//Time shifted laplace Transform
+syms t y s a0;
+y=laplace('t*exp(-s*a0)',t,s);
+disp("Re(s)>0",y,"X(s)");
diff --git a/1592/CH2/EX2.40/Example_2_40.sce b/1592/CH2/EX2.40/Example_2_40.sce new file mode 100755 index 000000000..2a1c0c7fe --- /dev/null +++ b/1592/CH2/EX2.40/Example_2_40.sce @@ -0,0 +1,21 @@ +//Scilab Code for Example 2.40 of Signals and systems by
+//P.Ramakrishna Rao
+//Inverse Z Transform:ROC |z|>2
+clear;
+clc;
+z = %z;
+syms n z1;
+//To find out Inverse z transform z must be linear z = z1
+X =z^2/((z-0.5)*(z-1));
+X1 = denom(X);
+zp = roots(X1)
+X1 = z1^2/((z1-0.5)*(z1-1));
+F1 = X1*(z1^(n-1))*(z1-zp(1));
+F2 = X1*(z1^(n-1))*(z1-zp(2));
+h1 = limit(F1,z1,zp(1));
+disp(h1*'u(n)','h1[n]=')
+h2 = limit(F2,z1,zp(2));
+disp((h2)*'u(n)','h2[n]=');
+disp(-(h1)*'u(-n-1)'-(h2)*'u(-n-1)','h[n]=');
+////Result
+// h[n]= ((0.5)^n - 2)*u(-n-1)
diff --git a/1592/CH2/EX2.6/example_2_6.sce b/1592/CH2/EX2.6/example_2_6.sce new file mode 100755 index 000000000..fbec056ec --- /dev/null +++ b/1592/CH2/EX2.6/example_2_6.sce @@ -0,0 +1,11 @@ +//Scilab Code for Example 2.6 of Signals and systems by
+//P.Ramakrishna Raoclear;
+clc;
+clear;
+syms s X x t R C V Vo;
+//After solving for I(s)
+//I(s)=(V-Vo)/R . 1/(s+1/RC)
+X=(V-Vo)/((s+1/(R*C))*R);
+disp(X,"I(s)=");
+x=ilaplace(X);
+disp(x,"i(t)=");
diff --git a/1592/CH2/EX2.7/example_2_7.sce b/1592/CH2/EX2.7/example_2_7.sce new file mode 100755 index 000000000..89a2ed39d --- /dev/null +++ b/1592/CH2/EX2.7/example_2_7.sce @@ -0,0 +1,19 @@ +//Scilab Code for Example 2.7 of Signals and systems by
+//P.Ramakrishna Rao
+//Unilateral Laplace Transform using partial fraction
+clear;
+clc;
+syms t s;
+s= %s;
+a1=pfss((s+3)/(s^2+3*s+2))
+f1=ilaplace(a1(1))
+f2=ilaplace(a1(2))
+fy=f1+f2
+disp(fy*'u(t)',"i) f(t)=")
+a2=pfss((2*s-1)/(s^2+2*s+1))
+a2(1)=2/(s+1)
+a2(2)=-3/(s+1)^2
+f1=ilaplace(a2(1))
+f2=ilaplace(a2(2))
+fz=f1+f2
+disp(fz*'u(t)',"ii) f(t)=")
diff --git a/1592/CH2/EX2.8/example_2_8.sce b/1592/CH2/EX2.8/example_2_8.sce new file mode 100755 index 000000000..cebf40a4d --- /dev/null +++ b/1592/CH2/EX2.8/example_2_8.sce @@ -0,0 +1,10 @@ +//Scilab Code for Example 2.8 of Signals and systems by
+//P.Ramakrishna Rao
+//Unilateral Laplace Transform
+clear;
+clc;
+syms t s
+s=%s;
+a=ilaplace(1/(s^3+s^2))
+b=a-3;
+disp(a*'u(t)'+b*'u(t-3)',"x(t)=")
diff --git a/1592/CH2/EX2.9/example_2_9.sce b/1592/CH2/EX2.9/example_2_9.sce new file mode 100755 index 000000000..02c6dfa6b --- /dev/null +++ b/1592/CH2/EX2.9/example_2_9.sce @@ -0,0 +1,10 @@ +//Scilab Code for Example 2.2 of Signals and systems by
+//P.Ramakrishna Rao
+clear;
+clc;
+syms s X;
+//After solving for I(s)
+//I(s)=2/(s+1)
+X=2/(s+1)
+x=ilaplace(X);
+disp(x,"i(t)=")
|