Cairo University
Aerospace Department
Spring 2013
Course: System Dynamics and
Control
Faculty Of Engineering
Third Year
State Space Approach
Problem Sheet #
Report Title
Solution of Time Response Problem Using MATLAB
Student
Name :
Abdelrhman Hussien Nassif
Grade:
B.N:
46
Date: 20/3/2013
Table of Contents
Introduction ........................................................................................................1
MATLAB Code..................................................................................................2
Transient Response .............................................................................................3
Conclusion .........................................................................................................4
References ..........................................................................................................5
List of Figures
Figure 1 Time response derived from equation (1)................................................3
Figure 2 Time Response using Step Syntax in MATLAB .....................................3
Introduction
Well solve this state space problem:
A= [
] , B= [
, C=[
To get the time response using Laplace transform solution of the state equation
with the aid of MATLAB symbolic toolbox well be able to solve the inverse
Laplace and get the response in the time domain.
MATLAB Code
A=[-0.5,-1.9,3.8;-1.9444,-2.0556,-3.8889;-0.9722,0.1722,-4.3444];
B=[1;-0.2;0];
C=[1,0,-.5];
X0=[0;0;0];
% Assumption
syms s;
U=1/s;
%Step input
SA=(s*eye(3))-A;
X= inv(SA)*(X0+(B*U));
Y=C*X;
Y=vpa(Y,3);
Yt=ilaplace(Y);
Yt=vpa(Yt,3);
pretty(Yt);
ezplot(Yt,[0,10]);
hold on ;
sys= ss(A,B,C,0);
step(sys);
The output of this code is as follows:
( )
(1)
Transient Response
Figure 1 Time response derived from equation (1)
Figure 2 Time Response using Step Syntax in MATLAB
Conclusion
Now weve concluded and verified that derived equation (1) could get the time
response for any state space model with any input.
References
MATLAB Symbolic Toolbox