% Fig. 6.7    Feedback Control of Dynamic Systems, 8e 
%             Franklin, Powell, Emami
%
 
clear all;
close all;
clf

figure(1)

subplot(2,1,1)

num=[10 1];
den=1;

w=logspace(-3,3);

[m,p]=bode(num,den,w);
%m1=ones(50,1)./m;

loglog(w,m,'LineWidth',2);

axis([.001 100 .01 100])
grid on;
xlabel('\omega (rad/sec)');
ylabel('Magnitude');
title('Magnitude plot for j\omega \tau + 1; \tau = 10');

subplot(2,1,2)
% Fig. 6.8   Feedback Control of Dynamic Systems, 8e 
%             Franklin, Powell, Emami
%

%w=logspace(-3,2);

[m,p] = bode(num,den,w);

%p1=-p;

% asymptote
wa=[.02 .5];
pa=[0 90];
semilogx( w, p,'LineWidth',2);
axis([.001 100 -100 100])
%semilogx(w,p1,'-',wa,pa,'--','LineWidth',2);
grid on;
xlabel('\omega (rad/sec)');
ylabel('Phase');
title('Phase plot for j\omega \tau + 1; \tau = 10');




figure(2)

subplot(2,1,1)

num=1;
den=[10 1];

w=logspace(-3,3);

[m,p]=bode(num,den,w);
%m1=ones(50,1)./m;

loglog(w,m,'LineWidth',2);

axis([.001 100 .01 100])
grid on;
xlabel('\omega (rad/sec)');
ylabel('Magnitude');
title('Magnitude plot for 1/(j\omega \tau + 1); \tau = 10');

subplot(2,1,2)
% Fig. 6.8   Feedback Control of Dynamic Systems, 8e 
%             Franklin, Powell, Emami
%

%w=logspace(-3,2);

[m,p]=bode(num,den,w);

%p1=-p;

% asymptote
wa=[.02 .5];
pa=[0 90];
semilogx( w, p,'LineWidth',2);
axis([.001 100 -100 100])
%semilogx(w,p1,'-',wa,pa,'--','LineWidth',2);
grid on;
xlabel('\omega (rad/sec)');
ylabel('Phase');
title('Phase plot for 1/(j\omega \tau + 1); \tau = 10');


