0% found this document useful (0 votes)
11 views

Modelling and Simulation_ Lecture 02_Final Version_Part2

Uploaded by

Amr Farag
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Modelling and Simulation_ Lecture 02_Final Version_Part2

Uploaded by

Amr Farag
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

Modelling and Simulation

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.

Static vs. Dynamic Decisions


❑ Decisions based on static analysis might be misleading because they
don't consider how the system evolves. For instance, a static analysis
might suggest a particular configuration is stable, but dynamic analysis
could reveal that over time, this configuration leads to instability or
poor performance. This is why in many systems (e.g., control systems,
energy systems, mechanical systems), dynamic analysis is essential to
make the right decisions.
3- Modeling of Dynamic Systems State-Determined Systems and
Dynamic Modeling

❑ 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,

or temperature and energy in thermal systems.

❑ In a dynamic system, these variables are influenced by inputs (such as external forces, voltages, or heat flux)

and evolve according to differential equations over time.


3- Modeling of Dynamic Systems Predicting the Behavior of State-
Determined Systems

The dynamic behavior of such a system can be predicted if

❑ 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

These models come with some fundamental assumptions


❑ Time runs forward (Causality): The future state of the system depends only on the current and past states, and not
on future events. This assumption is related to the principle of causality, where the present system state cannot be
affected by events that occur in the future.
❑ This is a core assumption in most physical systems because real-world systems follow the forward flow of time. As
such, the model assumes that time runs in one direction—from past to future—and this directionality is critical in the
formulation of differential equations.
3- Modeling of Dynamic Systems Ordinary Differential Equations
(ODEs) and Algebraic Relations

❑ 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

❑ Dynamic system represented by

state variables X. It can be used

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

❑ Dynamic system represented by from observed data.


▪ Given time histories of input U and output Y, either through experimentation or
state variables X. It can be used observation, we aim to find a model S and state variables X that are consistent with both the
input and output data.
for:
▪ This process often involves techniques like system identification and parameter

➢ 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

❑ Dynamic system represented by produces a desired output Y.


▪ This is more of a design task, where you start with the output behavior you want, then work
state variables X. It can be used backward to figure out how to construct the system S and select state variables X that will
give you that behavior.
for:
▪ For example, in control systems, you might want to design a controller that ensures a 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

state variables X. It can be used

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 𝑘 denotes discrete time steps.

Superposition Principle in Linear Systems:


❑ A key property of linear systems is that they obey the superposition principle. This means that if x(t) and y(t) are
solutions to the system’s equations, then any linear combination of these solutions is also a valid solution:

❑ 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:

❑ where f is a nonlinear function of the state variables X and inputs U.


3- Modeling of Dynamic Systems Linear vs Non-linear System
Analysis of Nonlinear Systems

❑ 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

Linear Systems Nonlinear Systems

Governed by linear differential equations. Governed by nonlinear differential equations.

Superposition principle holds. Superposition principle does not hold.

Can use eigenvalues, transfer functions, and Require time-step simulation or specialized
frequency response for analysis. techniques for analysis.

Real-world systems tend to be nonlinear, requiring


Easier to analyze and design control strategies.
more complex models.
The End!

Any Questions

You might also like