scilab/scicos: modeling and simulation of hybrid...

29
Scilab/Scicos: Modeling and Simulation of Hybrid Systems G. Sivakumar Indian Institute of Technology, Bombay Mumbai 400076, India [email protected] Outline Free/Open Source S/w (quick motivation) Scilab/Scicos Demos Overview of Scicos G. Sivakumar Indian Institute of Technology, Bombay Mumbai 400076, India [email protected] Scilab/Scicos: Modeling and Simulation of Hybrid Systems

Upload: others

Post on 23-Mar-2020

18 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Scilab/Scicos: Modeling and Simulation of Hybrid Systemsftp.feq.ufu.br/Luis_Claudio/EQ125/Híbrido_Scilab/siva... · 2007-10-11 · Scilab/Scicos: Modeling and Simulation of Hybrid

Scilab/Scicos: Modeling and Simulation of HybridSystems

G. SivakumarIndian Institute of Technology, Bombay

Mumbai 400076, [email protected]

Outline

Free/Open Source S/w (quick motivation)

Scilab/Scicos Demos

Overview of Scicos

G. Sivakumar Indian Institute of Technology, Bombay Mumbai 400076, India [email protected]

Scilab/Scicos: Modeling and Simulation of Hybrid Systems

Page 2: Scilab/Scicos: Modeling and Simulation of Hybrid Systemsftp.feq.ufu.br/Luis_Claudio/EQ125/Híbrido_Scilab/siva... · 2007-10-11 · Scilab/Scicos: Modeling and Simulation of Hybrid

OSS Software List

G. Sivakumar Indian Institute of Technology, Bombay Mumbai 400076, India [email protected]

Scilab/Scicos: Modeling and Simulation of Hybrid Systems

Page 3: Scilab/Scicos: Modeling and Simulation of Hybrid Systemsftp.feq.ufu.br/Luis_Claudio/EQ125/Híbrido_Scilab/siva... · 2007-10-11 · Scilab/Scicos: Modeling and Simulation of Hybrid

Scientific Method

Sharing data and results is the foundation!

Way of Genius

If I have seen further [than others] it is by standing on theshoulders of giants... Issac Newton

Results are accepted only if they can be replicated! (sharing)Open Access is a must!

G. Sivakumar Indian Institute of Technology, Bombay Mumbai 400076, India [email protected]

Scilab/Scicos: Modeling and Simulation of Hybrid Systems

Page 4: Scilab/Scicos: Modeling and Simulation of Hybrid Systemsftp.feq.ufu.br/Luis_Claudio/EQ125/Híbrido_Scilab/siva... · 2007-10-11 · Scilab/Scicos: Modeling and Simulation of Hybrid

Open Access Journals

G. Sivakumar Indian Institute of Technology, Bombay Mumbai 400076, India [email protected]

Scilab/Scicos: Modeling and Simulation of Hybrid Systems

Page 5: Scilab/Scicos: Modeling and Simulation of Hybrid Systemsftp.feq.ufu.br/Luis_Claudio/EQ125/Híbrido_Scilab/siva... · 2007-10-11 · Scilab/Scicos: Modeling and Simulation of Hybrid

What is open access publishing?

1 Free and unrestricted online access to the research literatureand databases

2 Users are licensed to download, print, copy, redistribute, anduse

3 Author retains copyright and the right to be acknowledged

4 Papers are deposited in a public database that allowssophisticated searches (such as PubMedCentral)

5 (Bethesda Principles, April 2003)

G. Sivakumar Indian Institute of Technology, Bombay Mumbai 400076, India [email protected]

Scilab/Scicos: Modeling and Simulation of Hybrid Systems

Page 6: Scilab/Scicos: Modeling and Simulation of Hybrid Systemsftp.feq.ufu.br/Luis_Claudio/EQ125/Híbrido_Scilab/siva... · 2007-10-11 · Scilab/Scicos: Modeling and Simulation of Hybrid

Free Software

http://fsf.org.in/ Richard M. Stallman

Free software

is a matter of freedom, not cost. It is a matter of liberty, not price.The word free in free software has a similar meaning as in freespeech, free people and free country ... Think of free software assoftware which is free of encumbrances, not necessarily free of cost.Think of it as swatantra software.

Degrees of Freedom

1 The freedom to run the program, for any purpose

2 The freedom to study how the program works, and adapt it to yourneeds

3 The freedom to redistribute copies so you can help your neighbor

4 The freedom to improve the program, and release yourimprovements to the public so that the whole community benefits

