Académique Documents
Professionnel Documents
Culture Documents
htm
In this example we will once again consider a truck pulling a trailer where the friction
and wind resistance acts as a velocity dependant force, with a coefficient B.
The state space model of this first order system in the form
v’ = A v + B u
Selecting states
Vector-matrix form
In order to determine your state variable, you must identify energy storage elements.
In this case we have 3 forces acting on the body, the applied force, the friction force,
and the inertial force.
SELECTING STATES
So we can see from this table that the only state variable in our first order
system is v.
This first order system does not have any trivial state equations.
1 of 7 05/10/2010 00:24
In this example we will once again consider a sliding block where the fric... http://www.me.cmu.edu/ctms/modeling/firstorder/statespace/content.htm
INTERCONNECTIONS
mv' + bv – f(t) = 0
Rearranging we get:
and the output we are seeking is for the state variable, v, so:
y=v
Now we have the derivative of the state variable in terms of the state variable
and other known quantities.
v' = Av + Bf(t)
y = Cv + Df(t)
so
A = -b/m
B = 1/m
C=1
D=0
We will now enter this state space model into MATLAB. Because MATLAB cannot
manipulate symbolic variables, we will now assign numerical values to each variable.
m = 20,000kg
b = 500kg/s
>> m = 20000;
>> b = 500;
>> A = -b/m;
2 of 7 05/10/2010 00:24
In this example we will once again consider a sliding block where the fric... http://www.me.cmu.edu/ctms/modeling/firstorder/statespace/content.htm
>> B = 1/m;
>> C = 1;
>> D = 0;
In order to extract the A, B, C, and D matrices from a previously defined state space
model, use MATLAB's ssdata command.
A =
-0.0250
B =
5.0000e-005
C =
D =
Now that we have the state space model entered into MATLAB we can use MATLAB
to do many useful calculations including determining the step response. In this case
we will plot the unit step response, taking the input to be 1 unit.
>> u = 1;
The MATLAB output will be the following plot of the step response:
3 of 7 05/10/2010 00:24
In this example we will once again consider a sliding block where the fric... http://www.me.cmu.edu/ctms/modeling/firstorder/statespace/content.htm
MATLAB can also plot the impulse response of a state space model.
The MATLAB output will be the following plot of the impulse response:
4 of 7 05/10/2010 00:24
In this example we will once again consider a sliding block where the fric... http://www.me.cmu.edu/ctms/modeling/firstorder/statespace/content.htm
MATLAB’s bode command plots the frequency response of a system as a bode plot.
>> bode(first_ss)
5 of 7 05/10/2010 00:24
In this example we will once again consider a sliding block where the fric... http://www.me.cmu.edu/ctms/modeling/firstorder/statespace/content.htm
To find the transfer function of the system from the state space model use MATLAB's
ss2tf command:
num =
1.0e-004 *
0 0.5000
den =
1.0000 0.0250
In order to find the transfer function itself instead of the numerator and denominator
from the state space model, use the following command:
MATLAB will assign the transfer function under the name first_tf, and output the
following:
6 of 7 05/10/2010 00:24
In this example we will once again consider a sliding block where the fric... http://www.me.cmu.edu/ctms/modeling/firstorder/statespace/content.htm
Transfer function:
5e-005
---------
s + 0.025
7 of 7 05/10/2010 00:24