Dingyu Xue, YangQuan Chen
System Simulation Techniques with
MATLAB and Simulink
A JOHN WILEY & SONS, INC., PUBLICATION 2013
CHAPTER 1
INTRODUCTION TO SYSTEM SIMULATION
TECHNIQUES AND APPLICATIONS
Dingyu Xue
Northeastern University, Shenyang, China
CHAPTER 1 INTRODUCTION TO SYSTEM SIMULATION TECHNIQUES AND
APPLICATIONS
Dingyu Xue, YangQuan Chen System Simulation Techniques with MATLAB and
12/12/24 18:51 Simulink 2013
Chapter 1 Introduction to System Si-
mulation Techniques and Applications
The main content
Overview of System Simulation Techniques
Development of Simulation Software
Introduction to MATLAB
Structure of the Book
CHAPTER 1 INTRODUCTION TO SYSTEM SIMULATION TECHNIQUES AND
APPLICATIONS
Dingyu Xue, YangQuan Chen System Simulation Techniques with MATLAB and
12/12/24 18:51 Simulink 2013
1.1 Overview of System Simulation
Techniques
Systems are the integrated wholes composed of
interrelated and interacting entities.
These could be engineering systems or non-
engineering systems. Engineering systems are the
whole composed of interacting components such that
certain system objectives can be achieved.
Motor drive systems are composed of an actuating
component, a power transfer component and a signal
measurement component, so as to control the motor speed
or position, among other objectives.
CHAPTER 1 INTRODUCTION TO SYSTEM SIMULATION TECHNIQUES AND
APPLICATIONS
Dingyu Xue, YangQuan Chen System Simulation Techniques with MATLAB and
12/12/24 18:51 Simulink 2013
The field of non-engineering systems is much wider. From
universe to micro world, any integrated whole can also be
regarded as a system, since there are interrelated and
interacting relationships.
In order to quantitatively study the behavior of a
system, the internal characteristics and interacting
relationship should be extracted, to construct a model
of the system.
System models can be classified as physical models and
mathematical models. Following the rapid development and
utilization of computer technology, the application of
mathematical models is more and more popular.
CHAPTER 1 INTRODUCTION TO SYSTEM SIMULATION TECHNIQUES AND
APPLICATIONS
Dingyu Xue, YangQuan Chen System Simulation Techniques with MATLAB and
12/12/24 18:51 Simulink 2013
The Mathematical Model of a System
A mathematical model of a system is a mathematical
expression describing the dynamical behavior of the
system. They can be used to describe the relationship
of quantities in the system and they are the basis of
system analysis and design.
The classification of the system:
Continuous-time systems, discrete-time systems, discrete
event systems and hybrid systems
Subclasses of linear, nonlinear systems
Time invariant, time varying systems
Lumped parameters, distributed parameters systems
Deterministic and stochastic systems
CHAPTER 1 INTRODUCTION TO SYSTEM SIMULATION TECHNIQUES AND
APPLICATIONS
Dingyu Xue, YangQuan Chen System Simulation Techniques with MATLAB and
12/12/24 18:51 Simulink 2013
Overview of System Simulation
Techniques
System simulation is a subject within which the
system behavior can be studied on the basis of the
mathematical models of the actual systems.
Computer simulation of the systems is the main topic
of the subject, including the topics of:
Systems, modeling, simulation algorithms
Computer programming
Display of simulation results
Validation of simulation results
CHAPTER 1 INTRODUCTION TO SYSTEM SIMULATION TECHNIQUES AND
APPLICATIONS
Dingyu Xue, YangQuan Chen System Simulation Techniques with MATLAB and
12/12/24 18:51 Simulink 2013
1.2 Development of Simulation
Software
Historically, computer simulation techniques
went through the following stages of
development:
In the 1940s, analog simulation was the major way
of simulation.
Digital simulation began in 1950s.
In the 1960s, the first simulation languages and
packages began to emerge.
In the 1980s, development of object oriented
simulation techniques was the leading trend.
CHAPTER 1 INTRODUCTION TO SYSTEM SIMULATION TECHNIQUES AND
APPLICATIONS
Dingyu Xue, YangQuan Chen System Simulation Techniques with MATLAB and
12/12/24 18:51 Simulink 2013
With the popularity and wide availability of digital
computers, in the past 30 years, a great many
professional computer simulation languages and tools
have appeared.
CSMP, ACSL, SIMNON, MATLAB/Simulink,
MatrixX/System Build, CSMP-C
MATLAB/Simulink has become more and more
popular and powerful, most of the above-mentioned
simulation packages are no longer available.
MATLAB/Simulink has became the de facto standard
computer language and tool for system simulation.
CHAPTER 1 INTRODUCTION TO SYSTEM SIMULATION TECHNIQUES AND
APPLICATIONS
Dingyu Xue, YangQuan Chen System Simulation Techniques with MATLAB and
12/12/24 18:51 Simulink 2013
1.2.2 Development of Earlier
Mathematics Packages
The rapid development of digital computers and
programming languages powered research into
numerical computation.
Mathematical software is the basis of the simulation
software.
The early typical mathematical software package:
The LINPACK package – linear algebraic equation solver,
The eigenvalue-based package EISPACK.
The NAG package developed by the Numerical Algorithm
Group in Oxford.
The subroutinesCHAPTER
provided in Numerical
1 INTRODUCTION Recipes.
TO SYSTEM SIMULATION TECHNIQUES AND
APPLICATIONS
Dingyu Xue, YangQuan Chen System Simulation Techniques with MATLAB and
12/12/24 18:51 Simulink 2013
EISPACK Example
Mainly used to solve eigenvalue problems
Written in Fortran
To find all the eigenvalues of matrix the
following subroutine calls are suggested in the
EISPACK package:
CHAPTER 1 INTRODUCTION TO SYSTEM SIMULATION TECHNIQUES AND
APPLICATIONS
Dingyu Xue, YangQuan Chen System Simulation Techniques with MATLAB and
12/12/24 18:51 Simulink 2013
Using QR algorithm, more than 500 source program
The most advanced at that time, but now tedious and
error-prone
CHAPTER 1 INTRODUCTION TO SYSTEM SIMULATION TECHNIQUES AND
APPLICATIONS
Dingyu Xue, YangQuan Chen System Simulation Techniques with MATLAB and
12/12/24 18:51 Simulink 2013
Writing Programs With Packages Has
the Following Disadvantages
Inconvenience, difficult to write programs and
error-prone.
Trivial procedures are involved.
A main program has to be written, and compiling
and linking to the program should be made to
generate executable files.
A lot of effort is needed to debug the program and
to validate the program.
CHAPTER 1 INTRODUCTION TO SYSTEM SIMULATION TECHNIQUES AND
APPLICATIONS
Dingyu Xue, YangQuan Chen System Simulation Techniques with MATLAB and
12/12/24 18:51 Simulink 2013
Too many executable files.
To solve a specific problem, a dedicated program
has to be prepared.
Not suitable for data transfer between independent
programs.
Each program can solve one particular problem.
It might be difficult to transfer data from one
standalone program to another.
Difficult to allocate the array size, plotting faci
lities are inconvenience, cannot be easily trans
ported to other platforms,…
CHAPTER 1 INTRODUCTION TO SYSTEM SIMULATION TECHNIQUES AND
APPLICATIONS
Dingyu Xue, YangQuan Chen System Simulation Techniques with MATLAB and
12/12/24 18:51 Simulink 2013
The Development of Mathematical
Packages is Still Going on.
The most advanced numerical algorithms are
implemented in mathematical packages, and
more effective, more accurate and faster
mathematical packages are still being produced.
In the field of numerical linear algebra, the
brand new LAPACK is becoming the leading
mathematical package.
CHAPTER 1 INTRODUCTION TO SYSTEM SIMULATION TECHNIQUES AND
APPLICATIONS
Dingyu Xue, YangQuan Chen System Simulation Techniques with MATLAB and
12/12/24 18:51 Simulink 2013
The objective of the new packages is no longer to
support the average user.
Provided as low-level support to mathematical
languages.
In new versions of MATLAB, the base packages
LINPACK and EISPACK have been abandoned,
and LAPACK is used instead to provide support
for linear algebra computation.
LAPACK is used to provide underlying support for
many other languages.
CHAPTER 1 INTRODUCTION TO SYSTEM SIMULATION TECHNIQUES AND
APPLICATIONS
Dingyu Xue, YangQuan Chen System Simulation Techniques with MATLAB and
12/12/24 18:51 Simulink 2013
1.2.3 Development of Simulation
Software and Languages
Simulation techniques gained the attention of
scholars and experts worldwide, and the Inter-
national Simulation Councils Inc (SCi) was
founded.
In 1967 SCi formalized simulation language
standards. Computer Simulation Modeling
Program (CSMP) can be regarded as the earliest
simulation language using that standard.
CHAPTER 1 INTRODUCTION TO SYSTEM SIMULATION TECHNIQUES AND
APPLICATIONS
Dingyu Xue, YangQuan Chen System Simulation Techniques with MATLAB and
12/12/24 18:51 Simulink 2013
In 1988 Shenyang institute of automation
Chinese academy of sciences launched a
version of the language promotion CSMP-C.
In the early 1980s, Mitchell and Gauthier
Associates released a brand new simulation
language ACSL (Advanced Continuous
Simulation Language), based on SCi’s
standard.
CHAPTER 1 INTRODUCTION TO SYSTEM SIMULATION TECHNIQUES AND
APPLICATIONS
Dingyu Xue, YangQuan Chen System Simulation Techniques with MATLAB and
12/12/24 18:51 Simulink 2013
ACSL Profile
Many ACSL blocks (macros) are provided:
Transfer function block TRAN, integrator block INTEG, le
ad-lag block LEDLAG, time delay block DELAY, dead
zone nonlinearity block DEAD, hysteresis block BAKLSH
and rate limited integrator block LIMINT.
These blocks can be used to describe a simulation
model of the system.
After the ACSL source program has been written, the
compiler and linker are used to create an executable
file.
CHAPTER 1 INTRODUCTION TO SYSTEM SIMULATION TECHNIQUES AND
APPLICATIONS
Dingyu Xue, YangQuan Chen System Simulation Techniques with MATLAB and
12/12/24 18:51 Simulink 2013
The ACSL Model of Van der Pol
Equation
Van der Pol equation
ACSL cannot modeling the joints differential
equation directly. It needs to be transformed into a
first order equation, state variables can
be selected, and the Van der Pol equation can be
represented as:
CHAPTER 1 INTRODUCTION TO SYSTEM SIMULATION TECHNIQUES AND
APPLICATIONS
Dingyu Xue, YangQuan Chen System Simulation Techniques with MATLAB and
12/12/24 18:51 Simulink 2013
ACSL model
CHAPTER 1 INTRODUCTION TO SYSTEM SIMULATION TECHNIQUES AND
APPLICATIONS
Dingyu Xue, YangQuan Chen System Simulation Techniques with MATLAB and
12/12/24 18:51 Simulink 2013
Other Packages and Simulation
Languages
The SIMNON package and ESL
MATLAB+Simulink
The MATLAB-like languages
Ctrl-C, Matrix-X, O-Matrix, CemTool
Free languages:Octave, Scilab
Computer algebra systems
The earlier: mumath, reduce
The dominating: Mathematica, Maple
MATLAB Symbolic Math Toolbox
CHAPTER 1 INTRODUCTION TO SYSTEM SIMULATION TECHNIQUES AND
APPLICATIONS
Dingyu Xue, YangQuan Chen System Simulation Techniques with MATLAB and
12/12/24 18:51 Simulink 2013
1.3 Introduction to MATLAB
In the fields of scientific computation and system
simulation, MATLAB will keep its unique and
leading position for a long time to come.
MATLAB/Simulink is the thread of the book
The main content
Brief History of the Development of MATLAB
Characteristics of MATLAB
Selection and advice of MATLAB version
CHAPTER 1 INTRODUCTION TO SYSTEM SIMULATION TECHNIQUES AND
APPLICATIONS
Dingyu Xue, YangQuan Chen System Simulation Techniques with MATLAB and
12/12/24 18:51 Simulink 2013
1.3.1 Brief History of the Development
of MATLAB
The creator: Professor Cleve Moler, New Mexico
MATLAB (MATrix LABoratory), 1980.
Jack Little, The MathWorks, 1984.
The first version executable on Microsoft Windows 3.5i, 1990.
Simulink (Early called Simulab), 1990~1991.
Graphical user interface programming was introduced
MATLAB 4.0 , 1992.
The object-oriented MATLAB 5.0 , 1997.
Two versions a year now, named version a (March) and
version b (September) , 2007 ~ .
CHAPTER 1 INTRODUCTION TO SYSTEM SIMULATION TECHNIQUES AND
APPLICATIONS
Dingyu Xue, YangQuan Chen System Simulation Techniques with MATLAB and
12/12/24 18:51 Simulink 2013
1.3.2 Characteristics of MATLAB
Powerful mathematical functions
High precision, high efficiency, high reliability, high
credibility of numerical calculation.
Powerful analytic arithmetic (symbolic computation).
Powerful function of computer graphics.
Powerful simulation function.
Based on the simulation method of the diagram.
Physical modeling in many fields.
The interface of hardware-in-the-loop simulation and real-
time control.
It can be run on any computer platforms and has
portability. CHAPTER 1 INTRODUCTION TO SYSTEM SIMULATION TECHNIQUES AND
APPLICATIONS
Dingyu Xue, YangQuan Chen System Simulation Techniques with MATLAB and
12/12/24 18:51 Simulink 2013
1.3.3 Version Selection and Advice of
MATLAB
Choice the new version as far as possible for
the simulation function.
The latest version is 2013a. In April 2013
Choice 2008a or previous versions for
symbolic operation
Using 32-bit MATLAB as far as possible.
CHAPTER 1 INTRODUCTION TO SYSTEM SIMULATION TECHNIQUES AND
APPLICATIONS
Dingyu Xue, YangQuan Chen System Simulation Techniques with MATLAB and
12/12/24 18:51 Simulink 2013
R2008b and later use of symbolic operation toolkit
2008b introduced muPad as kernel, the function and
efficiency is much lower than the original Maple kernel
Weaken the function of many symbolic operation, such as
differential function.
The maple function of original version can no longer use.
Symbolic variable overloaded function, the early versions
in @ sym directory, the new version is copied to the
toolbox/symbolic/symbolic, and then run rehash
toolboxcache.
CHAPTER 1 INTRODUCTION TO SYSTEM SIMULATION TECHNIQUES AND
APPLICATIONS
Dingyu Xue, YangQuan Chen System Simulation Techniques with MATLAB and
12/12/24 18:51 Simulink 2013
1.4 Structure of the Book
Structure of the book, see catalog:
Introduction to MATLAB (Chapter 1~2)
Scientific computation problem solutions with
MATLAB (Chapter 3)
Simulink simulation of primary, intermediate and
advanced technology (Chapter 4~6)
Simulation techniques of engineering system and
non-engineering system (Chapter 7~8)
Hardware-in-the-loop simulation and real-time
control problems (Chapter 9)
CHAPTER 1 INTRODUCTION TO SYSTEM SIMULATION TECHNIQUES AND
APPLICATIONS
Dingyu Xue, YangQuan Chen System Simulation Techniques with MATLAB and
12/12/24 18:51 Simulink 2013
1.4.2 Code Download and Internet
Resources
The book service website
[Link]
Site content
The MATLAB functions and models developed for the
book
The courseware of the book (interactive PPT files)
Other resources
[Link] [Link]
[Link]
[Link]
[Link]
CHAPTER 1 INTRODUCTION TO SYSTEM SIMULATION TECHNIQUES AND
APPLICATIONS
Dingyu Xue, YangQuan Chen System Simulation Techniques with MATLAB and
12/12/24 18:51 Simulink 2013
How to Make Full and
Active Use of BBS
Two suggestions for the use of forums:
When a problem is encountered, first try to solve
the problem by yourself. Sometimes the answers
obtained by one’s own effort can be of great
benefit.
Actively contribute to the questions to which you
know the answers, or participate in discussion, so
as to improve the skills of others.
CHAPTER 1 INTRODUCTION TO SYSTEM SIMULATION TECHNIQUES AND
APPLICATIONS
Dingyu Xue, YangQuan Chen System Simulation Techniques with MATLAB and
12/12/24 18:51 Simulink 2013
Wiley and TMW BookPrgram
Sites
[Link]
[Link]
[Link]
Service site:
[Link]
013wiley
CHAPTER 1 INTRODUCTION TO SYSTEM SIMULATION TECHNIQUES AND
APPLICATIONS
Dingyu Xue, YangQuan Chen System Simulation Techniques with MATLAB and
12/12/24 18:51 Simulink 2013