G. Sivakumar Indian Institute of Technology, Bombay Mumbai 400076, India [email protected]

Scilab/Scicos: Modeling and Simulation of Hybrid Systems

Page 7: Scilab/Scicos: Modeling and Simulation of Hybrid Systemsftp.feq.ufu.br/Luis_Claudio/EQ125/Híbrido_Scilab/siva... · 2007-10-11 · Scilab/Scicos: Modeling and Simulation of Hybrid

Free Software

http://fsf.org.in/ Richard M. Stallman

Free software

is a matter of freedom, not cost. It is a matter of liberty, not price.The word free in free software has a similar meaning as in freespeech, free people and free country ... Think of free software assoftware which is free of encumbrances, not necessarily free of cost.Think of it as swatantra software.

Degrees of Freedom

1 The freedom to run the program, for any purpose

2 The freedom to study how the program works, and adapt it to yourneeds

3 The freedom to redistribute copies so you can help your neighbor

4 The freedom to improve the program, and release yourimprovements to the public so that the whole community benefits

G. Sivakumar Indian Institute of Technology, Bombay Mumbai 400076, India [email protected]

Scilab/Scicos: Modeling and Simulation of Hybrid Systems

Page 8: Scilab/Scicos: Modeling and Simulation of Hybrid Systemsftp.feq.ufu.br/Luis_Claudio/EQ125/Híbrido_Scilab/siva... · 2007-10-11 · Scilab/Scicos: Modeling and Simulation of Hybrid

Free Software

http://fsf.org.in/ Richard M. Stallman

Free software

is a matter of freedom, not cost. It is a matter of liberty, not price.The word free in free software has a similar meaning as in freespeech, free people and free country ... Think of free software assoftware which is free of encumbrances, not necessarily free of cost.Think of it as swatantra software.

Degrees of Freedom

1 The freedom to run the program, for any purpose

2 The freedom to study how the program works, and adapt it to yourneeds

3 The freedom to redistribute copies so you can help your neighbor

4 The freedom to improve the program, and release yourimprovements to the public so that the whole community benefits

G. Sivakumar Indian Institute of Technology, Bombay Mumbai 400076, India [email protected]

Scilab/Scicos: Modeling and Simulation of Hybrid Systems

Page 9: Scilab/Scicos: Modeling and Simulation of Hybrid Systemsftp.feq.ufu.br/Luis_Claudio/EQ125/Híbrido_Scilab/siva... · 2007-10-11 · Scilab/Scicos: Modeling and Simulation of Hybrid

Free Software

http://fsf.org.in/ Richard M. Stallman

Free software

is a matter of freedom, not cost. It is a matter of liberty, not price.The word free in free software has a similar meaning as in freespeech, free people and free country ... Think of free software assoftware which is free of encumbrances, not necessarily free of cost.Think of it as swatantra software.

Degrees of Freedom

1 The freedom to run the program, for any purpose

2 The freedom to study how the program works, and adapt it to yourneeds

3 The freedom to redistribute copies so you can help your neighbor

4 The freedom to improve the program, and release yourimprovements to the public so that the whole community benefits

G. Sivakumar Indian Institute of Technology, Bombay Mumbai 400076, India [email protected]

Scilab/Scicos: Modeling and Simulation of Hybrid Systems

Page 10: Scilab/Scicos: Modeling and Simulation of Hybrid Systemsftp.feq.ufu.br/Luis_Claudio/EQ125/Híbrido_Scilab/siva... · 2007-10-11 · Scilab/Scicos: Modeling and Simulation of Hybrid

Open Source Definition

From http://www.opensource.org (Author: Bruce Perens)

1 Free Redistribution

2 Source Code

3 Derived Works

4 Integrity of The Author

5 No Discrimination Against Persons or Groups

6 Distribution of License

7 License Must Not Be Specific to a Product

8 License Must Not Restrict Other Software

9 License Must Be Technology-Neutral

G. Sivakumar Indian Institute of Technology, Bombay Mumbai 400076, India [email protected]

Scilab/Scicos: Modeling and Simulation of Hybrid Systems

Page 11: Scilab/Scicos: Modeling and Simulation of Hybrid Systemsftp.feq.ufu.br/Luis_Claudio/EQ125/Híbrido_Scilab/siva... · 2007-10-11 · Scilab/Scicos: Modeling and Simulation of Hybrid

Open Source Definition

From http://www.opensource.org (Author: Bruce Perens)

1 Free Redistribution

2 Source Code

