summaryrefslogtreecommitdiff
path: root/3889/CH2/EX2.4
diff options
context:
space:
mode:
authorprashantsinalkar2018-02-03 11:01:52 +0530
committerprashantsinalkar2018-02-03 11:01:52 +0530
commit7bc77cb1ed33745c720952c92b3b2747c5cbf2df (patch)
tree449d555969bfd7befe906877abab098c6e63a0e8 /3889/CH2/EX2.4
parentd1e070fe2d77c8e7f6ba4b0c57b1b42e26349059 (diff)
downloadScilab-TBC-Uploads-7bc77cb1ed33745c720952c92b3b2747c5cbf2df.tar.gz
Scilab-TBC-Uploads-7bc77cb1ed33745c720952c92b3b2747c5cbf2df.tar.bz2
Scilab-TBC-Uploads-7bc77cb1ed33745c720952c92b3b2747c5cbf2df.zip
Added new codeHEADmaster
Diffstat (limited to '3889/CH2/EX2.4')
-rw-r--r--3889/CH2/EX2.4/Ex2_4.sce50
-rw-r--r--3889/CH2/EX2.4/Ex2_4output.PNGbin0 -> 19926 bytes
2 files changed, 50 insertions, 0 deletions
diff --git a/3889/CH2/EX2.4/Ex2_4.sce b/3889/CH2/EX2.4/Ex2_4.sce
new file mode 100644
index 000000000..00723546e
--- /dev/null
+++ b/3889/CH2/EX2.4/Ex2_4.sce
@@ -0,0 +1,50 @@
+//Example 2.4
+//page 63
+//Control Systems: Principles and Design
+//M Gopal, Second Edition, Tata McGraw-Hill
+//Chapter: Dynamic Models and Dynamic Response
+
+
+xdel(winsid())//close all graphics Windows
+clear;
+clc;
+
+// Transfer function
+s= %s;
+//s=poly(0,'s');
+y=1;
+r=(s^2) + (3*s) + 2;
+//continuous time linear model created
+g=syslin('c',y/r);
+
+clf();
+t=0:0.5:100;
+a=size(t)
+u=ones(a(1),a(2));
+//step response
+y1=csim(u,t,[g*5]);
+
+//ramp response
+u2= 5* t;
+y2=csim(u2,t,g)
+
+//plot
+subplot(211)
+plot(t,y1)
+m=gca();
+m.auto_scale = "off"
+m.data_bounds = [0,0;6,6]
+plot(t,5*u)
+title('Step Response of transfer function','fontsize',3)
+xlabel('Time t (sec.)','fontsize',2)
+ylabel('Amplitude','fontsize',2)
+subplot(212)
+plot(t,y2)
+m=gca();
+m.auto_scale = "off"
+m.data_bounds = [0,0;10,10]
+
+plot(t,u2)
+title('Ramp Response of transfer function','fontsize',3)
+xlabel('Time t (sec.)','fontsize',2)
+ylabel('Amplitude','fontsize',2)
diff --git a/3889/CH2/EX2.4/Ex2_4output.PNG b/3889/CH2/EX2.4/Ex2_4output.PNG
new file mode 100644
index 000000000..6a2d654de
--- /dev/null
+++ b/3889/CH2/EX2.4/Ex2_4output.PNG
Binary files differ