Beruflich Dokumente
Kultur Dokumente
2 List of equipment/software
Personal Computer
Installation of SCILAB
3 Overview
You have been introduced to frequency domain modeling (classical approach) as a way to
represent linear time-invariant system. Equations of most system dynamics contain integral and
derivative terms. By solving these equations in frequency domain, we can generate mathematical
models algebraically. You get transfer functions for each system which can simplify modeling
interconnected subsystems.
Another thing that makes state-space attractive is that it is represented in matrix form which
can be easily used in digital computer systems. Several mathematical software packages exist like
Matlab and Scilab that supports state-space operations.
In this activity, you will be using the state-space approach with the aid of Scilab. You will be
solving a problem and represent it’s model in frequency domain and state-space.
𝑥̇ = 𝐴𝑥 + 𝐵𝑢
𝑦 = 𝐶𝑥 + 𝐷𝑢
𝑥 = state vector
𝑥̇ = derivative of the state vector with respect to time.
𝑦 = output vector
𝑢 = input vector
𝐴 = System matrix or matrix of the coefficients of the state variables in the state equation
𝐵 = input matrix or coefficients of the input
𝐶 = output matrix or the coefficients of the state variables in the output equation
𝐷 = feedforward matrix
Figure 4.1
Scilab represents state-space as a list. You must call syslin(‘c’,A,B,C) to format A, B, and C matrices
as a state-space list in scilab. The ‘c’ in the first argument tells the function to represent a continuous-
time system.
--> sl = syslin(‘c’,A , B, C);
Now you have a state-space model of the circuit in Figure 4.1. You can use this model with csim()
to get the response of the system.
1. What would be the plot the response of the system if the input is a step input?
The plot of the response is shown in Act4.1.JPG.
2. Write the transfer function of the system by hand(using Laplace transform). Using csim(), plot
the reponse of the system for the transfer function. Describe the previous plot and the
current plot.
𝒔𝒊𝑳 = 𝑽𝟐 − 𝒗𝑪
−𝒗𝑪 + 𝑽𝟐
𝒊𝑳 =
𝒔
−𝒗𝑪 + 𝑽𝟐
−𝒗𝑪 + = 𝒔𝒗𝑪
𝒔
𝒔𝟐 𝒗𝑪 = −𝒔𝒗𝑪 − 𝒗𝑪 + 𝑽𝟐
(𝒔𝟐 + 𝒔 + 𝟏)𝒗𝑪 = 𝑽𝟐
𝒗𝑪 𝟏
= 𝟐
𝑽𝟐 𝒔 + 𝒔 + 𝟏
The plot of the response of the system for the transfer function above is shown in Act4.2.JPG.
The plot of this system is the same compared to the plot of the previous one.
You can convert a state-space representation to transfer function and transfer function to state-
space representation. In the lecture we derived the transfer function from the state-space
representation using this equation:
𝑌(𝑠)
𝐺(𝑠) = = 𝐶(𝑠𝐼 − 𝐴)−1 𝐵 + 𝐷
𝑈(𝑠)
3. Using the above equation, get the transfer function of the function. Compare the transfer
function you got from the previous instructions and the transfer function you got the above
equation.
The transfer function is the same compared to the previous function. This can be seen in
Act4.3.JPG.
5. Using the transfer function you obtain by hand, pass it as a parameter in tf2ss() and write the
result. Did you get the same state-space representation from the given? If not, explain the
possible reason and show the plot of the response of this state-space on a step input.
The A matrix obtained is different from the state space given. However the obtained A matrix
is an equivalent of the A matrix of the given state space therefore the obtained state space is
the same as the given state space. It is proved by obtaining the plot of the obtained state
space which is the same as the previous plot. Shown in Act4.5.JPG is the plot.