简介
ScicosLab is a free open-source software package for scientific computation. It includes a Scilab interpreter and hundreds of general purpose and specialized functions for numerical computation, organized in libraries called toolboxes, which cover such areas as simulation, optimization, systems and control, and signal processing. One important ScicosLab toolbox is Scicos. Scicos provides a block diagram graphical editor for the construction and simulation of dynamical systems. 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. The book is based on the new ScicosLab 4.4. While the book will provide useful information to experienced users it is designed to be accessible to beginning users from a variety of disciplines. Students and academic and industrial scientists and engineers should find it useful. 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, exporting data and interfacing external routines. It also covers in detail the numerical solvers for ordinary differential equations and differential-algebraic equations available in ScicosLab. Even though the emphasis is placed on modeling and simulation applications, this part provides a global view of the Scilab language. The second part is dedicated to modeling and simulation of dynamical systems in Scicos. 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. All codes used in the book are made available to the reader. This book is an updated and expanded version of an earlier edition based on Scilab 3.1. Stephen L. Campbell is a professor of mathematics and director of graduate programs at North Carolina State University, a fellow of the IEEE, and has published extensively on numerical methods and control. Jean-Philippe Chancelier is affiliated with CERMICS Ecole Nationale des Ponts et Chaussees and is one of the original developers of Scilab. Ramine Nikoukhah is a director of research at INRIA (The French National Institute for Research in Computer Science and Control), senior member of IEEE, one of the original developers of Scilab, and is the creator of Scicos.
目录
Preface 4
Contents 6
Part I Scilab 11
General Information 12
What Is Scilab? 12
How to Start? 13
Installation 13
First Steps 13
Line Editor 14
Documentation 15
Typical Usage 15
ScicosLab on the Web 16
Introduction to Scilab 17
Scilab Objects 19
Matrix Construction and Manipulation 20
Strings 25
Boolean Matrices 27
Polynomial Matrices 28
Sparse Matrices 29
Lists 30
Functions 34
Scilab Programming 35
Branching 36
Iterations 37
Scilab Functions 39
Debugging Programs 43
Input and Output Functions 45
Display of Variables 45
Formatted Input and Output 46
Input Output in Binary Mode 49
Accessing the Host System 50
Graphical User Interface 51
Scilab Graphics 56
Basic Graphing 56
Graphic Tour 58
Graphics Objects 61
Scilab Graphics and LaTeX 64
Old Graphics Style 68
Interfacing 71
Linking Code 71
Writing an Interface 74
Dynamic Loading 77
Modeling and Simulation in Scilab 80
Types of Models 80
Ordinary Differential Equations 80
Boundary Value Problems 81
Difference Equations 82
Differential Algebraic Equations 83
Hybrid Systems 84
Simulation Tools 85
Ordinary Differential Equations 85
Boundary Value Problems 97
Difference Equations 102
Differential Algebraic Equations 105
Hybrid Systems 108
Optimization 114
Comments on Optimization and Solving Nonlinear Equations 114
General Optimization 115
Solving Nonlinear Equations 119
Nonlinear Least Squares 120
Parameter Fitting 124
Linear and Quadratic Programming 126
Linear Programs 126
Quadratic Programs 127
Semidefinite Programs 127
Differentiation Utilities 127
Higher Derivatives 129
Examples 131
Modeling and Simulation of an N-Link Pendulum 131
Equations of Motion of the N-Link Pendulum 132
Generated Code and Simulation 136
Maple Code 139
Modeling and Simulation of a Car 141
Basic Model 141
Equations of Motion 142
Simulation Model 144
Scilab Implementation 145
Simulation Result 147
Open-Loop Control to Swing Up a Pendulum 148
Model 148
Control Problem Formulation 148
Optimization Problem 149
Implementation in Scilab 151
Parameter Fitting and Implicit Models 153
Mathematical Model 154
Scilab Implementation 154
Part II Scicos 162
Introduction 163
Getting Started 166
Construction of a Simple Diagram 166
Running Scicos 166
Editing a Model 166
Diagram Simulation 169
Changing Block Parameters 170
Symbolic Parameters and Context 173
Virtual blocks and Hierarchy 176
Placing a Super Block in a Diagram 177
Editing a Super Block 177
Scope of Variables in Super Block Contexts and Masking 179
Save and Load Operations 181
Scicos File Formats 181
Super Block and Palette 181
Synchronism and Special Blocks 182
Scicos Formalism 185
Activation Signal 185
Block Activation 185
Activation Generation 187
Inheritance 188
Always Active Blocks 189
Constant Blocks 190
Conditional Blocks 190
Scicos Blocks 195
Block Behavior 195
External Activation 195
Always Activation 198
Internal Zero-Crossing 198
Blocks Inside Palettes 198
Modifying Block Parameters 199
Super Block and Scifunc 199
Super Blocks 200
Scifunc 200
Constructing New Basic Blocks 200
Interfacing Function 201
Computational Function 203
Saving New Blocks 218
Constructing and Loading a New Palette 218
Examples and Applications 220
Academic examples 220
Predator Prey Model 220
Control Application 223
Signal Processing Application 224
Queuing Systems 227
Neuroscience Application 229
A Fluid Model of TCP-Like Behavior 231
Interactive GUI 232
Applications 236
Batch Processing in Scilab 240
Piloting Scicos via Scilab Commands 240
Function scicosim 241
Function scicos_simulate 245
Data Sharing 247
Context Variables 247
Input/Output Files 247
Special blocks: From Workspace and To Workspace 250
Steady-State Solution and Linearization 256
Scilab Function steadycos 258
Scilab Function lincos 259
Code Generation 263
Code Generation Procedure 263
Limitations 267
Continuous-Time Activation 267
Synchronicism 268
A Look Inside 268
Some Pitfalls 270
Applications 273
Debugging 276
Error Messages 276
Block Errors 276
Errors During Numerical Integration 277
Other Errors 278
Debugging Tools 278
Examples 279
Log File 280
Animation 280
Implicit Scicos and Modelica 282
Introduction 282
Internally Implicit Blocks 284
Implicit Blocks 285
Scicos Editor 285
Scicos Compiler 285
Block Construction 286
Example 288
Scicos Block MBlock 289
Initialization 291
Example 292
Inside Scicos 296
Scicos Editor 296
Main Editor Function 296
Structure of scs_m 299
Scicos Complier 302
First Compilation Stage 302
Second Compilation Stage 303
Structure of %cpr 303
Partial Compilation 306
Scicos Simulator 307
Coding Examples 308
Scicos Blocks of Type 5 308
Type 5 Block for the Bouncing Ball Example 308
Animation Block for the Cart Pendulum Example 309
Animation Program for the Car Example 313
Extraction Program for the LaTeX Graphic Example 314
Maple Code Used for Modeling the N-Link Pendulum 315
References 319
Index 322
Contents 6
Part I Scilab 11
General Information 12
What Is Scilab? 12
How to Start? 13
Installation 13
First Steps 13
Line Editor 14
Documentation 15
Typical Usage 15
ScicosLab on the Web 16
Introduction to Scilab 17
Scilab Objects 19
Matrix Construction and Manipulation 20
Strings 25
Boolean Matrices 27
Polynomial Matrices 28
Sparse Matrices 29
Lists 30
Functions 34
Scilab Programming 35
Branching 36
Iterations 37
Scilab Functions 39
Debugging Programs 43
Input and Output Functions 45
Display of Variables 45
Formatted Input and Output 46
Input Output in Binary Mode 49
Accessing the Host System 50
Graphical User Interface 51
Scilab Graphics 56
Basic Graphing 56
Graphic Tour 58
Graphics Objects 61
Scilab Graphics and LaTeX 64
Old Graphics Style 68
Interfacing 71
Linking Code 71
Writing an Interface 74
Dynamic Loading 77
Modeling and Simulation in Scilab 80
Types of Models 80
Ordinary Differential Equations 80
Boundary Value Problems 81
Difference Equations 82
Differential Algebraic Equations 83
Hybrid Systems 84
Simulation Tools 85
Ordinary Differential Equations 85
Boundary Value Problems 97
Difference Equations 102
Differential Algebraic Equations 105
Hybrid Systems 108
Optimization 114
Comments on Optimization and Solving Nonlinear Equations 114
General Optimization 115
Solving Nonlinear Equations 119
Nonlinear Least Squares 120
Parameter Fitting 124
Linear and Quadratic Programming 126
Linear Programs 126
Quadratic Programs 127
Semidefinite Programs 127
Differentiation Utilities 127
Higher Derivatives 129
Examples 131
Modeling and Simulation of an N-Link Pendulum 131
Equations of Motion of the N-Link Pendulum 132
Generated Code and Simulation 136
Maple Code 139
Modeling and Simulation of a Car 141
Basic Model 141
Equations of Motion 142
Simulation Model 144
Scilab Implementation 145
Simulation Result 147
Open-Loop Control to Swing Up a Pendulum 148
Model 148
Control Problem Formulation 148
Optimization Problem 149
Implementation in Scilab 151
Parameter Fitting and Implicit Models 153
Mathematical Model 154
Scilab Implementation 154
Part II Scicos 162
Introduction 163
Getting Started 166
Construction of a Simple Diagram 166
Running Scicos 166
Editing a Model 166
Diagram Simulation 169
Changing Block Parameters 170
Symbolic Parameters and Context 173
Virtual blocks and Hierarchy 176
Placing a Super Block in a Diagram 177
Editing a Super Block 177
Scope of Variables in Super Block Contexts and Masking 179
Save and Load Operations 181
Scicos File Formats 181
Super Block and Palette 181
Synchronism and Special Blocks 182
Scicos Formalism 185
Activation Signal 185
Block Activation 185
Activation Generation 187
Inheritance 188
Always Active Blocks 189
Constant Blocks 190
Conditional Blocks 190
Scicos Blocks 195
Block Behavior 195
External Activation 195
Always Activation 198
Internal Zero-Crossing 198
Blocks Inside Palettes 198
Modifying Block Parameters 199
Super Block and Scifunc 199
Super Blocks 200
Scifunc 200
Constructing New Basic Blocks 200
Interfacing Function 201
Computational Function 203
Saving New Blocks 218
Constructing and Loading a New Palette 218
Examples and Applications 220
Academic examples 220
Predator Prey Model 220
Control Application 223
Signal Processing Application 224
Queuing Systems 227
Neuroscience Application 229
A Fluid Model of TCP-Like Behavior 231
Interactive GUI 232
Applications 236
Batch Processing in Scilab 240
Piloting Scicos via Scilab Commands 240
Function scicosim 241
Function scicos_simulate 245
Data Sharing 247
Context Variables 247
Input/Output Files 247
Special blocks: From Workspace and To Workspace 250
Steady-State Solution and Linearization 256
Scilab Function steadycos 258
Scilab Function lincos 259
Code Generation 263
Code Generation Procedure 263
Limitations 267
Continuous-Time Activation 267
Synchronicism 268
A Look Inside 268
Some Pitfalls 270
Applications 273
Debugging 276
Error Messages 276
Block Errors 276
Errors During Numerical Integration 277
Other Errors 278
Debugging Tools 278
Examples 279
Log File 280
Animation 280
Implicit Scicos and Modelica 282
Introduction 282
Internally Implicit Blocks 284
Implicit Blocks 285
Scicos Editor 285
Scicos Compiler 285
Block Construction 286
Example 288
Scicos Block MBlock 289
Initialization 291
Example 292
Inside Scicos 296
Scicos Editor 296
Main Editor Function 296
Structure of scs_m 299
Scicos Complier 302
First Compilation Stage 302
Second Compilation Stage 303
Structure of %cpr 303
Partial Compilation 306
Scicos Simulator 307
Coding Examples 308
Scicos Blocks of Type 5 308
Type 5 Block for the Bouncing Ball Example 308
Animation Block for the Cart Pendulum Example 309
Animation Program for the Car Example 313
Extraction Program for the LaTeX Graphic Example 314
Maple Code Used for Modeling the N-Link Pendulum 315
References 319
Index 322
- 名称
- 类型
- 大小
光盘服务联系方式: 020-38250260 客服QQ:4006604884
云图客服:
用户发送的提问,这种方式就需要有位在线客服来回答用户的问题,这种 就属于对话式的,问题是这种提问是否需要用户登录才能提问
Video Player
×
Audio Player
×
pdf Player
×