summaryrefslogtreecommitdiff
path: root/1430/CH15/EX15.9/exa15_9.sce
diff options
context:
space:
mode:
authorprashantsinalkar2017-10-10 12:27:19 +0530
committerprashantsinalkar2017-10-10 12:27:19 +0530
commit7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch)
treedbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /1430/CH15/EX15.9/exa15_9.sce
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 '1430/CH15/EX15.9/exa15_9.sce')
-rw-r--r--1430/CH15/EX15.9/exa15_9.sce26
1 files changed, 26 insertions, 0 deletions
diff --git a/1430/CH15/EX15.9/exa15_9.sce b/1430/CH15/EX15.9/exa15_9.sce
new file mode 100644
index 000000000..d7d059c5f
--- /dev/null
+++ b/1430/CH15/EX15.9/exa15_9.sce
@@ -0,0 +1,26 @@
+// Example 15.9
+// Calculating the Zero-State Response
+s=%s;
+t=0:0.001:5;
+// From Transfer function Matrix equation i.e.
+//P(s)*H(s)=C*adj[s*I-A]*B+P(s)*[D+s*E]
+// Substituting various Matrices into the above equations we get
+P_s= (s+3)*(s+5)
+W=[6,10;0,-2]*[s,-5;3,s+8]*[-8,0;3,1]+(P_s)*[0,0;2,0];
+H_s=W/P_s;
+
+//To obtain the Zero-state outputs produced by x1(t)=u(t) and x2(t)=0
+X_s=[1/s;0]; // Laplace transform of input matrix
+Y_s=H_s*X_s;
+// Writing down two elements of Y_s
+Y_1=-18/(s*(s+3));
+// taking inverse laplace of Y_1
+y1= -6+6*exp(-3*t);
+Y_2=(2*s^2+10*s+30)/(s*(s+3)*(s+5));
+// taking inverse laplace of Y_2
+y2=2-3*exp(-3*t)+exp(-5*t);
+plot(t,y1,'-r',t,y2,'-g')
+xlabel('t')
+ylabel('y(t)')
+title('Signal Waveform')
+h1=legend(['y1';'y2']);