Skip to:Content
|
Bottom
Cover image for Modeling and simulation in Scilab/Scicos
Title:
Modeling and simulation in Scilab/Scicos
Publication Information:
New York, NY : Springer, 2006
ISBN:
9780387278025

Available:*

Library
Item Barcode
Call Number
Material Type
Item Category 1
Status
Searching...
30000010093319 Q183.9 C35 2006 Open Access Book Book
Searching...

On Order

Summary

Summary

Scilab 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, which cover such areas as simulation, optimization, systems and control, and signal processing. One important Scilab 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. While it 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 Scilab numerical solvers for ordinary differential equations and differential-algebraic equations. this part provides a global view of Scilab. 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 is made available to the reader. Stephen L. Campbell is a professor of mathematics and a director of graduate programs at North Carolina State University, having written over 185 scientific publications and authored numerous books. 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.


Table of Contents

Part I Scilab
1 General Informationp. 3
1.1 What Is Scilab?p. 3
1.2 How to Start?p. 4
1.2.1 Installationp. 4
1.2.2 First Stepsp. 4
1.2.3 Line Editorp. 5
1.2.4 Documentationp. 6
1.3 Typical Usagep. 6
1.4 Scilab on the Webp. 7
2 Introduction to Scilabp. 9
2.1 Scilab Objectsp. 11
2.1.1 Matrix Construction and Manipulationp. 12
2.1.2 Stringsp. 17
2.1.3 Boolean Matricesp. 19
2.1.4 Polynomial Matricesp. 20
2.1.5 Sparse Matricesp. 21
2.1.6 Listsp. 22
2.1.7 Functionsp. 26
2.2 Scilab Programmingp. 27
2.2.1 Branchingp. 28
2.2.2 Iterationsp. 29
2.2.3 Scilab Functionsp. 31
2.2.4 Debugging Programsp. 35
2.3 Input and Output Functionsp. 37
2.3.1 Display of Variablesp. 37
2.3.2 Formatted Input and Outputp. 38
2.3.3 Input Output in Binary Modep. 40
2.3.4 Accessing the Host Systemp. 42
2.3.5 Graphical User Interfacep. 43
2.4 Scilab Graphicsp. 48
2.4.1 Basic Graphingp. 48
2.4.2 Graphic Tourp. 49
2.4.3 Graphics Objectsp. 53
2.4.4 Scilab Graphics and MpXp. 56
2.4.5 Old Graphics Stylep. 60
2.5 Interfacingp. 62
2.5.1 Linking Codep. 63
2.5.2 Writing an Interfacep. 66
2.5.3 Dynamic Loadingp. 69
3 Modeling and Simulation in Scilabp. 73
3.1 Types of Modelsp. 73
3.1.1 Ordinary Differential Equationsp. 73
3.1.2 Boundary Value Problemsp. 74
3.1.3 Difference Equationsp. 75
3.1.4 Differential Algebraic Equationsp. 76
3.1.5 Hybrid Systemsp. 77
3.2 Simulation Toolsp. 78
3.2.1 Ordinary Differential Equationsp. 78
3.2.2 Boundary Value Problemsp. 90
3.2.3 Difference Equationsp. 95
3.2.4 Differential Algebraic Equationsp. 98
3.2.5 Hybrid Systemsp. 100
4 Optimizationp. 107
4.1 Comments on Optimization and Solving Nonlinear Equationsp. 107
4.2 General Optimizationp. 108
4.3 Solving Nonlinear Equationsp. 112
4.4 Nonlinear Least Squaresp. 113
4.5 Parameter Fittingp. 117
4.6 Linear and Quadratic Programmingp. 119
4.6.1 Linear Programsp. 119
4.6.2 Quadratic Programsp. 120
4.6.3 Semidefinite Programsp. 120
4.7 Differentiation Utilitiesp. 120
4.7.1 Higher Derivativesp. 122
5 Examplesp. 125
5.1 Modeling and Simulation of an V-Link Pendulump. 125
5.1.1 Equations of Motion of the V-Link Pendulump. 126
5.1.2 Generated Code and Simulationp. 130
5.1.3 Maple Codep. 133
5.2 Modeling and Simulation of a Carp. 135
5.2.1 Basic Modelp. 135
5.2.2 Equations of Motionp. 136
5.2.3 Simulation Modelp. 138
5.2.4 Scilab Implementationp. 139
5.2.5 Simulation Resultp. 141
5.3 Open-Loop Control to Swing Up a Pendulump. 142
5.3.1 Modelp. 142
5.3.2 Control Problem Formulationp. 142
5.3.3 Optimization Problemp. 143
5.3.4 Implementation in Scilabp. 145
5.4 Parameter Fitting and Implicit Modelsp. 147
5.4.1 Mathematical Modelp. 148
5.4.2 Scilab Implementationp. 148
Part II Scicos
6 Introductionp. 159
7 Getting Startedp. 163
7.1 Construction of a Simple Diagramp. 163
7.1.1 Running Scicosp. 163
7.1.2 Editing a Modelp. 163
7.1.3 Diagram Simulationp. 165
7.1.4 Changing Block Parametersp. 166
7.2 Symbolic Parameters and Contextp. 169
7.3 Hierarchyp. 173
7.3.1 Placing a Super Block in a Diagramp. 173
7.3.2 Editing a Super Blockp. 174
7.4 Save and Loadp. 175
7.4.1 Scicos File Formatsp. 175
7.4.2 Super Block and Palettep. 176
7.5 Synchronism and Special Blocksp. 176
8 Scicos Formalismp. 179
8.1 Activation Signalp. 179
8.1.1 Block Activationp. 179
8.1.2 Activation Generationp. 181
8.2 Inheritancep. 182
8.3 Always Active Blocksp. 183
8.4 Constant Blocksp. 184
8.5 Conditional Blocksp. 184
9 Scicos Blocksp. 189
9.1 Block Behaviorp. 189
9.1.1 External Activationp. 189
9.1.2 Always Activationp. 191
9.1.3 Internal Zero-Crossingp. 192
9.2 Blocks Inside Palettesp. 192
9.3 Modifying Block Parametersp. 193
9.4 Super Block and Scifuncp. 193
9.4.1 Super Blocksp. 193
9.4.2 Scifuncp. 194
9.5 Constructing New Basic Blocksp. 194
9.5.1 Interfacing Functionp. 195
9.5.2 Computational Functionp. 197
9.5.3 Saving New Blocksp. 207
9.6 Constructing and Loading a New Palettep. 207
10 Examplesp. 209
10.1 Predator Prey Modelp. 209
10.2 Control Applicationp. 210
10.3 Signal Processing Applicationp. 213
10.4 Queuing Systemsp. 216
10.5 Neuroscience Applicationp. 218
10.6 A Fluid Model of TCP-Like Behaviorp. 220
10.7 Interactive GUIp. 221
11 Batch Processing in Scilabp. 227
11.1 Piloting Scicos via Scilab Commandsp. 227
11.1.1 Function scicosimp. 228
11.1.2 Function scicos_simulatep. 232
11.2 Data Sharingp. 233
11.2.1 Context Variablesp. 234
11.2.2 Input/Output Filesp. 234
11.2.3 Global Variablesp. 236
11.3 Examplesp. 237
11.4 Steady-State Solution and Linearizationp. 243
11.4.1 Scilab Function steadycosp. 247
11.4.2 Scilab Function lincosp. 248
12 Code Generationp. 253
12.1 Code Generation Procedurep. 253
12.2 Limitationsp. 257
12.2.1 Continuous-Time Activationp. 257
12.2.2 Synchronicismp. 258
12.3 A Look Insidep. 258
12.4 Some Pitfallsp. 260
12.5 Applicationsp. 263
13 Debuggingp. 267
13.1 Error Messagesp. 267
13.1.1 Block Errorsp. 267
13.1.2 Errors During Numerical Integrationp. 268
13.1.3 Other Errorsp. 269
13.2 Debugging Toolsp. 269
13.3 Examplesp. 270
13.3.1 Log Filep. 271
13.3.2 Animationp. 271
14 Implicit Scicos and Modelicap. 273
14.1 Introductionp. 273
14.2 Internally Implicit Blocksp. 275
14.3 Implicit Blocksp. 275
14.3.1 Scicos Editorp. 276
14.3.2 Scicos Compilerp. 276
14.3.3 Block Constructionp. 276
14.4 Examplep. 277
A Inside Scicosp. 281
A.1 Scicos Editorp. 281
A.1.1 Main Editor Functionp. 281
A.1.2 Structure of scs_mp. 283
A.2 Scicos Complierp. 286
A.2.1 First Compilation Stagep. 286
A.2.2 Second Compilation Stagep. 287
A.2.3 Structure of %cprp. 287
A.2.4 Partial Compilationp. 290
A.3 Scicos Simulatorp. 291
B Scicos Blocks of Type 5p. 293
B.1 Type 5 Block for the Bouncing Ball Examplep. 293
B.2 Animation Block for the Cart Pendulum Examplep. 294
C Animation Program for the Car Examplep. 299
D Extraction Program for the LATEX Graphic Examplep. 301
E Maple Code Used for Modeling the N-Link Pendulump. 303
Referencesp. 307
Indexp. 309
Go to:Top of Page