summaryrefslogtreecommitdiff
path: root/Working_Examples/3432/CH6/EX6.9/Ex6_9.sce
blob: a66b127dc869200961c00b855b2a0ad39dc60073 (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
51
52
53
//Example 6.9
// Nyquist plot for a third order system.

xdel(winsid())//close all graphics Windows
clear;
clc;
//------------------------------------------------------------------
//System transfer function 
s=poly(0,'s');
g=syslin('c',1/(s*(s+1)^2));

//The bode plot of the system
fmin=0.01/2/%pi;
fmax=100/2/%pi;
//[frq,repf]=repfreq(g1,fmin,fmax,0.01);
bode(g,fmin,fmax,"rad");
frq=[1,10]/2/%pi;
[frq, repf]=repfreq(g,frq);
[db, phi]=dbphi(repf);
plot(frq*2*%pi,db,'ro');
exec .\fig_settings.sci; //custom script for setting figure properties
title(["Bode plot for","$G(s)=1/[s(s+1)^2]$"],'fontsize',3)
//zoom_rect([[0.1 0] -70 [12 -180] 20])
xset("font size", 3);

xstring(1,0,"$C\,\, (\omega=1)$",0,0);
xstring(2,-75,"$E\,\, (\omega=10)$",0,0);
f=gca();

//------------------------------------------------------------------
//The nyquist plot of the system
figure;
nyquist(g,0.8/2/%pi,10/2/%pi,0.02)

exec .\fig_settings.sci; //custom script for setting figure properties
title(["Nyquist plot for","$G(s)=1/[s(s+1)]^2$"],'fontsize',3)
f=gca();
f.x_location = "origin";
f.y_location = "origin";
zoom_rect([-1 -0.2 0.5 0.2]);
xset("clipping", -1.2, 0.2, 1.4,0.4);
xset("font size", 3);
xset("color",2);
xstring(-0.6,0.1,"${\fgcolor{blue}{\omega<0}}$",0,0);
xstring(-0.6,-0.1,"${\fgcolor{blue}{\omega>0}}$",0,0);
xstring(-0.7,0.005,"${\fgcolor{blue}{\omega=\pm 1}}$",0,0);
xstring(-1,-0.2,...
"${\fgcolor{blue}{\text{From \infty at \omega=0^+}}$",0,0);
 xstring(-0.7,0.15,"${\fgcolor{blue}...
 {\text{Towards \infty at \omega=0^-}}$",0,0);
xstring(-0.525,-0.04,"C",0,0);
xstring(-0.075,0,"E",0,0);
//------------------------------------------------------------------