3 Derived Works

4 Integrity of The Author

5 No Discrimination Against Persons or Groups

6 Distribution of License

7 License Must Not Be Specific to a Product

8 License Must Not Restrict Other Software

9 License Must Be Technology-Neutral

G. Sivakumar Indian Institute of Technology, Bombay Mumbai 400076, India [email protected]

Scilab/Scicos: Modeling and Simulation of Hybrid Systems

Page 12: Scilab/Scicos: Modeling and Simulation of Hybrid Systemsftp.feq.ufu.br/Luis_Claudio/EQ125/Híbrido_Scilab/siva... · 2007-10-11 · Scilab/Scicos: Modeling and Simulation of Hybrid

Open Source Definition

From http://www.opensource.org (Author: Bruce Perens)

1 Free Redistribution

2 Source Code

3 Derived Works

4 Integrity of The Author

5 No Discrimination Against Persons or Groups

6 Distribution of License

7 License Must Not Be Specific to a Product

8 License Must Not Restrict Other Software

9 License Must Be Technology-Neutral

G. Sivakumar Indian Institute of Technology, Bombay Mumbai 400076, India [email protected]

Scilab/Scicos: Modeling and Simulation of Hybrid Systems

Page 13: Scilab/Scicos: Modeling and Simulation of Hybrid Systemsftp.feq.ufu.br/Luis_Claudio/EQ125/Híbrido_Scilab/siva... · 2007-10-11 · Scilab/Scicos: Modeling and Simulation of Hybrid

Open Source Definition

From http://www.opensource.org (Author: Bruce Perens)

1 Free Redistribution

2 Source Code

3 Derived Works

4 Integrity of The Author

5 No Discrimination Against Persons or Groups

6 Distribution of License

7 License Must Not Be Specific to a Product

8 License Must Not Restrict Other Software

9 License Must Be Technology-Neutral

G. Sivakumar Indian Institute of Technology, Bombay Mumbai 400076, India [email protected]

Scilab/Scicos: Modeling and Simulation of Hybrid Systems

Page 14: Scilab/Scicos: Modeling and Simulation of Hybrid Systemsftp.feq.ufu.br/Luis_Claudio/EQ125/Híbrido_Scilab/siva... · 2007-10-11 · Scilab/Scicos: Modeling and Simulation of Hybrid

Open Source Definition

From http://www.opensource.org (Author: Bruce Perens)

1 Free Redistribution

2 Source Code

3 Derived Works

4 Integrity of The Author

5 No Discrimination Against Persons or Groups

6 Distribution of License

7 License Must Not Be Specific to a Product

8 License Must Not Restrict Other Software

9 License Must Be Technology-Neutral

G. Sivakumar Indian Institute of Technology, Bombay Mumbai 400076, India [email protected]

Scilab/Scicos: Modeling and Simulation of Hybrid Systems

Page 15: Scilab/Scicos: Modeling and Simulation of Hybrid Systemsftp.feq.ufu.br/Luis_Claudio/EQ125/Híbrido_Scilab/siva... · 2007-10-11 · Scilab/Scicos: Modeling and Simulation of Hybrid

Open Source Definition

From http://www.opensource.org (Author: Bruce Perens)

1 Free Redistribution

2 Source Code

3 Derived Works

4 Integrity of The Author

5 No Discrimination Against Persons or Groups

6 Distribution of License

7 License Must Not Be Specific to a Product

8 License Must Not Restrict Other Software

9 License Must Be Technology-Neutral

G. Sivakumar Indian Institute of Technology, Bombay Mumbai 400076, India [email protected]

Scilab/Scicos: Modeling and Simulation of Hybrid Systems

Page 16: Scilab/Scicos: Modeling and Simulation of Hybrid Systemsftp.feq.ufu.br/Luis_Claudio/EQ125/Híbrido_Scilab/siva... · 2007-10-11 · Scilab/Scicos: Modeling and Simulation of Hybrid

Open Source Definition

From http://www.opensource.org (Author: Bruce Perens)

1 Free Redistribution

2 Source Code

3 Derived Works

4 Integrity of The Author

5 No Discrimination Against Persons or Groups

6 Distribution of License

7 License Must Not Be Specific to a Product

8 License Must Not Restrict Other Software

9 License Must Be Technology-Neutral

G. Sivakumar Indian Institute of Technology, Bombay Mumbai 400076, India [email protected]

Scilab/Scicos: Modeling and Simulation of Hybrid Systems

