summaryrefslogtreecommitdiff
path: root/Working_Examples/3432/CH9/EX9.5/Ex9_5.sce
blob: 327b8ced4482db86a61e1727a4cf76b7c00ae8a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//Example 9.5
//Changing Overshoot and Saturation nonlinearity.

xdel(winsid())//close all graphics Windows
clear;
clc;
//------------------------------------------------------------------
//System transfer function and its root locus 

s=poly(0,'s');
num=(s+1)
den=(s^2);
Gs=syslin('c',num/den)

//Root locus
evans(Gs,5)
title(["Root locus of", "$(s+1)/(s^2)$","with saturation removed"],...
'fontsize',3);
f=gca();
f.x_location = "origin"
f.y_location = "origin"
h=legend('');
h.visible = "off"
exec .\fig_settings.sci; //custom script for setting figure properties
//------------------------------------------------------------------
// Step response
K=1;
i=[2 4 6 8 10 12];
figure(1);
importXcosDiagram(".\Ex9_5_model.xcos")

for r=i
xcos_simulate(scs_m,4);
scs_m.props.context
plot(yt.time,yt.values)
end

xlabel('time');
ylabel('y');
title("Step response of the system for various input sizes",'fontsize',3);
exec .\fig_settings.sci; //custom script for setting figure properties

xset('font size',3);
xstring(4,2.5,"$r=2$");
xstring(6,5.5,"$4$");
xstring(8,8.7,"$6$");
xstring(10,12.2,"$8$");
xstring(12,15.4,"$10$");
xstring(14,18.4,"$12$");
//------------------------------------------------------------------