Course title: Control systems
Course code: EEE-359
Fahim Mahmud
Assistant Professor
Department of EEE
CUET
Class outline
• Why state space representation?
• What is state space representation?
• State equations and output equations
• Example 1 (spring-mass system)
• Example 2 (series RL system)
• Transfer function to state space conversion
• State space to transfer function conversion
Why state space representation?
• State space representation can be used for non-linear systems.
• It is also applicable for time-varying systems.
• This representation can handle non-zero initial conditions.
• Systems with multiple inputs and multiple outputs can be conveniently represented.
• Numerous state space software packages are available.
• It gives a different perspective to the control system designer.
Drawbacks of state space
representation
• State space representation is more complex compared to transfer function.
• It is not as intuitive as transfer function.
What is state space representation?
• A mathematical description of the system in terms of a minimum set of variables 𝑥𝑖 𝑡 , 𝑖 =
1,2, … 𝑛, known as state variables, that fully describe the system and its response to any given set
of inputs.
• The knowledge of those variables at an initial time 𝑡𝑜 and the system inputs for 𝑡 ≥ 𝑡𝑜 are
sufficient to predict the future system states and outputs for all time greater than the initial time.
• The state-space description provides the dynamics as a set of coupled first-order differential
equations in a set of the above-mentioned state variables, together with a set of algebraic
equations that combine the state variables into physical output variables.
What is state space representation?...
• Typically, the minimum number of required state variables is equal to the order of the differential
equation. Put another way, the number of state variables is equal to the number of independent
energy storage elements (L, C, mass, spring etc.)
• The values of the state variables at any given time t specify the energy of each energy storage
element and therefore, the total system energy.
• The time derivatives of the state variables determine the rate of change of system energy.
• The choice of state variables is not unique.
• State space can be thought of as a coordinate system whose axes are the state variables.
• State variables need not be physically measurable or observable quantities. The freedom of
choosing such non-measurable quantities as state variables is an advantage of state space
representation. However, it’s convenient to choose easily measurable quantities as state variables
because optimal control requires feedback of all state variables with suitable weighting.
An example
• We have a system of a mass connected to an unmovable wall with a spring and a damper.
• The spring constant is k, mass is m, applied force (input) is F.
• If we want to know where the system will be after 1s, we need info about some initial conditions.
• Is the mass currently moving? (We know this info from velocity, so, it’s a state variable)
• How much is the spring pulling the mass? (We know this spring force from k × position, so,
position is another state variable).
• We could use other state variables as well, but using more than two would be redundant since they
could somehow be derived from our choice of variables, that is velocity and position.
• Moreover, there are only two energy storage elements (mass and spring), so, two state variables are
enough.
State equations
• In the standard form, the mathematical description of the system is expressed as a set of n, coupled
first order ordinary differential equations, known as state equations.
• In these state equations, the time derivative of each state variable is expressed in terms of the state
variables and the system inputs.
• 𝑥1ሶ = 𝑓1 (𝑥, 𝑢, 𝑡)
• 𝑥2ሶ = 𝑓2 (𝑥, 𝑢, 𝑡)
• 𝑥𝑛ሶ = 𝑓𝑛 (𝑥, 𝑢, 𝑡)
• For an LTI system of order n and r inputs, we can write the state equations as follows:
• 𝑥1ሶ = 𝑎11 𝑥1 + 𝑎12 𝑥2 + ⋯ + 𝑎1𝑛 𝑥𝑛 + 𝑏11 𝑢1 + ⋯ + 𝑏1𝑟 𝑢𝑟
• 𝑥2ሶ = 𝑎21 𝑥1 + 𝑎22 𝑥2 + ⋯ + 𝑎2𝑛 𝑥𝑛 + 𝑏21 𝑢1 + ⋯ + 𝑏2𝑟 𝑢𝑟
• 𝑥𝑛ሶ = 𝑎𝑛1 𝑥1 + 𝑎𝑛2 𝑥2 + ⋯ + 𝑎𝑛𝑛 𝑥𝑛 + 𝑏𝑛1 𝑢1 + ⋯ + 𝑏𝑛𝑟 𝑢𝑟
State equations…
• We can then write the state equations in matrix form as follows:
𝑥1ሶ 𝑥1 𝑢1
𝑎11 ⋯ 𝑎1𝑛 𝑏11 ⋯ 𝑏1𝑟
𝑥2ሶ 𝑥2 𝑢2
• = ⋮ ⋱ ⋮
⋮ + ⋮ ⋱ ⋮ ⋮
⋮ 𝑎𝑛1 ⋯ 𝑎𝑛𝑛
𝑥𝑛 𝑏𝑛1 ⋯ 𝑏𝑛𝑟 𝑢𝑟
𝑥𝑛ሶ
• 𝒙ሶ = 𝑨𝑥 + 𝑩𝑢
Output equations
• A system output is defined to be any system variable of interest. The output equation can be written
as follows:
• 𝑦 𝑡 = 𝑐1 𝑥1 + 𝑐2 𝑥2 + ⋯ 𝑐𝑛 𝑥𝑛 + 𝑑1 𝑢1 + 𝑑2 𝑢2 + ⋯ 𝑑𝑟 𝑢𝑟
• In matrix form, we can write:
𝑦1 𝑥1 𝑢1
𝑐11 ⋯ 𝑐1𝑛 𝑑11 ⋯ 𝑑1𝑟
𝑦2 𝑥2 𝑢2
• ⋮ = ⋮ ⋱ ⋮
⋮ + ⋮ ⋱ ⋮ ⋮
𝑐𝑛1 ⋯ 𝑐𝑛𝑛 𝑑𝑛1 ⋯ 𝑑𝑛𝑟
𝑦𝑚 𝑥𝑛 𝑢𝑟
• 𝒚 = 𝑪𝑥 + 𝑫𝑢
Example-1 (state space representation
of a spring-mass damper system)
• k = spring constant
• b = damping (friction) coefficient
• m = mass
• F(t) = input force
• Equation of motion: According to Newton’s second law, we have
• σ 𝐹 = 𝑚𝑎
• 𝐹 𝑡 − 𝑘𝑥 𝑡 − 𝑏𝑥 𝑡ሶ = 𝑚𝑥(𝑡)
ሷ
Example-1 (state space representation
of a spring-mass damper system)…
• We can find the state-space representation of our spring-mass damper system by using either of the
two approaches.
• We could write the differential equation for the two energy storage elements (mass and spring).
Then we would proceed by expressing the right-hand side of these two differential equations in
terms of the state variables and input.
• Alternatively, we could draw the free-body diagram and proceed.
• However, we want to maintain the same approach for both the mechanical and electrical systems.
So, we will take the first approach.
Example-1 (state space representation
of a spring-mass damper system)…
• Differential equation for the spring:
• 𝐹1 = 𝑘𝑥
𝑑𝐹1
• = 𝑘𝑣
𝑑𝑡
• Differential equation for the mass:
𝑑𝑣
• 𝐹2 = 𝑀
𝑑𝑡
𝑑𝑣 𝐹2 1 1 𝑏 1
• = = 𝐹 − 𝐹1 − 𝐹3 = − 𝐹1 − 𝑣 + 𝐹
𝑑𝑡 𝑀 𝑀 𝑀 𝑀 𝑀
𝐹1ሶ 0 𝑘 𝐹1 0
• = 1 𝑏 + 1 𝐹
𝑣ሶ − − 𝑣 𝑀
𝑀 𝑀
1𝐹1
• Taking position as output, we have: 𝑦 = 0+ 0 [𝐹]
𝑘𝑣
• Here, spring force and velocity are taken as state variables.
Example-2 (State space representation
of a series RL circuit)
• Find the state space representation of the network if the output is resistor voltage.
• One state variable should be enough (minimum) since there is only one energy storage element (L).
• We select the state variables by writing the derivative equations for the energy storage elements.
Example-2 (State space representation
of a series RL circuit)…
𝑑𝑖
• Here, 𝐿 = 𝑣𝐿
𝑑𝑡
• Hence, current (i) is the state variable.
• Right hand side of the above equation must be written as a linear combination of the state variables
and inputs. Since inductor voltage is not a state variable, we need to rewrite it in terms of the state
variables and inputs.
• Using KVL, 𝑣𝐿 = 𝑣 𝑡 − 𝑣𝑅 = −𝑖𝑅 + 𝑣 𝑡
𝑑𝑖
• Therefore, 𝐿 = −𝑖𝑅 +𝑣
𝑑𝑡
𝑑𝑖 𝑅 1
• =− 𝑖+ 𝑣
𝑑𝑡 𝐿 𝐿
𝑑𝑖 𝑅 1
• In matrix form: = − 𝑖 + [𝑣]
𝑑𝑡 𝐿 𝐿
• Output, 𝑣𝑅 𝑡 = 𝑅𝑖 + 0. 𝑣 𝑡
• In matrix form: 𝑣𝑅 = 𝑅 𝑖 + 0 [𝑣]
Example-2 (State space representation
of a series RL circuit)…
• We could also choose the resistor voltage as our state variable since the resistor voltage equals the
product of the current and resistance. That is, it’s linearly dependent on the previously chosen state
variable, current. (Try yourself)
• This also shows that the choice of state variables and hence, the state space representation is not
unique.
• Now, try with a series RLC circuit.
• Next, try example-3.3 and the subsequent skill assessment exercises.
Transfer function to state space
conversion
• At first, we select a set of state variables, known as phase variables, where each subsequent state
variable is defined to be the derivative of the previous state variable.
• Consider the following differential equation:
𝑑𝑛 𝑦 𝑑 𝑛−1 𝑦 𝑑𝑦
• + 𝑎𝑛−1 𝑛−1 + ⋯ + 𝑎1 + 𝑎0 𝑦 = 𝑏𝑜 𝑢
𝑑𝑡 𝑛 𝑑𝑡 𝑑𝑡
• We choose the state variables as follows (other options are also possible):
𝑑𝑦 𝑑2 𝑦 𝑑 𝑛−1 𝑦
• 𝑥1 = 𝑦, 𝑥2 = , 𝑥3 = 2 , … 𝑥𝑛 = 𝑛−1
𝑑𝑡 𝑑𝑡 𝑑𝑡
𝑑𝑛𝑦
• 𝑥1ሶ = 𝑥2 , 𝑥2ሶ = 𝑥3 , … 𝑥𝑛ሶ = 𝑛 = −𝑎0 𝑥1 − 𝑎1 𝑥2 − ⋯ − 𝑎𝑛−1 𝑥𝑛 − 𝑏𝑜 𝑢
𝑑𝑡
Transfer function to state space
conversion…
Transfer function to state space
conversion…
• In summary, to convert a transfer function into state space representation in phase variable form,
we first convert the transfer function into a differential equation by cross multiplying and taking
the inverse Laplace transform, assuming zero initial conditions.
• Then, we represent the differential equation in state space in phase variable form.
• Example-3.4 (Nise, constant term in the numerator)
Transfer function to state space
conversion…
• For a transfer function with a polynomial in the numerator of degree one less than the denominator,
we separate the numerator and denominator and cascade them. Then, we handle them separately.
• Example-3.5 and skill-assessment exercise-3.3 (Nise)
State space to transfer function
conversion…
State space to transfer function
conversion…
THANK YOU