Page 17: Scilab/Scicos: Modeling and Simulation of Hybrid Systemsftp.feq.ufu.br/Luis_Claudio/EQ125/Híbrido_Scilab/siva... · 2007-10-11 · Scilab/Scicos: Modeling and Simulation of Hybrid

Open Source Definition

From http://www.opensource.org (Author: Bruce Perens)

1 Free Redistribution

2 Source Code

3 Derived Works

4 Integrity of The Author

5 No Discrimination Against Persons or Groups

6 Distribution of License

7 License Must Not Be Specific to a Product

8 License Must Not Restrict Other Software

9 License Must Be Technology-Neutral

G. Sivakumar Indian Institute of Technology, Bombay Mumbai 400076, India [email protected]

Scilab/Scicos: Modeling and Simulation of Hybrid Systems

Page 18: Scilab/Scicos: Modeling and Simulation of Hybrid Systemsftp.feq.ufu.br/Luis_Claudio/EQ125/Híbrido_Scilab/siva... · 2007-10-11 · Scilab/Scicos: Modeling and Simulation of Hybrid

Open Source Definition

From http://www.opensource.org (Author: Bruce Perens)

1 Free Redistribution

2 Source Code

3 Derived Works

4 Integrity of The Author

5 No Discrimination Against Persons or Groups

6 Distribution of License

7 License Must Not Be Specific to a Product

8 License Must Not Restrict Other Software

9 License Must Be Technology-Neutral

G. Sivakumar Indian Institute of Technology, Bombay Mumbai 400076, India [email protected]

Scilab/Scicos: Modeling and Simulation of Hybrid Systems

Page 19: Scilab/Scicos: Modeling and Simulation of Hybrid Systemsftp.feq.ufu.br/Luis_Claudio/EQ125/Híbrido_Scilab/siva... · 2007-10-11 · Scilab/Scicos: Modeling and Simulation of Hybrid

Freeduc in Schools

What does it cost to produce?

How to distribute? (Postman: once in 3 months!)

What expertise does it need?

What innovation is needed for India?

Localization!

Relevant content.

Who can/will do this innovation?Compare with proprietary software!

G. Sivakumar Indian Institute of Technology, Bombay Mumbai 400076, India [email protected]

Scilab/Scicos: Modeling and Simulation of Hybrid Systems

Page 20: Scilab/Scicos: Modeling and Simulation of Hybrid Systemsftp.feq.ufu.br/Luis_Claudio/EQ125/Híbrido_Scilab/siva... · 2007-10-11 · Scilab/Scicos: Modeling and Simulation of Hybrid

SciLab vs Matlab

2-D and 3-D graphics, animation www.scilab.org

Linear algebra, sparse matrices

Polynomials and rational functions

Simulation: ODE solver (ODEPACK) and DAE solver (DASSL)

Scicos: a dynamic systems modeler and simulator

Classic and robust control, LMI optimization

Differentiable and non-differentiable optimization

Signal processing

Metanet: graphs and networks

Parallel Scilab using PVM

Statistics

Interface with Computer Algebra (Maple, MuPAD)

Which is better for student?

G. Sivakumar Indian Institute of Technology, Bombay Mumbai 400076, India [email protected]

Scilab/Scicos: Modeling and Simulation of Hybrid Systems

Page 21: Scilab/Scicos: Modeling and Simulation of Hybrid Systemsftp.feq.ufu.br/Luis_Claudio/EQ125/Híbrido_Scilab/siva... · 2007-10-11 · Scilab/Scicos: Modeling and Simulation of Hybrid

Other Educational Sector Examples

Linux Cluster (16 node) at IIT-Bombay

Most Value for money!Molecular modellingCircuit SimulationAerodynamics

Online Course Management

dotLRNMoodle

Not just for Science and Engineering

G. Sivakumar Indian Institute of Technology, Bombay Mumbai 400076, India [email protected]

Scilab/Scicos: Modeling and Simulation of Hybrid Systems

Page 22: Scilab/Scicos: Modeling and Simulation of Hybrid Systemsftp.feq.ufu.br/Luis_Claudio/EQ125/Híbrido_Scilab/siva... · 2007-10-11 · Scilab/Scicos: Modeling and Simulation of Hybrid

FOSS for India

G. Sivakumar Indian Institute of Technology, Bombay Mumbai 400076, India [email protected]

Scilab/Scicos: Modeling and Simulation of Hybrid Systems

