Learning Control System Using Matlab _ naeem_(Part_01)

Posted on at


a)       

Coding

 

   p=[1 2 1];

   q=[0 1 1];

   x=p.*q;

   x

   Result

x =

 

     0     2     1

b)       

Coding

             Rp = roots(p)

Result

             Rp =

                   -1

                   -1

……………………………………………….……………………………………………………

c)       

Coding

s = -1 ;

p = s.^2 + 2*s + 1

result

   p =

       0

Coding

       s = 6 ;

       p = s + 1

Result

p =

     7

a)   

Coding

     b=[2 5 3 6 ];

     a=[1 6 11 6];

     [r,p ,k]=residue(b,a)

Results

r =

      -6.0000

    -4.0000

       3.0000

p =

   -3.0000

   -2.0000

   -1.0000

k =

     2        

…………………………………..

b)    

Coding

       b=[2 2 3];

       a=([1 1]).^3;

       [r,p ,k]=residue(b,a)

Results

r =

     3

p =

   -1

k =

     2    

…………………………………..

Coding

         p=2.9;

n(1)=0.5;

for(x=1:100)

a(x+1)=p*n(x)*(1-n(x));

n(x+1)=a(x+1);

end

z=[n(1) a(1,2:100)]

Result

z =

Columns 1 through 6

   0.5000   0.7250   0.5782   0.7073   0.6004   0.6958

Columns 7 through 12

   0.6139   0.6874   0.6232   0.6810   0.6300   0.6760

Columns 13 through 18

   0.6352   0.6720   0.6392   0.6688   0.6424   0.6662

Columns 19 through 24

   0.6449   0.6641   0.6469   0.6624   0.6485   0.6611

Columns 25 through 30

   0.6498   0.6600   0.6508   0.6591   0.6516   0.6583

Columns 31 through 36

   0.6523   0.6577   0.6529   0.6572   0.6533   0.6568

Columns 37 through 42

   0.6537   0.6565   0.6539   0.6563   0.6542   0.6561

Columns 43 through 48

   0.6544   0.6559   0.6545   0.6558   0.6546   0.6556

Columns 49 through 54

   0.6547   0.6556   0.6548   0.6555   0.6549   0.6554

Columns 55 through 60

   0.6549   0.6554   0.6550   0.6553   0.6550   0.6553

Columns 61 through 66

   0.6551   0.6553   0.6551   0.6553   0.6551   0.6552

Columns 67 through 72

   0.6551   0.6552   0.6551   0.6552   0.6551   0.6552

Columns 73 through 78

   0.6551   0.6552   0.6551   0.6552   0.6552   0.6552

Columns 79 through 84

   0.6552   0.6552   0.6552   0.6552   0.6552   0.6552

Columns 85 through 90

   0.6552   0.6552   0.6552   0.6552   0.6552   0.6552

Columns 91 through 96

   0.6552   0.6552   0.6552   0.6552   0.6552   0.6552

Columns 97 through 100

   0.6552   0.6552   0.6552   0.6552

Coding

a)  

 

syms y0 e w t th

       y=y0*exp(-e*w.*t)* sin(w*sqrt(1-e^2).*t+th)/sqrt(1-e)

Result

       y =

       (y0*exp(-e*t*w)*sin(th + t*w*(1 - e^2)^(1/2)))/(1 - e)^(1/2)

b)    

CASE_01

Coding

syms y0 e w t th

y=y0*exp(-e*w.*t)* sin(w*sqrt(1-e^2).*t+th)/sqrt(1-e);

T=0:0.1:10;

r=subs(y,{y0,e,w,t,th},{0.15,3/(2*sqrt(2)),sqrt(2),T,0});

plot(T,r)

xlabel('TIME AXIS')

ylabel('OUTPUT')

title('CASE 01')

Result

a)    

CASE_02

Coding

syms y0 e w t th

y=y0*exp(-e*w.*t)* sin(w*sqrt(1-e^2).*t+th)/sqrt(1-e);

T=0:0.1:10;

r=subs(y,{y0,e,w,t,th},{0.15,1/(2*sqrt(2)),sqrt(2),T,0}) ;

plot(T,r)

xlabel('TIME AXIS')

ylabel('OUTPUT')

title('CASE 02')

Result

Coding

Tf=0;

x=1;;

while(Tf<201)

Tc(x)=Tf*5/9-32;

x=x+1;

Tf=Tf+10;

end

Tc

Result

Tc =

Columns 1 through 6

-32.0000 -26.4444 -20.8889 -15.3333   -9.7778   -4.2222

Columns 7 through 12

   1.3333   6.8889   12.4444   18.0000   23.5556   29.1111

Columns 13 through 18

   34.6667   40.2222   45.7778   51.3333   56.8889   62.4444

Columns 19 through 21

   68.0000   73.5556   79.1111

Coding

syms n;

y=exp(-n)*sin(8*n);

n=0:0.1:2*pi;

r=subs(y,n);

plot(n,r);

xlabel('TIME ASIX');

ylabel('Y(X)');

title('OUTPUT');

Result

 



About the author

naeem-annex

I'm a Student of BS ELECTRONIC ENGINEERING at FET/DEE/IIUI Islamabad , Pakistan
I like to write blogs on Film Annex

Subscribe 0
160