Scicos (Scilab Connected Object Simulator) is a  Scilab package  for modeling and simulation of dynamical systems which include both continuous and discrete sub-systems. Scicos has a friendly GUI for editing models by interconnecting scicos blocks. Scicos blocks can be found in Scicos palettes or be defined by the user.

Typically, constructing a simple new Scicos diagram consists of

The above does not include the use of more advanced features such as Super block construction, new basic block definition, etc..., nor does it contain cosmetic operations such as icon editing, coloring or resizing of blocks in the diagram. These features will be discussed later.


Session 1

Below, we present, step by step, a simple Scicos session in which we construct a Scicos diagram and do a simulation.


Start Scicos
    For that you should type in Scilab main window.

--> scicos();

This opens up Scicos' main window with an empty diagram (to load an existing diagram, the name of the file containing the diagram should be used as argument). This window remains open during the entire Scicos session. 



Empty Scicos diagram (by default named Untitled)


Open the Inputs/Outputs and Linear palettes
    To open a palette, select  Palettes  in the Edit  menu and select the palette name among the proposed choices.

A palette contains a set of Scicos blocks. These blocks can be copied into the Scicos window to be used for constructing the Scicos diagram. These palettes cannot be edited in this context. For editing a palette, the palette should be loaded as a Scicos diagram.  More on that later. 



The Inputs_Outputs palette


Copy from the palettes: a sinusoid generator, a Scope, an Event generator and a Gain
    To copy a block, select Copy  in the Edit menu. The editor is then in copy mode and copies can be made by first clicking on the block to be copied and then where the copy is to be placed.

The Event generator generates a train of regularly spaced events in time. These events, available as an activation signal on the output activation port of the block, will be used to activate the scope (specifying the instants when the scope displays the value of its input) through its input activation port. Input and output activation ports are placed respectively on top and at the bottom of blocks; regular input and output ports are placed on the sides.

Block positions can be fine tuned, so that the input and output ports (to be connected) are aligned, using the Align in the Edit menu.

The result should look like the following 



Scicos diagram after copying the blocks

Link the blocks together
    To enter the link mode, select Link  in the Edit menu. A link can be created by clicking  on the output port and then on the input port (or intermediary points before that if a non straight line connection is desired).

To make a link originate  from another link (to split a link), it suffices to first click on the existing link, where split is to be placed, and then on an input port (or intermediary points before that). The process of link creation can be stopped and current link deleted by clicking on the right mouse button.

Note that links associated with activation signals are, by default, red, and links associated with regular signals, black. These default colors can be changed using Default Link Color in the Misc menu.

Once all the input and output ports are connected, the Scicos diagram is complete and can be simulated. However, before that, block parameters should be changed if needed.



Change block parameter of the Gain block; set the gain to 8
    To change block parameters, click on the block after selecting Open/Set in the Object menu. This opens a dialog menu which can be used to modify block parameters. These parameters can be defined using valid Scilab expressions. These expressions are memorized symbolically, and then evaluated.

After this changes, and cosmetic changes such as changing block colors, background color, 3D aspect, etc..., the result should look something like the following: 



Diagram is now complete

Simulate the diagram
    This is done by selecting Run in the Simulate menu. This opens a the scope in Scilab Graphic window number 1 (this 1 is one of scope parameters). The simulation can be stopped by clicking on the stop button on top of Scicos' main window.

Simulation result

Rename the diagram and save it
    This is done either by selecting Rename in the Diagram menu, followed by Save in the same menu, or directly by Save As.

Scicos diagrams are saved in files which have the same name as the diagram plus an extension .cos or .cosf. For example if the name of the diagram is Untitled, the save operation creates a binary file Untitled.cos. It is also possible to save Scicos diagram in ASCII format; the extension is .cosf in that case. The advantage of ASCII format is that it is machine independent but it is much slower to generate.

To load a diagram, use Load in the Diagram menu. If you are outside Scicos, simply launch the Scicos command with the name of the file to be loaded as argument. Example:

--> scicos('Untitled.cos');


How does the help work

To get help on a block, select help in the Misc menu and click on the block.
To get help on an item in a menu, select help in the Misc menu and then select the item.

Unfortunately all the blocks and menu items are not documented at this time.



How to edit a palette

A palette is just like any other Scicos diagram; in fact any diagram can be loaded as palette using the Load as Palette item in the Diagram menu. To make Scicos recognize a new palette you should add the name of the file that contains it to the  scicos_pal  vector in Scilab. For example this variable can be defined at startup in your .scilab file. This is done automatically when you use the item Save as Palette in the Diagram.



Congratulation, you have now completed session 1.
Do want to move to Session 2?
 
 Yes, I am ready for Session 2  No, I want to go back


For more information about Scicos, send an e-mail to Doctor Scilab: Scilab@inria.fr


 

For suggestions about this Web server, send an e-mail to Scilab@inria.fr