在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 95305|回复: 80

震撼!!!经典!!!!Springer - Modeling and Simulation in Scilab/Scicos

[复制链接]
发表于 2009-2-14 15:37:02 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
Preface
Scilab (http://www.scilab.org) is a free open-source software package for scientific computation.
It includes hundreds of general purpose and specialized functions for numerical
computation, organized in libraries called toolboxes that cover such areas as simulation,
optimization, systems and control, and signal processing. These functions reduce considerably
the burden of programming for scientific applications.
One important Scilab toolbox is Scicos. Scicos (http://www.scicos.org) provides
a block-diagram graphical editor for the construction and simulation of dynamical systems.
Scilab/Scicos is the only open-source alternative to commercial packages for dynamical
system modeling and simulation packages such as MATLAB/Simulink and MATRIXx/
SystemBuild. Widely used at universities and engineering schools, Scilab/Scicos
is gaining ground in industrial environments. This is due in part to the creation of an
international consortium in 2003 that a number of large and small companies have joined.
The consortium is responsible for providing well-tested and documented releases for various
platforms and coordinates the development of the core product and toolboxes, which
is done by research groups, in particular, at INRIA1 and ENPC.2 Currently there are over
10,000 monthly Scilab downloads from http://www.scilab.org alone.
Scilab includes a full user’s manual, which is available with search capabilities in a
help window. All commands, their syntax, and simple illustrative examples are given.
While very useful in finding out the details of a particular command, this manual does not
provide a tutorial on the philosophy of either Scilab or Scicos. Nor does it address how to
use several of these commands together in the solution of a technical problem.
The objective of this book is to provide a tutorial for the use of Scilab/Scicos with a
special emphasis on modeling and simulation tools. While it will provide useful information
to experienced users, it is designed to be accessible to beginning users from a variety of
disciplines. Students [33] and academic and industrial scientists and engineers should find
it useful. The discussion includes some information on modeling and simulation in order to
assist the reader in deciding which simulation tools might be most useful to them. Every
software environment has its special features, some would say quirks, that experienced
users automatically take into account but often prove confusing to beginning users. We
have tried to point these out where appropriate.
The book is divided into two parts. The first part concerns Scilab and includes a
tutorial covering the language features, the data structures and specialized functions for
doing graphics, importing and exporting data, interfacing with external routines, etc. It
1 Institut National de Recherche en Informatique et en Automatique
2 Ecole Nationale des Ponts et des Chauss´ees
VI Preface
also covers in detail Scilab numerical solvers for ODEs (ordinary differential equations) and
DAE’s (differential-algebraic equations). Even though the emphasis is placed on modeling
and simulation applications, this part provides a global view of the product.
The second part is dedicated to modeling and simulation of dynamical systems in Scicos.
Scicos provides a block-diagram editor for constructing models. This type of modeling
tool is widely used in industry because it provides a means for constructing modular and
reusable models. This part contains a detailed description of the editor and its usage,
which is illustrated through numerous examples. It also covers advanced subjects such as
constructing new blocks and batch simulation. Code generation and debugging are other
topics covered. Finally, a new extension of Scicos is discussed. This extension allows the
use of components described by the Modelica (http://www.modelica.org) language.
There have been several previous books concerning Scilab. Most of these have been in
French [18, 3, 2, 1, 25] and dealt with earlier versions of Scilab, as in [16]. This book is
unique in a number of ways. It is the first to deal with the new Scilab 3.1 version. This
book is also the first to focus on simulation and modeling. It is also the first to put a major
emphasis on Scicos and discuss Scicos in depth.
The source of all the examples presented in this book can be downloaded from
http://www.scicos.org.
Finally, a large number of people have supported us in many ways. We would especially
like to thank our wives, Gail Campbell and Homa Nikoukhah, and our parents, Aline and
Ren´e Chancelier, for their support in this and everything else we do.
Steve Campbell
Jean-Philippe Chancelier
Ramine Nikoukhah

Contents
Part I Scilab
1 General Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1 What Is Scilab? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 How to Start?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2.1 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2.2 First Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2.3 Line Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2.4 Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.3 Typical Usage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.4 Scilab on the Web . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2 Introduction to Scilab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.1 Scilab Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.1.1 Matrix Construction and Manipulation. . . . . . . . . . . . . . . . . . . . . . . . . 12
2.1.2 Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.1.3 Boolean Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.1.4 Polynomial Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.1.5 Sparse Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.1.6 Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.1.7 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.2 Scilab Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.2.1 Branching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
2.2.2 Iterations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.2.3 Scilab Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.2.4 Debugging Programs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.3 Input and Output Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
2.3.1 Display of Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
2.3.2 Formatted Input and Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
2.3.3 Input Output in Binary Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
2.3.4 Accessing the Host System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
2.3.5 Graphical User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
2.4 Scilab Graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
2.4.1 Basic Graphing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
2.4.2 Graphic Tour . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
2.4.3 Graphics Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
VIII Contents
2.4.4 Scilab Graphics and LATEX. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
2.4.5 Old Graphics Style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
2.5 Interfacing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
2.5.1 Linking Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
2.5.2 Writing an Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
2.5.3 Dynamic Loading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
3 Modeling and Simulation in Scilab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
3.1 Types of Models. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
3.1.1 Ordinary Differential Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
3.1.2 Boundary Value Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
3.1.3 Difference Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
3.1.4 Differential Algebraic Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
3.1.5 Hybrid Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
3.2 Simulation Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
3.2.1 Ordinary Differential Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
3.2.2 Boundary Value Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
3.2.3 Difference Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
3.2.4 Differential Algebraic Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
3.2.5 Hybrid Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
4 Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
4.1 Comments on Optimization and Solving Nonlinear Equations . . . . . . . . . . . 107
4.2 General Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
4.3 Solving Nonlinear Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
4.4 Nonlinear Least Squares . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
4.5 Parameter Fitting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
4.6 Linear and Quadratic Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
4.6.1 Linear Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
4.6.2 Quadratic Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
4.6.3 Semidefinite Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
4.7 Differentiation Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
4.7.1 Higher Derivatives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
5 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
5.1 Modeling and Simulation of an N-Link Pendulum . . . . . . . . . . . . . . . . . . . . . 125
5.1.1 Equations of Motion of the N-Link Pendulum. . . . . . . . . . . . . . . . . . . 126
5.1.2 Generated Code and Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
5.1.3 Maple Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
5.2 Modeling and Simulation of a Car . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
5.2.1 Basic Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
5.2.2 Equations of Motion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
5.2.3 Simulation Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
5.2.4 Scilab Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
5.2.5 Simulation Result . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
5.3 Open-Loop Control to Swing Up a Pendulum . . . . . . . . . . . . . . . . . . . . . . . . . 142
5.3.1 Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
5.3.2 Control Problem Formulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
5.3.3 Optimization Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
5.3.4 Implementation in Scilab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Contents IX
5.4 Parameter Fitting and Implicit Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
5.4.1 Mathematical Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
5.4.2 Scilab Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
Part II Scicos
6 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
7 Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
7.1 Construction of a Simple Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
7.1.1 Running Scicos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
7.1.2 Editing a Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
7.1.3 Diagram Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
7.1.4 Changing Block Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
7.2 Symbolic Parameters and Context . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
7.3 Hierarchy. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
7.3.1 Placing a Super Block in a Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
7.3.2 Editing a Super Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
7.4 Save and Load . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
7.4.1 Scicos File Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
7.4.2 Super Block and Palette. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
7.5 Synchronism and Special Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
8 Scicos Formalism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
8.1 Activation Signal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
8.1.1 Block Activation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
8.1.2 Activation Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
8.2 Inheritance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
8.3 Always Active Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
8.4 Constant Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
8.5 Conditional Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
9 Scicos Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
9.1 Block Behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
9.1.1 External Activation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
9.1.2 Always Activation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
9.1.3 Internal Zero-Crossing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
9.2 Blocks Inside Palettes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
9.3 Modifying Block Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
9.4 Super Block and Scifunc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
9.4.1 Super Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
9.4.2 Scifunc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
9.5 Constructing New Basic Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
9.5.1 Interfacing Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
9.5.2 Computational Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
9.5.3 Saving New Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
9.6 Constructing and Loading a New Palette . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
X Contents
10 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
10.1 Predator Prey Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
10.2 Control Application. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
10.3 Signal Processing Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
10.4 Queuing Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
10.5 Neuroscience Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
10.6 A Fluid Model of TCP-Like Behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
10.7 Interactive GUI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
11 Batch Processing in Scilab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
11.1 Piloting Scicos via Scilab Commands. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
11.1.1 Function scicosim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
11.1.2 Function scicos simulate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
11.2 Data Sharing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
11.2.1 Context Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
11.2.2 Input/Output Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
11.2.3 Global Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
11.3 Examples. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
11.4 Steady-State Solution and Linearization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
11.4.1 Scilab Function steadycos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
11.4.2 Scilab Function lincos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
12 Code Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
12.1 Code Generation Procedure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
12.2 Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
12.2.1 Continuous-Time Activation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
12.2.2 Synchronicism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258
12.3 A Look Inside . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258
12.4 Some Pitfalls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
12.5 Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
13 Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
13.1 Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
13.1.1 Block Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
13.1.2 Errors During Numerical Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
13.1.3 Other Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
13.2 Debugging Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
13.3 Examples. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
13.3.1 Log File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
13.3.2 Animation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
14 Implicit Scicos and Modelica . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
14.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
14.2 Internally Implicit Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
14.3 Implicit Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275
14.3.1 Scicos Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
14.3.2 Scicos Compiler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
14.3.3 Block Construction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
14.4 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
Contents XI
A Inside Scicos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
A.1 Scicos Editor. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
A.1.1 Main Editor Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
A.1.2 Structure of scs m . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
A.2 Scicos Complier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
A.2.1 First Compilation Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
A.2.2 Second Compilation Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
A.2.3 Structure of %cpr. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
A.2.4 Partial Compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
A.3 Scicos Simulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
B Scicos Blocks of Type 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
B.1 Type 5 Block for the Bouncing Ball Example . . . . . . . . . . . . . . . . . . . . . . . . . 293
B.2 Animation Block for the Cart Pendulum Example . . . . . . . . . . . . . . . . . . . . . 294
C Animation Program for the Car Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299
D Extraction Program for the LATEX Graphic Example . . . . . . . . . . . . . . . . 301
E Maple Code Used for Modeling the N-Link Pendulum. . . . . . . . . . . . . . . 303
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309
scilab.JPG

Springer - Modeling and Simulation in Scilab + Scicos.pdf

2.36 MB, 下载次数: 515 , 下载积分: 资产 -2 信元, 下载支出 2 信元

头像被屏蔽
发表于 2009-2-15 14:14:39 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
发表于 2009-2-16 12:09:15 | 显示全部楼层
厉害!!!
发表于 2009-2-21 01:31:36 | 显示全部楼层
thanks. it's really good.
发表于 2009-2-21 13:35:17 | 显示全部楼层
SCILAB开版以来第一好贴
发表于 2009-2-22 17:00:55 | 显示全部楼层
谢谢!
发表于 2009-2-23 14:07:53 | 显示全部楼层
看看!
发表于 2009-3-4 23:47:15 | 显示全部楼层
eetop
头像被屏蔽
发表于 2009-3-7 20:33:23 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
发表于 2009-3-10 12:32:50 | 显示全部楼层
thanks!!!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /1 下一条

小黑屋| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-3-29 09:14 , Processed in 0.051069 second(s), 9 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表