MNG241: MODELING AND SIMULATION OF DYNAMIC SYSTEMS Modeling in time domain (State-space models)
MODELING AND SIMULATION OF
DYNAMIC SYSTEMS
MNG241
Course Outline:
• Laplace Transform (a Review) • Modeling of Fluid Systems,
• Modeling of Mechanical Systems, • Time Response of Dynamic Systems,
• Modeling of Electrical and Electronic Systems, • State-Space Representation of Dynamic Systems,
• Analogy Between Mechanical and Electrical Systems, • Modeling using LaGrange’s Equation.
• Modeling of Mixed Systems,
Dr. Raafat SHALABY
rshalaby@[Link]
1 14 May 2025
MNG241: MODELING AND SIMULATION OF DYNAMIC SYSTEMS Modeling in time domain (State-space models)
MODELING AND SIMULATION OF
DYNAMIC SYSTEMS
MNG241
A lecture on:
STATE-SPACE REPRESENTATION OF
DYNAMIC SYSTEMS
Dr. Raafat SHALABY
rshalaby@[Link]
2 14 May 2025
MNG241: MODELING AND SIMULATION OF DYNAMIC SYSTEMS Modeling in time domain (State-space models)
OBJECTIVES
• Deriving input-output relations of continuous linear time invariant (LTI) systems using
elemental and structural equations.
o Obtaining State-space (SS) representation LTI systems.
how to obtain the SS model of LTI system from DE?
how to obtain the SS model of LTI from TF?
3 14 May 2025
MNG241: MODELING AND SIMULATION OF DYNAMIC SYSTEMS Modeling in time domain (State-space models)
MODELING USING STATE-SPACE EQUATION
A state-space representation for a linear time-invariant system has the form.
o The state equation, 𝑥𝑥̇ (𝑡𝑡) = 𝐴𝐴𝐴𝐴 (𝑡𝑡) + 𝐵𝐵𝐵𝐵(𝑡𝑡)
o The output equation, 𝑦𝑦(𝑡𝑡) = 𝐶𝐶𝐶𝐶 (𝑡𝑡) + 𝐷𝐷𝐷𝐷(𝑡𝑡), 𝑥𝑥 (𝑡𝑡0 ) = 𝑥𝑥0
• 𝑥𝑥(𝑡𝑡): an n-dimensional state vector which is composed of a minimum set of system variables
that uniquely describes the response of the system given the current state, the input, and the
dynamic equations.
• 𝑢𝑢, 𝑦𝑦 represents, respectively, system input & system output,
• 𝐴𝐴, 𝐵𝐵 and 𝐶𝐶 are, respectively, known as system-, input- and output-matrix.
4 14 May 2025
MNG241: MODELING AND SIMULATION OF DYNAMIC SYSTEMS Modeling in time domain (State-space models)
𝑥𝑥1 (𝑡𝑡) 𝑢𝑢1 (𝑡𝑡) 𝑦𝑦1 (𝑡𝑡) 𝑥𝑥̇ 1 (𝑡𝑡)
𝑥𝑥 (𝑡𝑡) 𝑢𝑢 (𝑡𝑡) 𝑦𝑦 (𝑡𝑡) 𝑥𝑥̇ (𝑡𝑡)
𝑥𝑥(𝑡𝑡) = � 2 � 𝑢𝑢(𝑡𝑡) = � 2 �, 𝑦𝑦(𝑡𝑡) = � 2 �, and 𝑥𝑥̇ (𝑡𝑡) = � 2 �
⋮ ⋮ ⋮ ⋮
𝑥𝑥𝑛𝑛 (𝑡𝑡) 𝑢𝑢𝑚𝑚 (𝑡𝑡) 𝑦𝑦𝑝𝑝 (𝑡𝑡) 𝑥𝑥̇ 𝑛𝑛 (𝑡𝑡)
𝑥𝑥̇ 𝑖𝑖 (𝑡𝑡) = 𝑎𝑎𝑖𝑖1 𝑥𝑥1 (𝑡𝑡) + 𝑎𝑎𝑖𝑖2 𝑥𝑥2 (𝑡𝑡) + ⋯ + 𝑎𝑎𝑖𝑖𝑖𝑖 𝑥𝑥𝑛𝑛 (𝑡𝑡) + 𝑏𝑏𝑖𝑖1 𝑢𝑢1 (𝑡𝑡) + 𝑏𝑏𝑖𝑖2 𝑢𝑢2 (𝑡𝑡) + ⋯ + 𝑏𝑏𝑖𝑖𝑖𝑖 𝑢𝑢𝑚𝑚 (𝑡𝑡)
𝑦𝑦𝑗𝑗 (𝑡𝑡) = 𝑐𝑐𝑗𝑗1 𝑥𝑥1 (𝑡𝑡) + 𝑐𝑐𝑗𝑗2 𝑥𝑥2 (𝑡𝑡) + ⋯ + 𝑐𝑐𝑗𝑗𝑗𝑗 𝑥𝑥𝑛𝑛 (𝑡𝑡) + 𝑑𝑑𝑗𝑗1 𝑢𝑢1 (𝑡𝑡) + 𝑑𝑑𝑗𝑗2 𝑢𝑢2 (𝑡𝑡) + ⋯ + 𝑑𝑑𝑗𝑗𝑗𝑗 𝑢𝑢𝑚𝑚 (𝑡𝑡)
ADVANTAGES OF SS-MODEL
• SS-model can be used to simulation MIMO systems.
• The corresponding discrete-time SS-model can be obtained via duality
with the continuous-time models.
i.e.: 𝑥𝑥(𝑘𝑘 + 1) = 𝐴𝐴𝐴𝐴 (𝑘𝑘) + 𝐵𝐵𝐵𝐵(𝑘𝑘) and 𝑦𝑦(𝑘𝑘) = 𝐶𝐶𝐶𝐶 (𝑘𝑘) + 𝐷𝐷𝐷𝐷(𝑘𝑘)
5 14 May 2025
MNG241: MODELING AND SIMULATION OF DYNAMIC SYSTEMS Modeling in time domain (State-space models)
SOLUTION OF STATE EQUATION IN TIME DOMAIN
𝑥𝑥̇ = 𝐴𝐴𝐴𝐴(𝑡𝑡) + 𝐵𝐵𝐵𝐵(𝑡𝑡) → Rearranging the state equation, we obtain
𝑥𝑥̇ − 𝐴𝐴𝐴𝐴 (𝑡𝑡) = 𝐵𝐵𝐵𝐵(𝑡𝑡) pre-multiply both sides by 𝑒𝑒 −𝐴𝐴𝐴𝐴
𝑒𝑒 −𝐴𝐴𝐴𝐴 𝑥𝑥̇ − 𝑒𝑒 −𝐴𝐴𝐴𝐴 𝐴𝐴𝐴𝐴(𝑡𝑡) = 𝑒𝑒 −𝐴𝐴𝐴𝐴 𝐵𝐵𝐵𝐵(𝑡𝑡)
𝑑𝑑
the left-hand side is a perfect differential as, �𝑒𝑒 −𝐴𝐴𝐴𝐴 𝑥𝑥(𝑡𝑡)� = 𝑒𝑒 −𝐴𝐴𝐴𝐴 𝑥𝑥̇ − 𝑒𝑒 −𝐴𝐴𝐴𝐴 𝐴𝐴𝐴𝐴(𝑡𝑡)
𝑑𝑑𝑑𝑑
𝑑𝑑
Thus, we have �𝑒𝑒 −𝐴𝐴𝐴𝐴 𝑥𝑥(𝑡𝑡)� = 𝑒𝑒 −𝐴𝐴𝐴𝐴 𝐵𝐵𝐵𝐵(𝑡𝑡)
𝑑𝑑𝑑𝑑
Integrate both sides.
6 14 May 2025
MNG241: MODELING AND SIMULATION OF DYNAMIC SYSTEMS Modeling in time domain (State-space models)
𝑑𝑑
�𝑒𝑒 −𝐴𝐴𝐴𝐴 𝑥𝑥 (𝑡𝑡)� = 𝑒𝑒 −𝐴𝐴𝐴𝐴 𝐵𝐵𝐵𝐵(𝑡𝑡), integrate both sides.
𝑑𝑑𝑑𝑑
𝑡𝑡 𝑑𝑑 𝑡𝑡
∫𝑡𝑡 �𝑒𝑒 −𝐴𝐴𝐴𝐴 𝑥𝑥(𝜏𝜏)� 𝑑𝑑𝑑𝑑 = ∫𝑡𝑡 𝑒𝑒 −𝐴𝐴𝐴𝐴 𝐵𝐵𝐵𝐵(𝜏𝜏) 𝑑𝑑𝑑𝑑
𝑜𝑜 𝑑𝑑𝑑𝑑 𝑜𝑜
𝑡𝑡
→ [𝑒𝑒 −𝐴𝐴𝐴𝐴 𝑥𝑥(𝜏𝜏)]𝑡𝑡𝑡𝑡𝑜𝑜 = ∫𝑡𝑡 𝑒𝑒 −𝐴𝐴𝐴𝐴 𝐵𝐵𝐵𝐵(𝜏𝜏) 𝑑𝑑𝑑𝑑
𝑜𝑜
𝑡𝑡 𝑡𝑡
𝑒𝑒 −𝐴𝐴𝐴𝐴 𝑥𝑥(𝑡𝑡) − 𝑒𝑒 −𝐴𝐴𝑡𝑡𝑜𝑜 𝑥𝑥(𝑡𝑡𝑜𝑜 ) = ∫𝑡𝑡 𝑒𝑒 −𝐴𝐴𝐴𝐴 𝐵𝐵𝐵𝐵(𝜏𝜏) 𝑑𝑑𝑑𝑑 → 𝑒𝑒 −𝐴𝐴𝐴𝐴 𝑥𝑥 (𝑡𝑡) = 𝑒𝑒 −𝐴𝐴𝑡𝑡𝑜𝑜 𝑥𝑥 (𝑡𝑡𝑜𝑜 ) + ∫𝑡𝑡 𝑒𝑒 −𝐴𝐴𝐴𝐴 𝐵𝐵𝐵𝐵(𝜏𝜏) 𝑑𝑑𝑑𝑑
𝑜𝑜 𝑜𝑜
Multiply both sides by 𝑒𝑒 𝐴𝐴𝐴𝐴 and rearrange the equation, we obtain the state 𝒙𝒙(𝑡𝑡)
𝑡𝑡
𝑥𝑥(𝑡𝑡) = 𝑒𝑒 𝐴𝐴(𝑡𝑡−𝑡𝑡𝑜𝑜) 𝑥𝑥 (𝑡𝑡𝑜𝑜 ) + � 𝑒𝑒 𝐴𝐴(𝑡𝑡−𝜏𝜏) 𝐵𝐵𝐵𝐵(𝜏𝜏) 𝑑𝑑𝑑𝑑
𝑡𝑡𝑜𝑜
The output 𝑦𝑦(𝑡𝑡) = 𝐶𝐶𝐶𝐶(𝑡𝑡) becomes:
𝑡𝑡
𝑦𝑦(𝑡𝑡) = 𝐶𝐶𝑒𝑒 𝐴𝐴(𝑡𝑡−𝑡𝑡𝑜𝑜 ) 𝑥𝑥 (𝑡𝑡𝑜𝑜 ) + 𝐶𝐶 ∫𝑡𝑡 𝑒𝑒 𝐴𝐴(𝑡𝑡−𝜏𝜏) 𝐵𝐵𝐵𝐵(𝜏𝜏) 𝑑𝑑𝑑𝑑
𝑜𝑜
7 14 May 2025
MNG241: MODELING AND SIMULATION OF DYNAMIC SYSTEMS Modeling in time domain (State-space models)
STATE-SPACE MODEL → TRANSFER FUNCTION
𝑥𝑥̇ = 𝐴𝐴𝐴𝐴 + 𝐵𝐵𝐵𝐵
• Convert � using LT, considering 𝑖𝑖𝑖𝑖 = 0.,
𝑦𝑦 = 𝐶𝐶𝐶𝐶
sX(s) = 𝐴𝐴𝐴𝐴(s) + 𝐵𝐵𝐵𝐵(s) → sIX(s) − 𝐴𝐴𝐴𝐴(s) = 𝐵𝐵𝐵𝐵(s)
�
𝑌𝑌(s) = 𝐶𝐶𝐶𝐶(s)
∴ (sI − 𝐴𝐴)X(s) = 𝐵𝐵𝐵𝐵(s) → X(s) = (sI − 𝐴𝐴)−1 𝐵𝐵𝐵𝐵(s)
• Substitute 𝑋𝑋(s) into 𝑌𝑌(s) → 𝑌𝑌(s) = 𝐶𝐶 (sI − 𝐴𝐴)−1 𝐵𝐵𝐵𝐵(s)
• Thus,
𝑌𝑌(s)
= 𝐶𝐶 (sI − 𝐴𝐴)−1 𝐵𝐵
𝑈𝑈(s)
8 14 May 2025
MNG241: MODELING AND SIMULATION OF DYNAMIC SYSTEMS Modeling in time domain (State-space models)
Steps to Apply the State Variable Method to Mechanical Systems:
i. Select the displacements and velocities as the state variables,
ii. Obtain the equations of motion describing the system,
iii. Put the result in state-space representation.
Example:
𝑐𝑐 𝑘𝑘 1
𝑚𝑚𝑥𝑥̈ (𝑡𝑡) + 𝑐𝑐𝑥𝑥̇ (𝑡𝑡) + 𝑘𝑘𝑥𝑥(𝑡𝑡) = 𝑓𝑓(𝑡𝑡) → 𝑥𝑥̈ (𝑡𝑡) = − 𝑥𝑥̇ (𝑡𝑡) − 𝑥𝑥 (𝑡𝑡) + 𝑓𝑓(𝑡𝑡)
𝑚𝑚 𝑚𝑚 𝑚𝑚
𝑐𝑐 𝑘𝑘 1
→ 𝑣𝑣̇ (𝑡𝑡) = − 𝑣𝑣(𝑡𝑡) − 𝑥𝑥(𝑡𝑡) + 𝑓𝑓 (𝑡𝑡) ← Let, 𝑥𝑥1 (𝑡𝑡) = 𝑥𝑥 (𝑡𝑡) and 𝑥𝑥2 (𝑡𝑡) = 𝑣𝑣(𝑡𝑡)
𝑚𝑚 𝑚𝑚 𝑚𝑚
Then: → 𝑥𝑥̇ 1 (𝑡𝑡) = 𝑥𝑥2 (𝑡𝑡)
𝑐𝑐 𝑘𝑘 1
𝑣𝑣̇ (𝑡𝑡) = − 𝑣𝑣 (𝑡𝑡) − 𝑥𝑥 (𝑡𝑡) + 𝑓𝑓(𝑡𝑡)
𝑚𝑚 𝑚𝑚 𝑚𝑚
𝑐𝑐 𝑘𝑘 1
→ 𝑥𝑥̇ 2 (𝑡𝑡) = − 𝑥𝑥2 (𝑡𝑡) − 𝑥𝑥1 (𝑡𝑡) + 𝑓𝑓 (𝑡𝑡)
𝑚𝑚 𝑚𝑚 𝑚𝑚
𝑥𝑥̇ 1 (𝑡𝑡) 0 1 𝑥𝑥1 (𝑡𝑡) 0
State equation: �𝑥𝑥̇ 2 (𝑡𝑡)� = �− 𝑚𝑚 − � �𝑥𝑥2 (𝑡𝑡)� + �𝑚𝑚� 𝑓𝑓(𝑡𝑡)
𝑘𝑘 𝑐𝑐 1
𝑚𝑚
𝑥𝑥 (𝑡𝑡)
Output equation: 𝑦𝑦(𝑡𝑡) = [1 0] � 1 � + [0]𝑓𝑓(𝑡𝑡)
𝑥𝑥2 (𝑡𝑡)
9 14 May 2025
MNG241: MODELING AND SIMULATION OF DYNAMIC SYSTEMS Modeling in time domain (State-space models)
Example: Find the state equations for the translational mechanical system shown. Consider 𝑥𝑥2 as system
output.
Answers: Equations of motion,
𝑀𝑀1 𝑥𝑥̈ 1 + 𝐷𝐷𝑥𝑥̇ 1 + 𝐾𝐾 (𝑥𝑥1 − 𝑥𝑥2 ) = 0
�
𝑀𝑀2 𝑥𝑥̈ 2 + 𝐾𝐾(𝑥𝑥2 − 𝑥𝑥1 ) = 𝑓𝑓 (𝑡𝑡)
Replacing 𝑥𝑥̈ by 𝑣𝑣̇ , and 𝑥𝑥̇ by 𝑣𝑣 we obtain
𝑀𝑀1 𝑣𝑣̇ 1 + 𝐷𝐷𝑣𝑣1 + 𝐾𝐾 (𝑥𝑥1 − 𝑥𝑥2 ) = 0
�
𝑀𝑀2 𝑣𝑣̇ 2 + 𝐾𝐾(𝑥𝑥2 − 𝑥𝑥1 ) = 𝑓𝑓 (𝑡𝑡)
Selecting the state vector as: 𝑧𝑧 = [𝑥𝑥1 𝑣𝑣1 𝑥𝑥2 𝑣𝑣2 ]𝑇𝑇
𝑥𝑥̇ 1 = 𝑣𝑣1
⎧𝑥𝑥̇ = 𝑣𝑣
⎪ 2 2
.
Then 𝑣𝑣̇ = − 𝑣𝑣 − 𝐾𝐾 𝑥𝑥 + 𝐾𝐾 𝑥𝑥
𝐷𝐷
⎨ 1 𝑀𝑀1 1 𝑀𝑀1 1 𝑀𝑀1 2
⎪ 𝐾𝐾 𝐾𝐾 1
⎩ 𝑣𝑣̇ 2 = 𝑥𝑥 1 − 𝑥𝑥2 + 𝑓𝑓 (𝑡𝑡)
𝑀𝑀2 𝑀𝑀2 𝑀𝑀2
𝑥𝑥̇ 1 0 1 0 0 𝑥𝑥1 0 𝑥𝑥1
𝑣𝑣̇ 1 −𝐾𝐾/𝑀𝑀1 −𝐷𝐷/𝑀𝑀1 𝐾𝐾/𝑀𝑀1 0� �𝑣𝑣1 � + � 0 � 𝑓𝑓 (𝑡𝑡), and 𝑦𝑦(𝑡𝑡) = [0 𝑣𝑣1
We get, � � = � ]
0 1 0 �𝑥𝑥2 �
𝑥𝑥̇ 2 0 0 0 1 𝑥𝑥2 0
𝑣𝑣̇ 2 𝐾𝐾/𝑀𝑀2 0 −𝐾𝐾/𝑀𝑀2 0 𝑣𝑣2 1/𝑀𝑀2 𝑣𝑣2
10 14 May 2025
MNG241: MODELING AND SIMULATION OF DYNAMIC SYSTEMS Modeling in time domain (State-space models)
Example: Find the state equations for the translational mechanical system shown, where 𝑥𝑥3 (𝑡𝑡) is the
output.
Answer:
11 14 May 2025
MNG241: MODELING AND SIMULATION OF DYNAMIC SYSTEMS Modeling in time domain (State-space models)
Steps to Apply the State Variable Method to Electric Circuit Analysis:
i. Select the inductor current 𝑖𝑖𝐿𝐿 , and capacitor voltage 𝑣𝑣𝐶𝐶 as the state variables,
ii. Apply 𝐾𝐾𝐾𝐾𝐾𝐾 & 𝐾𝐾𝐾𝐾𝐾𝐾 to obtain circuit variables in terms of the state variables.
iii. Put the result in state-space representation.
Example: Find the state-space representation of the circuit shown. Determine the transfer function of the
circuit when 𝑣𝑣𝑠𝑠 is the input and 𝑖𝑖𝑥𝑥 is the output. Take 𝑅𝑅 = 1Ω, 𝐶𝐶 = 0.25𝐹𝐹, and 𝐿𝐿 = 0.5 𝐻𝐻.
𝑧𝑧1 𝑣𝑣𝐶𝐶
Solution: Select the state vector as: �𝑧𝑧 � = � 𝑖𝑖 �
2 𝐿𝐿
𝑣𝑣 𝑑𝑑𝑑𝑑 𝑑𝑑𝑑𝑑 1 1
Applying 𝐾𝐾𝐾𝐾𝐾𝐾 at node 1: 𝑖𝑖 = 𝑖𝑖𝑅𝑅 + 𝑖𝑖𝐶𝐶 = + 𝐶𝐶 → =− 𝑣𝑣 + 𝑖𝑖
𝑅𝑅 𝑑𝑑𝑑𝑑 𝑑𝑑𝑑𝑑 𝑅𝑅𝑅𝑅 𝐶𝐶
1 1
𝑧𝑧̇1 = − 𝑧𝑧1 + 𝑧𝑧2
𝑅𝑅𝑅𝑅 𝐶𝐶
𝑑𝑑𝚤𝚤̇ 𝑑𝑑𝑑𝑑 1 1 1 1
Applying 𝐾𝐾𝐾𝐾𝐾𝐾 around the outer loop: 𝑣𝑣𝑠𝑠 = 𝑣𝑣𝐿𝐿 + 𝑣𝑣𝐶𝐶 = 𝐿𝐿 + 𝑣𝑣 → = − 𝑣𝑣 + 𝑣𝑣𝑠𝑠 → 𝑧𝑧̇2 = − 𝑧𝑧1 + 𝑣𝑣s
𝑑𝑑𝑑𝑑 𝑑𝑑𝑑𝑑 𝐿𝐿 𝐿𝐿 𝐿𝐿 𝐿𝐿
−1 1
𝑧𝑧̇1 𝑅𝑅𝑅𝑅 𝐶𝐶 𝑧𝑧1
0 −4 4 𝑧𝑧1 0
State equation: � � = �−1 � �𝑧𝑧 � + � 1 � 𝑣𝑣𝑠𝑠 = � � �𝑧𝑧 � + � � 𝑣𝑣𝑠𝑠
𝑧𝑧̇2 0 2 𝐿𝐿 −2 0 2 2
𝐿𝐿
𝑣𝑣𝐶𝐶 1 𝑧𝑧1 𝑧𝑧1
Output equation: 𝑦𝑦 = 𝑖𝑖𝑥𝑥 = = �𝑅𝑅 0� �𝑧𝑧 � = 1 0 �𝑧𝑧 � [ ]
𝑅𝑅 2 2
12 14 May 2025
MNG241: MODELING AND SIMULATION OF DYNAMIC SYSTEMS Modeling in time domain (State-space models)
Example: Determine the state variable model. Consider 𝑣𝑣𝑜𝑜 and 𝑖𝑖𝑜𝑜 as circuit outputs.
Answer: @node1:
1 𝑑𝑑𝑑𝑑 1 𝑑𝑑𝑑𝑑
𝑣𝑣𝑠𝑠 −� � � � −𝑣𝑣 𝑑𝑑𝑑𝑑
6 𝑑𝑑𝑑𝑑 6 𝑑𝑑𝑑𝑑
= 𝑖𝑖 + → = 2𝑣𝑣 − 4𝑖𝑖 + 4𝑣𝑣𝑠𝑠 (1)
1 2 𝑑𝑑𝑑𝑑
1 𝑑𝑑𝑑𝑑
� � −𝑣𝑣 1 𝑑𝑑𝑑𝑑 𝑣𝑣−𝑣𝑣𝑖𝑖 𝑑𝑑𝑑𝑑 1 𝑑𝑑𝑑𝑑
6 𝑑𝑑𝑑𝑑
@node2: =� � + → = � � − 2.5𝑣𝑣 + 𝑣𝑣𝑖𝑖
2 3 𝑑𝑑𝑑𝑑 3 𝑑𝑑𝑑𝑑 4 𝑑𝑑𝑑𝑑
𝑑𝑑𝑑𝑑 𝑑𝑑𝑑𝑑
substitute for from (1) → = −2𝑣𝑣 − 𝑖𝑖 + 𝑣𝑣𝑠𝑠 + 𝑣𝑣𝑖𝑖 (2)
𝑑𝑑𝑑𝑑 𝑑𝑑𝑑𝑑
𝑣𝑣𝐶𝐶 𝑧𝑧1
Select the state vector as: � 𝑖𝑖 � = �𝑧𝑧 �, thus
𝐿𝐿 2
𝑧𝑧̇1 −2 −1 𝑧𝑧1 1 1 𝑣𝑣𝑠𝑠 𝑣𝑣𝑜𝑜
� �= � �� � + � � � � and the output is: � 𝑖𝑖 �
𝑧𝑧̇2 2 −4 𝑧𝑧2 4 0 𝑣𝑣𝑖𝑖 𝑜𝑜
𝑑𝑑𝑖𝑖𝐿𝐿 1 1
𝑣𝑣𝑜𝑜 = 𝑣𝑣𝐿𝐿 − 𝑣𝑣𝑐𝑐 = 𝐿𝐿 − 𝑣𝑣𝑐𝑐 = 𝑧𝑧̇2 − 𝑧𝑧1 = (−4𝑧𝑧2 − 2𝑧𝑧1 + 4𝑣𝑣𝑠𝑠 ) − 𝑧𝑧1
𝑑𝑑𝑑𝑑 6 6
4 2 2 𝑣𝑣𝑐𝑐 −𝑣𝑣𝑖𝑖 𝑧𝑧1 −𝑣𝑣𝑖𝑖 1 1
𝑣𝑣𝑜𝑜 = − 𝑧𝑧1 − 𝑧𝑧2 + 𝑣𝑣𝑠𝑠 (3) and 𝑖𝑖𝑜𝑜 = = = 𝑧𝑧1 − 𝑣𝑣𝑖𝑖 (4)
3 3 3 3 3 3 3
4 2 2
𝑣𝑣𝑜𝑜 − − 0 𝑣𝑣𝑠𝑠
3 3 𝑧𝑧1 3
thus, 𝑦𝑦 ≡ � 𝑖𝑖 � = � 1 � �𝑧𝑧 � + � 1� �𝑣𝑣 �
𝑜𝑜 0 2 0 − 𝑖𝑖
3 3
13 14 May 2025
MNG241: MODELING AND SIMULATION OF DYNAMIC SYSTEMS Modeling in time domain (State-space models)
EXAMPLE: Given the electrical network shown, find a state-space representation if the output is the current
through the resistor.
ANSWER: Select the state variables as: 𝑧𝑧 = [𝑣𝑣𝐶𝐶 𝑖𝑖𝐿𝐿 ]𝑇𝑇 then write the derivative equation for all energy
storage elements (inductors and capacitors).
𝑑𝑑𝑣𝑣𝐶𝐶
𝐶𝐶 = 𝑖𝑖𝑐𝑐 1
𝑑𝑑𝑑𝑑
� 𝑑𝑑𝑖𝑖𝐿𝐿
(1) & 𝑦𝑦(𝑡𝑡) = 𝑖𝑖𝑅𝑅 = 𝑣𝑣𝐶𝐶
𝑅𝑅
𝐿𝐿 = 𝑣𝑣𝐿𝐿
𝑑𝑑𝑑𝑑
1
𝑖𝑖𝑐𝑐 = 𝑖𝑖𝐿𝐿 − 𝑖𝑖𝑅𝑅 = 𝑖𝑖𝐿𝐿 − 𝑣𝑣𝐶𝐶
But � 𝑅𝑅 (2)
𝑣𝑣𝐿𝐿 = 𝑣𝑣(𝑡𝑡) − 𝑣𝑣𝐶𝐶
𝑑𝑑 1 1
𝑣𝑣𝐶𝐶 = − 𝑣𝑣𝐶𝐶 + 𝑖𝑖𝐿𝐿 𝑣𝑣𝐶𝐶 𝑧𝑧1
Substitute, (2) into (1), we obtain, �𝑑𝑑𝑑𝑑
𝑑𝑑 1
𝑅𝑅𝑅𝑅
1
𝐶𝐶
(3) let � 𝑖𝑖 � = �𝑧𝑧 �
𝑖𝑖 = − 𝑣𝑣𝐶𝐶 + 𝑣𝑣 (𝑡𝑡) 𝐿𝐿 2
𝑑𝑑𝑑𝑑 𝐿𝐿 𝐿𝐿 𝐿𝐿
𝑧𝑧̇ −1/𝑅𝑅𝑅𝑅 1 𝑧𝑧1 0 1 𝑧𝑧1
Thus, (1) yields: � 1 � = � � �𝑧𝑧 � + � � 𝑣𝑣(𝑡𝑡) & 𝑦𝑦(𝑡𝑡) = �𝑅𝑅 0� �𝑧𝑧 �
𝑧𝑧̇2 −1/𝐿𝐿 0 2 1/𝐿𝐿 2
14 14 May 2025