Frequency response plots corresponding to G =
s + 1
---------------
s^2 + 0.2 s + 1
BODE(ƒ1,ƒ2,[numerator],[denominator]) enter
Home Screen. (all functions are executed from Home screen)
BODE(-2,2,[1 1],[1 .2 1]) enter
Use VIEW key for Plot selection
VIEW>>START to refresh
Soft menu to Zoom....
App is based on
Statistics_2Var_Copy.
Code:
Tf();
BODE();
VIEW "Start/Info",START()
BEGIN
C1:={};
C2:={};
S1:={'C1','C2','1','12'};
STARTVIEW(6,1);
WAIT();
STARTVIEW(-1,1);
END;
export BODE(Xmin,Xmax,num,den)
BEGIN
local num:=poly2symb(num,"*x");
local den:=poly2symb(den,"*x");
expand(num/den)▶F1;
Xtick:=0.01;
makelist(ALOG(X),X,Xmin,Xmax,Xtick)▶L1;
Statistics_2Var_Copy.Xmin:=ALOG(Xmin);
Statistics_2Var_Copy.Xmax:=ALOG(Xmax);
L2:=Tf(L1);
L7:=20*LOG(ABS(L2));
L3:=ARG(L2);
L4:=IM(L2);
L5:=RE(L2);
END;
EXPORT Tf(x)
BEGIN
L2:=(F1(X)|x=L1);
END;
VIEW "Nyquist",nyquist()
BEGIN
S1:={'C1','C2','1','12'};
L4▶C2;
L5▶C1;
Xmin:= FLOOR(MIN(C1)+1);
Xmax:= CEILING(MAX(C1)+1);
Xtick:=.2;
Ymin:= FLOOR(MIN(C2)+1);
Ymax:= CEILING(MAX(C2)+1);
END;
VIEW "Magnitude",Magnitude()
BEGIN
S1:={'C1','C2','1','12'};
C1:=L1;
C2:=L7;
Statistics_2Var_Copy.Xmin;
Statistics_2Var_Copy.Xmax;
Xtick:=10;
Ymin:= FLOOR(MIN(C2)+1);
Ymax:= CEILING(MAX(C2)+1);
END;
VIEW "Phase",Phase()
BEGIN
S1:={'C1','C2','1','12'};
C1:=L1;
C2:=L3;
Statistics_2Var_Copy.Xmin;
Statistics_2Var_Copy.Xmax;
Xtick:=10;
Ymin:= FLOOR(MIN(C2)+1);
Ymax:= CEILING(MAX(C2)+1);
END;
VIEW "Nichols",Nichols()
BEGIN
S1:={'C1','C2','1','12'};
C1:=L3;
C2:=L7;
Ymin:=Statistics_2Var_Copy.Xmin;
Ymax:=Statistics_2Var_Copy.Xmax;
Ytick:=10;
Xmin:= FLOOR(MIN(C1)+1);
Xmax:= CEILING(MAX(C1)+1);
END;
PLOT()
BEGIN
STARTVIEW(1,1);
END;