Friday, April 29, 2011

Coding Step Respon In Mathlab

It is tutorial how to making listing step Respon in Software Matlab..
1. Open Mathlab

2. File .
        M file
Inside code   exsample


m=2;
b=5;
k=3;
A=[0 1;-k/m -b/m];
B=[0;1/m];
C=[1 0];
D=0;
state_space=ss(A,B,C,D)
press F5 
a =
         x1    x2
   x1     0     1
   x2  -1.5  -2.5
b =
        u1
   x1    0
   x2  0.5
c =
       x1  x2
   y1   1   0
d =
       u1
   y1   0
>> [A,B,C,D]=ssdata(state_space)
A =
         0    1.0000
   -1.5000   -2.5000

B =
         0
    0.5000
C =
     1     0
D =
     0
>> step(state_space)
you get it

And find transfer function you can make it.

>> tutorial_tf=tf(state_space)
Transfer function:
       0.5
-----------------
s^2 + 2.5 s + 1.5

>> 

No comments:

Post a Comment