1.Continuing MATLAB® Exercise CME3.2 part (a). - Submit a MATLAB® script m-file
ID: 2084076 • Letter: 1
Question
1.Continuing MATLAB® Exercise CME3.2 part (a).
- Submit a MATLAB® script m-file that produces the required output.
2.Continuing Exercise CE3.2 part (a).
- Submit a MATLAB® script m-file that produces the numerical results that you integrate into your solution.
Explanation / Answer
General state space model equations are xdot=ax+bu
y=cx+du
For our model given
matlab command
a=[0 1 0;0 0 1;-52 -30 -4];
a =
0 1 0
0 0 1
-52 -30 -4
>> b=[0 ;0; 1]
b =
0
0
1
>> c=[20 1 0]
c =
20 1 0
d=0
for getting state space model matlab command
sys=ss(a,b,c,d)
a =
x1 x2 x3
x1 0 1 0
x2 0 0 1
x3 -52 -30 -4
b =
u1
x1 0
x2 0
x3 1
c =
x1 x2 x3
y1 20 1 0
d =
u1
y1 0
Now we will check the controllability of the system.
first we will check the system matrix
eig(a)
ans =
-2.0000
-1.0000 + 5.0000i
-1.0000 - 5.0000i
The rank of the system matrix
rank(a)
ans =
3
for controllability checking rank of controllability matrix has to be full rank
controllability matrix is =[b a*b a^2*b ---]
The matlab command for checking controllability is
ctest=ctrb(a,b);
>> rank(ctest)
ans =
3
The controllability matrix has full rank.
So system is controllable. hence first solution is given.
controllable cannonical form:
Convert statespace to transferfunction
[num,den]=ss2tf(a,b,c,d)
num =
0 0.0000 1.0000 20.0000
den =
1.0000 4.0000 30.0000 52.0000
>> sysaa=tf(num,den)
Transfer function:
1.776e-015 s^2 + s + 20
-----------------------
s^3 + 4 s^2 + 30 s + 52
>> Matlab command for getting cannonical form
>> Gc = canon(sysaa,'modal')
a =
x1 x2 x3
x1 -1 5 0
x2 -5 -1 0
x3 0 0 -2
b =
u1
x1 -0.4722
x2 -1.551
x3 0.8838
c =
x1 x2 x3
y1 -0.07532 0.4694 0.7833
d =
u1
y1 0
Continuous-time model.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.