Lecture3 F23
Lecture3 F23
Space Equations
& its Solution
Instructor
Dr Samina Jamil
1
2
Lecture 3: State
Space Systems
Lecture Overview
State and state-space (SS)
State-space models
Block diagram of SS
Solution of SS equations
3
Let a system has state x1 , x2 and x3 , then if, for
e.g., x2=x1+2x3 , then the state is not linearly
Lecture 3: State independent.
Space Systems
State •Only those variables can be chosen as
•State is the smallest set of linearly state which have their derivatives appearing
in the system as well.
independent variables (signals) that determine a
system completely. •State is defined as the knowledge of
•State is not unique to a system: a system state x(t0) at time t0 gives complete
can be represented by different sets of state information of output y(t) for all values of t ≥
variables, but number of states remains the t0 using input signal u(t) for t ≥ t0 .
same and equal to order of the system.
•State-space modeling can be used for
dynamic systems since they have memory.
4
Lecture 3: State
Space Systems
State Space
•State-space is n dimensional space,
comprising n coordinate axes x1 ,x2 ,…,xn.
•State vector x=[x1,x2,…,xn]T represents nth
order system.
•Every state equation is a 1st order
differential equation.
•A system with state vector x(t)=[vC , vR]T,
can be graphically shown as:
5
A(t), B(t), C(t), D(t) represent LTV system, but LTI
system is represented by constant matrices A, B, C, D.
Lecture 3: State
Space Systems
Modeling in State Space
State-space equations and model
•SS model has 2 sets of equations
State equation: A set of n, 1st order differential
equations.
Output equation: A set of p algebraic equations.
•The state space system’s block diagram is:
•x, u, y are function of time.
•A, B, C, D may or may not be function of time.
6
Lecture 3: State
Space Systems
Modeling in State Space
Block diagram of state-space model
•SS equation must have dimension
compatibility
•States are the system signals/variables,
like velocity, position, current, voltage etc.
•Only the variables with derivative terms
can be states.
•Write equations in terms of only selected
states, inputs and system constants.
7
VC and iL can be the state variables, as their
equations involve their derivatives
Lecture 3: State
Space Systems
Modeling in State Space
State-space model of electrical system
Example 3.1 (Nise) Find state-space
representation if v(t) is the input and iR(t) is
the output?
•The state-space model is:
8
This model is a 2 order ODE, so should be
nd
dn/dtn.
Lecture 3: State Case I: Numerator is a
constant
Space Systems
Modeling in State Space
Conversion from TF (case I) to SS model
Example 3.4 (Nise) Find state-space
representation if r(t) is the input and c(t) is the
output?
•The state-space model is:
10
An nth order ODE needs n integrators.
Lecture 3: State
Space Systems
Modeling in State Space
Conversion from TF (case I) to SS model
Example 3.4 (Nise) Find state-space
representation if r(t) is the input and c(t) is the
output?
•The block diagram of the state-space model
is:
11
Case II: Numerator is a
polynomial
Lecture 3: State
Space Systems X(s)
X1(s),
Modeling in State Space
Conversion from TF (case II) to SS model
Example 3.5 (Nise) Find state-space
representation if r(t) is the input and c(t) is the
output?
•The block diagram of the state-space model
is:
12
Lecture 3: State
Space Systems
Modeling in State Space
Conversion from state-space model to TF
Example B-2-10 (Ogata) Find state-space
representation if r(t) is the input and c(t) is the
output?
•The state-space model [A B C D] can be
transformed into transfer function using:
13
Lecture 3: State
Space Systems
Modeling in State Space
Modeling a MIMO system
Example B-3-3 (Ogata) Find state-space
representation if u1(t), u2(t) are the inputs and
y1(t), y2(t) are the output?
14
Lecture 3: Solution
of SS Equation
•State is defined as the knowledge of state x(t0) at
time t0 gives complete information of output y(t) for
all values of t ≥ t0 using input signal u(t) for t ≥ t0 .
•By solving a state equation, values of all states can
be computed for any duration of time.
•Similarly, output equation can be solved too.
•Plotting the state and/or output give the curves
called state and/or output trajectories, respectively.
•State or output can be due to some input signal
u(t) and/or initial condition x(t0).
15
is called state transition matrix. The first term shows unforced
response due to initial conditions
Lecture 3: Solution and the second term is the forced
response due to input u only.
of SS Equation
Solution in Laplace Domain
•Given a linear time invariant state-space system:
•Taking Laplace transform and solving for X(s):
•Inverse Laplace of X(s) gives time domain trajectory
of state x(t).
•Taking Laplace of output equation and solving for
Y(s):
•Laplace inverse gives time domain solution of
output equation y(t).
16
Lecture 3: Solution
of SS Equation
Solution in Laplace Domain •The time domain solution is:
Skill Assessment 4.10 (Nise) Given a linear
time invariant state-space system with initial
state. Solve for its states and output?
• Laplace domain solution is:
•+
17
Lecture 3: Solution
of SS Equation
Solution in Laplace Domain figure(4);
y3=-6.5*exp(-2*t)+19*exp(-3*t)-
Example 4.11 (Nise) Given a linear time 11.5*exp(-4*t);
plot(t,y3)
invariant state-space system with initial state.
Use MATLAB to plot its states and output? 1.2
A=[0 1 0;0 0 1;-24 -26 -9];B=[0;0;1];
2
x1
x2
x0=[1;0;2];t=0:0.05:5;u=exp(-t); 1 y 1, y 2, y 3
Response (x) to IC
sys=ss(A,B,C,D); 0.5
0.6
figure(1);[y1,t,x]=lsim(sys,u,t,x0); 0
0.4
plot(t,x) -0.5
0.2
figure(2);plot(t,y1) -1
figure(3);y2=x(:,1)+x(:,2);plot(t,y2) -1.5 0
-2 -0.2
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
Time (s) Time(s)
18
Lecture 3: Solution
of SS Equation
Solution in Time Domain
•The solution in time domain is given by: •The multiplication in Laplace domain is
equivalent to convolution integral evaluation
•eAt is the state-transition matrix. Laplace in time domain.
transform of eAt is (sI-A)-1.
•Calculating in time domain is tedious;
•The first term shows unforced response due (see Example 4.12 Nise). Usually, it is
to initial conditions. calculated in Laplace domain and then used
•Second term is the forced response due to in time domain solution.
input u only. Solve Example 4.12 completely as
•Comparing the equation with: homework.
19
Lecture 3: Solution
of SS Equation
Solution in Time Domain
Ex 9-5 (Ogata) Find state transition matrix?
• The state transition matrix is given by:
20
Lecture 3: Solution
of SS Equation
Solution in Time Domain
Example 9-6 (Ogata) Find unit step response of
the system; x1(t) and x2(t)?
• The state transition matrix is: