You are on page 1of 31

ISTE Workshop on

Scilab : Open source Tools for


Electrical Engineers

By
M.Sujith,
Associate Professor/ EEE,
IFET College of Engineering
Introduction
SCILAB is a freely distributed and open source scientific
software package
A powerful open computing environment for Engineering
and Scientific applications
Developed since 1990 by researchers from INRIA 2
(Institut Nationale de Recherche en Informatique et en
Automatique) and ENPC (National School of Bridges and
Roads).
Now maintained and developed by Scilab consortium
since 2003.
Integrated into Digiteo foundation in July 2008
Scilabs Main Features
A high-level programming language
Scilab is an interpreted language
Integarated object-oriented 2-D and 3-D graphics
with animation
A dedicated Editor
An XML-based help system
Interface with symbolic computing packages (Maple
and MuPAD 3.0)
An interface with Tcl/Tk
Scilab works with most Unix systems
Getting Started with Scilab

Stating the Scilab program


Start the Scilab program by double-clicking
Scilab-5.2.2 icon on the desktop
Automatically loading
Tools for managing files, variables and
applications
Quitting the Scilab program
To end SCILAB, File > quit in the scilab console
Type quit in the Scilab Console
The user enters commands at the prompt ---->
Scilab help
Help Features
Help Browser
help command (help inv, help optim)
Scilab Editor
When several commands are to be executed, it may be more
convenient to write these statements into a file with Scilab editor.
To execute the commands located in such a file, the exec function can
be used, followed by the name of the script. This file generally has
the extension .sce or .sci, depending on its content:
Files having the .sci extension are containing Scilab functions and
executing them loads the functions into Scilab environment (but does
not execute them),
Files having the .sce extension are containing both Scilab
functions and executable statements.
Executing a .sce file has generally an effect such as computing
several variables and displaying the results in the console, creating
2D plots, reading or writing into a file, etc...
Our first script (Sce-file)
Display Comment in Scilab Editor
Plotting in Scilab

Scilab can produce many types of 2D and 3D plots.


The following is a short list of several common charts
that Scilab can create:

x-y plots: plot,


contour plots: contour,
3D plots: surf,
histograms: histplot,
bar charts: bar, etc
Scilab functions used when creating a plot.

In order to get an example of a 3D plot, we can simply type


the statement surf() in the Scilab console
Programming Using Scilab Editor for
Plotting Chart
Simple XY Plot
Simple XY Plot- The x-y plot of a quadratic function
Simple XY Plot- The x-y plot of a quadratic function
1
Basic plot We plot the function y on the interval [-5,5]
1 x 2
Multiple Plot in single window
Change the origin of Axis
set(gca(),"data_bounds",matrix([-2,6,-0.1,1.1],2,-1));
3D Plot
XCOS Model
Scilab Xcos Model
Xcos is Scilab Tool dedicated to the modeling and
simulation Of hybrid dynamic systems Including
both continuous and discrete models
XCOS can be launched:
From the tool bar icon or
From menu bar, in application/xcos
From the consoler, in typing: xcos
XCOS
Xcos opens by default with two windows:
A Palette browser which provides a set of predefined blocks
An editing window which is the working space to design daigrams
How to draw a continuous time system represented by a first
order system
Set Simulation Parameters
Set Simulation Context in the menu bar and define the
following variables by k=1, Tau=1
Set values in CLR Block
How to convert the sub diagram in in to single block?

Select the region of blocks for converting in to single block by using


option in edit menu Superblocks

You might also like