Page 23: Scilab/Scicos: Modeling and Simulation of Hybrid Systemsftp.feq.ufu.br/Luis_Claudio/EQ125/Híbrido_Scilab/siva... · 2007-10-11 · Scilab/Scicos: Modeling and Simulation of Hybrid

Cost of FOSS

There is no Free Lunch! What is the tradeoff?Skilled Human Resources versus Money!Which one does India have in abundance?Which one should we bet on?

G. Sivakumar Indian Institute of Technology, Bombay Mumbai 400076, India [email protected]

Scilab/Scicos: Modeling and Simulation of Hybrid Systems

Page 24: Scilab/Scicos: Modeling and Simulation of Hybrid Systemsftp.feq.ufu.br/Luis_Claudio/EQ125/Híbrido_Scilab/siva... · 2007-10-11 · Scilab/Scicos: Modeling and Simulation of Hybrid

Scilab (www.scilab.org)

Developed at INRIA (since 1990).

Powerful environment for scientfic and engineeringapplications

Freely distributed in source code format.

Scilab’s distinct parts

An interpreter

Libraries of functions (Scilab procedures)

Libraries of Fortran and C routines.

Powerful matrix operations

Open programming environment for creation of functions andlibraries by user

G. Sivakumar Indian Institute of Technology, Bombay Mumbai 400076, India [email protected]

Scilab/Scicos: Modeling and Simulation of Hybrid Systems

Page 25: Scilab/Scicos: Modeling and Simulation of Hybrid Systemsftp.feq.ufu.br/Luis_Claudio/EQ125/Híbrido_Scilab/siva... · 2007-10-11 · Scilab/Scicos: Modeling and Simulation of Hybrid

SciLab Demo

We’ll see Scilab’s built-in Demos

Polynomials

Matrices

Plotting

Graphics (plot2d, plot3d, param3d, hist3d)

All source available (we’ll inspect some of them)

G. Sivakumar Indian Institute of Technology, Bombay Mumbai 400076, India [email protected]

Scilab/Scicos: Modeling and Simulation of Hybrid Systems

Page 26: Scilab/Scicos: Modeling and Simulation of Hybrid Systemsftp.feq.ufu.br/Luis_Claudio/EQ125/Híbrido_Scilab/siva... · 2007-10-11 · Scilab/Scicos: Modeling and Simulation of Hybrid

Scicos (www.scicos.org)

Scicos is a Scilab toolbox with

A user-friendly GUI based editor for modeling hybriddynamical systems

Hierarchical block diagram structure

A large number of standard blocks available in various palettes

Possibility of defining new blocks using C, Fortran (dynamiclink) or Scilab Language

Diagram compilation and fast simulation

G. Sivakumar Indian Institute of Technology, Bombay Mumbai 400076, India [email protected]

Scilab/Scicos: Modeling and Simulation of Hybrid Systems

Page 27: Scilab/Scicos: Modeling and Simulation of Hybrid Systemsftp.feq.ufu.br/Luis_Claudio/EQ125/Híbrido_Scilab/siva... · 2007-10-11 · Scilab/Scicos: Modeling and Simulation of Hybrid

Simple Scicos Demo

Let us build the following example

and learn the basics.

G. Sivakumar Indian Institute of Technology, Bombay Mumbai 400076, India [email protected]

Scilab/Scicos: Modeling and Simulation of Hybrid Systems

Page 28: Scilab/Scicos: Modeling and Simulation of Hybrid Systemsftp.feq.ufu.br/Luis_Claudio/EQ125/Híbrido_Scilab/siva... · 2007-10-11 · Scilab/Scicos: Modeling and Simulation of Hybrid

Events/Clocks in Scicos

From the Scicos Presentation let us look at

Activation Links

MultiFrequency Activation

SubSampling (if-then-else)

Event Driven Activation (Inheritance)

Continuous Time

Continuous Time Events (Zero-crossing)

G. Sivakumar Indian Institute of Technology, Bombay Mumbai 400076, India [email protected]

Scilab/Scicos: Modeling and Simulation of Hybrid Systems

Page 29: Scilab/Scicos: Modeling and Simulation of Hybrid Systemsftp.feq.ufu.br/Luis_Claudio/EQ125/Híbrido_Scilab/siva... · 2007-10-11 · Scilab/Scicos: Modeling and Simulation of Hybrid

Constructing your own Blocks

Pulse Generator Example from Scicos Presentation

G. Sivakumar Indian Institute of Technology, Bombay Mumbai 400076, India [email protected]

Scilab/Scicos: Modeling and Simulation of Hybrid Systems