Frequently asked questions about Scicos
This is a list of frequently asked questions (FAQ) for Scicos users.
General questions regarding the
Software:
What is Scicos?
Who develops Scicos?
Is Scicos free software?
Does Scicos work on my computer?
How do I install ScicosLab?
What is the latest version of Scicos?
Is there any documentation available on Scicos?
Does Scicos assure backward compatibility?
Can Scicos read diagrams made in other tools such as
Dymola or Simulink?
Scicos Editor:
The old Scicos editor had many
limitations and its behavior was not similar to other graphical
editors. Why was that?
Has the stability of the Scicos editor been improved?
What language is the Scicos editor programmed in?
I have used Scicos in the past. The new editor seems
to have changed a
great deal in the latest version. Is there anything in particular that
I should be aware of?
While editing a Scicos diagram, I would like to use
Scilab once in a
while to do some computations or load a function for use in Scicos. Is
this possible?
Is there a way to avoid drawing connection links
between blocks; this
is particularly cumbersome when a link connects two blocks situated in
two distant subsystems?
How do I export the picture of a Scicos diagram for
inclusion in a Latex or Word document?
The widget to pick a file for the Open and SaveAs operations
under Windows is no longer the standard Windows widget, why? How do I open a
file on a device or on another disk?
The keyboard shortcuts do not always function under
Xwindow. Why?
Scicos Compiler and Formalism:
Has the compiler been improved in
Scicos 4.2?
Is it possible to construct a new block in Scicos?
I have written many Simulink S-Functions, is it easy
to adapt them for use in Scicos?
Scicos diagrams mix implicit Modelica based blocks
with standard
explicit C/Scilab based blocks. How does the compiler handle this
co-existence?
For very large diagrams containing sub-sampling
operations, the
compilation time can become long. Is there a problem with the algorithm
used in the Scicos compiler?
Having explicit control over activation signals in
Scicos is a very
nice feature for specifying, without ambiguity, the synchronous and
asynchronous behaviors of the model. But sometimes, specially when all
the discrete-time clocks are synchronous, it is more convenient to just
give the frequency and the phase of each clock and let the system take
care of synchronization. Is this possible in Scicos?
What does the compiler take as input and what does
it generate?
In some situations, the compilation takes a lot less
time than others, why?
Scicos Simulator:
What numerical solvers are used in
Scicos?
Is it possible to interface additional numerical
solvers with Scicos simulator?
At the end of a simulation, scope contents are erased
for a short
period of time and redrawn. Why? This was not happening in older
versions of Scicos.
Is it possible to make the final simulation time
depend on a formal
parameter (a parameter defined in the context of the diagram)?
Code Generator:
What is the code generator?
Can code generation be used for any Super Block?
Can Scicos generate standalone code for any Super
Block?
Modelica extension:
When is the Modelica compiler used in
Scicos?
Which Modelica compiler is used in Scicos?
I cannot run models with Modelica components, I get
an error message about "nmake" not being available. Why?
I have a Modelica code describing the dynamics of a
block, what is the
easiest way to use it in Scicos? Can I avoid writing an interfacing
function?
General questions regarding the
Software:
Q: What is
Scicos?
A: Scicos is a modeling,
simulation and code generation tool for hybrid dynamical systems. In
many respects, Scicos is similar to programs such as Matlab/Simulink,
SystemBuild and Dymola. Scicos is a ScicosLab toolbox.
Q: Who develops
Scicos?
A: Scicos is developed by
the Scicos Team under the direction of its creator Ramine Nikoukhah.
The Scicos team is part of the Metalau Research Project at INRIA in
France. But Scicos, as a free software, also benefits from
contributions from all over the world.
Q: Is Scicos
free software?
A: Scicos 4.2 and 4.2.1 were distributed under
both the Scilab 4 license and GPL in order to be included in both Scilab 4 and
Scilab 5. Scicos 4.4 is only made available in ScicosLab, a fork of Scilab 4,
so Scicos 4.4 is only distributed under the Scilab 4 license. Under this
license, Scicos can be used freely in commercial and non-commercial
applications as long as a modified version is not distributed under a different
license. See the license.txt file included in the package for more details.
Q: Does Scicos
work on my computer?
A: ScicosLab runs on
Windows and most Linux and Mac operating systems.
Q: How do I
install ScicosLab?
A: Download the latest
release of Scilab from http://www.scicoslab.org and visit regularly our
web site http://www.scicos.org for unstable releases.
Q: What is the
latest version of Scicos?
A: Scicos 4.4 is the
latest version. This version is distributed with ScicosLab 4.4.
Q: Is there any
documentation available on Scicos?
A: Yes, the software
itself is well documented and more information can be found on
http://www.scicos.org.
Q: Does Scicos
assure backward compatibility?
A: Yes, when loading an
old diagram, Scicos translates it into the new format. The incremental
translation mechanism allows you to load even very old Scicos diagrams
but the translation time can be long. Make sure you save the diagram
after translation to avoid having to go through the translation process
again.
Q:
Can Scicos read diagrams made in
other tools such as Dymola or Simulink?
A: No. The current
version of Scicos contains a very basic Modelica compiler. This means
that only very simple models constructed in Dymola can be read in
Scicos. The work is in progress however to develop a full Modelica
compiler leading to full compatibility with Dymola and other tools
based on Modelica. As for Simulink, even though Scicos can be used to
construct most diagrams modeled in Simulink in a very similar fashion,
the underlying formalism of Scicos is different. Scicos is inspired by
synchronous languages such as Signal and in particular their extension
to continuous-time dynamics. It is perceivable to have at some point
inter-operability between Scicos and Simulink, but no such a project is
currently considered by the Scicos team.
Scicos Editor:
Q: The old
Scicos editor had many limitations and its behavior was not similar to
other graphical editors. Why was that?
A: For a long time, no
work had been done to improve the Scicos editor. But a lot of effort
has been put into this editor recently, making the latest version of
the Scicos editor comparable to that of similar tools. There are of
course some limitations stemming from Scilab graphics limitations and
bugs. A simple mouse press for example is not detected immediately in
Scilab; a timer is used systematically for detecting potential
double-clicks. This slows down a bit the system's response (this
problem does not exist on the Scilab GTK version). A number of
important events are simply not detected by Scilab, such as window
resizing or window iconification. Some events are lost when switching
windows and some captured erroneously. Finally some important
functionalities such as inhibiting a window closure is not present. We
have written a lot of code to (hopefully successfully) circumvent these
problems.
Q: Has the
stability of the Scicos editor been improved?
A: Yes. All the menu
calls are now protected via the usage of Scilab exec functions with
'errcatch' option. Unfortunately these Scilab functions are fragile
(bugs reported but not corrected yet), that is why their protection is
not 100% effective. To get around this problem, we have added
additional layers of protection, which overall should provide a lot of
stability. Just beware of the menu "icon_editor". This functionality
has not been fully tested and may crash Scilab. If you want to use it,
it is recommended to save a copy of your diagram beforehand.
Q: What
language is the Scicos editor programmed in?
A: Except for some GUIs
written in TCL/TK, the Scicos editor is written entirely in Scilab
language. The editor windows are standard Scilab graphical windows and
diagrams are drawn using scilab's new graphics library instructions.
Using Scilab as a programming language may seem an odd choice however
it provides a flexible environment for developing new functionalities
in Scicos. The limitations are mainly the absence of structures in the
Scilab language (contrary to what its name suggests, a "list" in Scilab
is just a record). This slows down the manipulation and in particular
the compilation of very large diagrams. However for most applications,
this is not an issue.
Q: I have used
Scicos in the past. The new editor seems to have changed a great deal
in the latest version. Is there anything in particular that I should be
aware of?
A: The behavior of the
new Scicos editor has pretty much the standard Windows look and feel
now. We have tried to keep the old functionalities as much as possible,
but there are a few points you should look for.
- In the old editor, to start a link off another link (i.e. to
create a split) a simple click on the split point was used. In the new
editor a click is used to select an object (in this case the link), to
create a split you should double-click on the split point, or as in the
old editor, use a keyboard shortcut (the default is "l").
- In the old editor, only one editor window was active at a
time. In the new editor, multiple windows containing different
subsystems of the model can be simultaneously open and active. However,
when copying a block from a palette using drag and drop, the block can
only be placed in the subsystem window having the focus. This
limitation will be lifted in the future. Note that it can be placed
anywhere with the copy and paste operation.
- The Navigator function has been replaced with the Browser.
- The Save As Interfacing function is maintained, however the
new editor proposes a more powerful mechanism for creating new
Interfacing Functions. See the Masking operation.
- If you run out of space when constructing your model, you can
increase the size of the canvas by doing a Replot (default keyboard
shortcut is "r"). If you don't want a bigger space but smaller blocks,
try ZoomIn (shortcut "-"). And don't forget, you can use hierarchy
(Super Blocks) to avoid diagrams with too many blocks.
- You should remove the files .scicos_pal and .scicos_short if
they have been created by the old Scicos editor. Scicos will create new
ones if needed.
Q: While
editing a Scicos diagram, I would like to use Scilab once in a while to
do some computations or load a function for use in Scicos. Is this
possible?
A: In the old editor the
only way to activate Scilab prompt was using the "Calc" menu. This menu
activates Scilab shell in the debug level. Scilab computations can be
preformed there but the results, along with any loaded functions, would
be lost upon returning to Scicos. In the new editor, it is possible to
go back and forth between Scilab and Scicos. In Scicos, simply use the
"Activate Scilab Window" menu. To return to Scicos, simply click on any
Scicos window (or simply type "scicos;" on Scilab prompt). Note that
this feature is particularly useful for taking advantage of the
"From/To Workspace" blocks.
Q: Is there a
way to avoid drawing connection links between blocks; this is
particularly cumbersome when a link connects two blocks situated in two
distant subsystems?
A: Yes, you can use
"From" and "Goto" blocks.
Q: How do I
export the picture of a Scicos diagram for inclusion in a Latex or Word
document?
A: You can directly
export any Scicos diagram in PostScript format, but you can also export
it to a standard Scilab graphics window and export it from there in
various formats supported by Scilab.
Q: The widget to pick a file for the Open and SaveAs operations
under Windows is no longer the standard Windows widget, why? How do I open a
file on a device or on another disk?
A: Scilab function xgetfile and
tk_savefile crash Scilab under Windows. This happens rarely but if it does, the
user would lose his/her Scicos diagram. That is why we have decided to use a
less convivial tk widget instead. To switch to a device, say D, simply type in
"D:" followed by carriage return.
Q: The keyboard shortcuts do not always function under
Xwindow. Why?
A: This is an old Scilab bug:
when the Num_lock is engaged, the keyboard events are not captured by
Scilab. Disengage the Num_lock or compile Scilab with the gtk2 option.
Scicos Compiler and Formalism:
Q: Has the
compiler been improved in Scicos 4.2?
A: Besides being able to
handle very general data types (various integer data types, matrices,
complex type), the main compiler routine, responsible for the
computation of the scheduling tables, has been re-written.
Q: Is it
possible to construct a new block in Scicos?
A: Of course. A new
block can be a masked sub-model, or can be written completely from
scratch in C or in Scilab language. With some limitations, a new block
can also be constructed using Modelica language.
Q: I have
written many Simulink S-Functions, is it easy to adapt them for use in
Scicos?
A: Yes. In most cases an
S-Function, with little changes, can be used as the simulation function
of a new Scicos block.
Q: Scicos
diagrams mix implicit Modelica based blocks with standard explicit
C/Scilab based blocks. How does the compiler handle this co-existence?
A: If the model contains
implicit (Modelica based) blocks, Scicos puts them together and
generates a single Modelica program. The built-in Modelica compiler
then generates a C code, which is compiled and linked with Scicos. This
code becomes the simulation function of a new Scicos block replacing
all the implicit blocks. From there on, the compilation proceeds just
as for any standard Scicos diagram. All of these steps are of course
completely transparent for the user.
Q: For very
large diagrams containing sub-sampling operations, the compilation time
can become long. Is there a problem with the algorithm used in the
Scicos compiler?
A: The problem is not the
algorithm. The algorithm is written for the large part in Scilab. The
compilation time can be drastically reduced if the algorithm is coded
in C. This will be considered if the compilation time becomes a real
issue.
Q: Having
explicit control over activation signals in Scicos is a very nice
feature for specifying, without ambiguity, the synchronous and
asynchronous behaviors of the model. But sometimes, specially when all
the discrete-time clocks are synchronous, it is more convenient to just
give the frequency and the phase of each clock and let the system take
care of synchronization. Is this possible in Scicos?
A: Yes, see SampleClock
blocks introduced in Scicos 4.2.
Q: What does
the compiler take as input and what does it generate?
A: The Scilab structure
"scs_m" contains a full description of the diagram. The compiler takes
this structure and generates another Scilab structure "%cpr" that
contains the scheduling tables and other information needed by the
simulator.
Q: In some
situations, the compilation takes a lot less time than others, why?
A: There are different
levels of compilation in Scicos. Depending on the type of change made
in the diagram, Scicos can initiate a full compilation or choose among
different levels of partial recompilation options. Note also that if a
diagram is saved in ".cos" format after being compiled, the compilation
result "%cpr" is also saved. So upon re_opening, no compilation is
needed.
Scicos Simulator:
Q: What
numerical solvers are used in Scicos?
A: Up to version 4.2,
Scicos has used LSODAR and DASKR. But now it uses the SUNDIALS solvers
CVODE and IDA.
Q: Is it
possible to interface additional numerical solvers with Scicos
simulator?
A: It is possible but it
is not easy. The numerical solver must have proper zero-crossing
mechanisms. It is not recommended to undertake such a work without
collaboration with the Scicos team.
Q: At the end
of a simulation, scope contents are erased for a short period of time
and redrawn. Why? This was not happening in older versions of Scicos.
A: Since version 4.2, Scicos uses the
new Scilab graphics library. At the end of the simulation, the segments
drawn during the simulation are replaced with a single polyline for
each curve. This way, the curve can conveniently be edited with
Scilab's graphical editor.
Q: Is it
possible to make the final simulation time depend on a formal parameter
(a parameter defined in the context of the diagram)?
A: Yes, you can use the
END block (Others Palette). Note that this block is different from the
PAUSE block in that END really ends the simulation whereas PAUSE merely
stops the simulation, which can subsequently be continued.
Scicos Code Generator:
Q: What is the
code generator?
A: The code generator is
a Scicos functionality that generates a C code from the content of a
Super Block. The C code is used as the simulation function of a new
basic block which replaces automatically the Super Block for validating
the correctness of the generated code. The necessary supporting files
are also generated so that the code can be used as a standalone
application. The code generator functions both under Windows and
Linux/Unix operating systems.
Q: Can code
generation be used for any Super Block?
A: It can for most Super
Blocks. The only restriction is that the blocks inside the Super Block
should not generate asychronous events. As for continuous-time
dynamics, only explicit blocks are allowed and for standalone
applications, the generated code contains fixed-step solvers.
Q: Can Scicos
generate standalone code for any Super Block?
A: Many restrictions present
previous versions have been lifted in Scicos 4.4. It is now possible to
generate code for almost any Super Block.
Modelica extension:
Q: When is the
Modelica compiler used in Scicos?
A: Scicos does not use
Modelica as long as the diagram contains only standard Scicos blocks,
i.e., blocks with explicit inputs and outputs. Modelica is used to
model implicit blocks used for component based modeling. Such blocks
have ports which are not labeled a priori as input or output. They
allow in particular the modeling of electrical or mechanical components.
Q: Which
Modelica compiler is used in Scicos?
A: modelicac is a free
open source compiler developed in the framework of the RNTL Simpa
project. This compiler, which covers only very partially the features
of the Modelica language, is replaced by a more complete compiler,
developed in the Simpa2 project by LMS-Imagine.
Q: I cannot run
models with Modelica components, I get an error message about "nmake"
not being available. Why?
A: Modelica compiler
generates C code that has to be compiled. Under the Windows operating
system, you need to have the Visual C++ or the free Visual Express
compiler installed on your computer.
Q: I have a
Modelica code describing the dynamics of a block, what is the easiest
way to use it in Scicos? Can I avoid writing an interfacing function?
A: Yes, you can use the
Modelica Generic block in the Others palette.