Modelling and Simulation_ Lecture 02_Final Version_Part2
Modelling and Simulation_ Lecture 02_Final Version_Part2
MPW331
Lecture 02 (cont.)
Introduction to Modeling
Instructors
Prof. Dr. Tamer Mansour Dr. Eng. Mohamed Elsabahy
Lecture Outline
1- Introduction to Modelling
2- Examples of models
3- Modeling of Dynamic Systems
4- Introduction to Simulation
5- MATLAB as a Simulation tool
3- Modeling of Dynamic Systems Difference Between Static and
Dynamic System Analysis
❑ Static system analysis assumes the system is in a steady state, where the inputs and outputs do not
change over time. This type of analysis can be simpler because it ignores the effects of time, feedback, and
transient states.
❑ Dynamic system analysis, on the other hand, takes into account how the system's state changes over
time due to external inputs, feedback, and internal interactions. It models the system's behavior as a series
of time-dependent changes, which can include oscillations, instabilities, or delays.
3- Modeling of Dynamic Systems Why Dynamic System Analysis is
More Complex
❑ Transient States: Dynamic systems can have transient phases where the system's behavior changes before
it reaches a steady state (if it reaches one at all). Analyzing these transitions requires understanding how the
system responds over time.
❑ Feedback and Delays: Dynamic systems often involve feedback loops, where an output is fed back into the
system as an input, creating time-dependent effects. Delays and feedback can introduce instabilities, which
make the analysis more complex.
❑ Instabilities and Oscillations: Some dynamic systems may never reach a steady state due to inherent
instabilities or continuous oscillations. These behaviors need to be understood to properly model the system.
3- Modeling of Dynamic Systems Reaching Steady State and the
Impact of External Disturbances
❑ Many real-world systems are subject to external disturbances (such as changes in environment, load, or inputs) that
prevent them from achieving a steady state. Dynamic analysis considers how these disturbances affect the system's
performance over time, which is critical in many engineering and control applications.
❑ Goal of Dynamic Modeling: In dynamic modeling, the objective is to represent physical systems
mathematically. We start by understanding the behavior of the individual components (such as electrical,
mechanical, or thermal components) and then combine them to form a mathematical model that describes
the system's overall behavior.
❑ Mathematical Models of State-Determined Systems: These models are typically governed by ordinary
differential equations (ODEs), which describe how the system’s state variables evolve over time.
Additionally, the model includes algebraic relations to connect other system variables to these state
variables.
3- Modeling of Dynamic Systems What Are State Variables?
❑ State variables are the minimum set of variables needed to describe the system's state at any given time.
They hold all the information necessary to predict the future behavior of the system. Examples of state
variables could include position and velocity in mechanical systems, charge and current in electrical systems,
❑ In a dynamic system, these variables are influenced by inputs (such as external forces, voltages, or heat flux)
❑ Initial Conditions (State Variables at Initial Time): The values of the state variables at the start of the simulation (or at
some initial time) are known. This forms the initial condition for solving the differential equations.
❑ Input Quantities (Future Inputs): The future time history of inputs to the system is known. These inputs are external
factors influencing the system, and knowing them is essential to predict how the state variables will evolve.
3- Modeling of Dynamic Systems Built-in Assumptions in These
Models
❑ The ODEs describe how the state variables change with respect to time. These equations often reflect laws
of physics, such as Newton's laws in mechanics, Kirchhoff’s laws in circuits, or energy balance in thermal
systems.
❑ The algebraic relations define how other system variables, which are not independent, are connected to
the state variables. For example, in an electrical circuit, the current through an inductor may be a state
variable, while the voltage across a resistor might be related to the current through Ohm’s law (an algebraic
relation).
3- Modeling of Dynamic Systems Usefulness of Dynamic Model
A general dynamic system model
for:
➢ Analysis
➢ Identification
➢ Synthesis
3- Modeling of Dynamic Systems Usefulness of Dynamic Model
A general dynamic system model
▪ In analysis, we use the state variables X to predict the future behavior Y of the
❑ Dynamic system represented by
system S when subjected to future inputs U.
state variables X. It can be used ▪ This approach requires knowing the current state of the system X, which
represents the system’s state at the present time.
for:
▪ The key assumption is that the system model accurately represents the physical
➢ Analysis system. If the model S is correct, it allows us to predict how the system will
behave in the future based on future inputs.
➢ Identification
o For example, in a mechanical system, if we know the current velocity and
➢ Synthesis position (the state variables), we can predict the future motion of the system
given a known force (input U) over time.
3- Modeling of Dynamic Systems Usefulness of Dynamic Model
A general dynamic system model
▪ Identification refers to the process of determining a system model S and state variables X
➢ Analysis estimation, where the goal is to fit a mathematical model to experimental data.
▪ A good model is one that remains consistent across a range of inputs and outputs—
➢ Identification meaning it should be able to predict Y accurately for various U values.
o For example, in an electrical circuit, you could vary the input voltage U, observe the
➢ Synthesis current Y, and then identify the underlying circuit components (resistances,
inductances, etc.) that form the state variables.
3- Modeling of Dynamic Systems Usefulness of Dynamic Model
A general dynamic system model
▪ Synthesis involves designing a system S such that, when given an input U, the system
➢ Analysis (such as a robot or a power plant) behaves in a certain way. You'd determine the system
dynamics and controller so that the input (like a control signal) drives the system to achieve
➢ Identification the desired output.
o In practical terms, you might design an automated temperature control system S,
➢ Synthesis where the input U (e.g., heat supply) needs to be manipulated such that the desired
room temperature Y is achieved and maintained.
3- Modeling of Dynamic Systems Usefulness of Dynamic Model
A general dynamic system model
Student Activity
❑ Dynamic system represented by
▪ Give examples for Analysis, Identification, and synthesis processes
for:
➢ Analysis
➢ Identification
➢ Synthesis
3- Modeling of Dynamic Systems Linear vs Non-linear System
The distinction between linear and nonlinear systems is fundamental in modeling dynamic systems.
Linear System
❑ A linear system is one in which the relationship between inputs and outputs, as well as between state
variables, follows linear equations. These systems are governed by linear, first-order differential
equations.
❑ The variation of the state vector X in a linear system is proportional to the current state, and the dynamics
are captured by a constant matrix A. The system can be described by:
Here:
• 𝑋(𝑡) is the state vector (an N-dimensional vector of the state variables).
• 𝐴 is a constant matrix representing the system’s dynamics.
𝑑𝑋 𝑡
• 𝑑𝑡
is the time derivative of the state vector, showing how it changes with time.
3- Modeling of Dynamic Systems Linear vs Non-linear System
Linear System (Cont.)
❑ Alternatively, in discrete-time systems (where changes occur at distinct time steps), the state X varies according to a
mapping:
❑ where a and β are scalars. This property holds because the system’s equations are linear.
❑ This allows for the use of linear algebra tools, such as eigenvalues, transfer functions, and frequency response
analysis, to study the system’s behavior.
3- Modeling of Dynamic Systems Linear vs Non-linear System
Tools for Linear System Analysis
❑ Eigenvalues and Eigenvectors: These are used to analyze the stability and dynamic response of linear systems. The
eigenvalues of matrix A indicate how the system’s state variables behave over time—whether they grow, decay, or
oscillate.
❑ Transfer Functions: This tool is used to relate the input to the output in the frequency domain. It helps analyze how
the system responds to different frequency inputs.
❑ Frequency Response: This shows how the system responds to sinusoidal inputs at different frequencies and helps
design controllers.
3- Modeling of Dynamic Systems Linear vs Non-linear System
Nonlinear Systems
❑ A nonlinear system is one in which the relationship between inputs and outputs (or between state variables)
is governed by nonlinear equations. These systems can still be state-determined, but their equations involve
terms that are not linear (e.g., products, powers, or transcendental functions like sinusoids).
❑ For instance, systems that involve sliding friction, aerodynamic drag, or other phenomena that depend on
non-constant parameters exhibit nonlinear behavior.
❑ Nonlinear systems are described by:
❑ Linear tools do not work: If a system contains even a single nonlinear component (e.g., sliding friction),
the linear analysis methods (eigenvalue analysis, transfer functions, etc.) are not applicable.
❑ Time-step simulation: One of the most common approaches to studying nonlinear systems is through
numerical simulation. This involves discretizing time into small steps and calculating the system’s
behavior at each step. Commercial software (like MATLAB Simulink, ANSYS, etc.) is widely used for these
simulations.
❑ Complexity: Nonlinear systems are much harder to analyze because they don’t follow the superposition
principle. Small changes in inputs or initial conditions can lead to drastically different behaviors (e.g.,
chaos).
3- Modeling of Dynamic Systems Linear vs Non-linear System
Can use eigenvalues, transfer functions, and Require time-step simulation or specialized
frequency response for analysis. techniques for analysis.
Any Questions