Scilab/xcos versions of Simulink models used in control theory teaching

August 21st, 2014 | Categories: control theory, Free software, math software, simulink | Tags:

I currently work at The University of Manchester in the UK as a ‘Scientific Applications Support Specialist’. In recent years, I have noticed a steady increase in the use of open source software for both teaching and research – something that I regard as a Good Thing.

Even though Manchester has, what I believe is, a world-class site licensed software portfolio, researchers, lecturers and students often prefer open source solutions for all sorts of reasons. For example, researchers at Manchester can use MATLAB while they are associated with the University but their right to do so ceases as soon as they leave. If all of your research code is in the form of MATLAB and Simulink models, you had better hope that your next employer or school has the requisite licenses.

This summer, a few people in the Control Systems Centre of Manchester’s Electrical and Electronic Engineering department asked the question ‘Is it possible to implement all of the simple MATLAB/Simulink examples we use in a second year undergraduate introduction to Control Theory using free software?’ In particular, they chose the programs Scilab and Xcos.

Since the aim of this course is to teach control theory principles rather than any particular software solution, it would ideally be software agnostic. Students aren’t asked to develop models, they are just asked to play with pre-packaged models in order to improve their understanding of the material.

Student intern Danail Stoychev was tasked with attempting to port all of the examples from the course and in fairly short order he determined that the answer to their question was a resounding ‘Yes’.

For example, the model below is an example of feedback with a first order transfer function and a delay.  First in Simulink:

Simulink version 1st order transfer function with delay

and now in xcos

xcos version 1st order transfer function with delay

Part of the exercise set for the students is to define all of the relevant parameters in the workspace: b,a,k and so on. If you attempt to download and run the above, you’ll have to do that in order to make them work. You’ll also need extract and plot the results from the workspace.

It can be seen that the two models look very similar and, for these examples at least, it really doesn’t matter which piece of software the students use.

The full set of MATLAB/Simulink examples along with Danail’s Scilab/Xcos conversions can be found at http://personalpages.manchester.ac.uk/staff/William.Heath/matlab_scilab.html

  1. March 20th, 2015 at 10:11
    Reply | Quote | #1

    Thumbs up to William Heath and co. I’m relatively new to Scilab/Xcos and have had a taste of Openmodelica. Openmodelica, Wolfram’s SystemModeler, and Scilab’s Xcos(limitedly) are based on modelica. This I suppose should make universities consider using Modelica more actively and/or as an alternative/backup to the applicable commercial products. Do students have the option to use alternative applications for their final projects/dissertation?

    Once the Matlab program launches, if it’s on a student license, you may see a notification that reminds one that a student license cannot be used for research or commercial purposes. Such a downer sometimes, but that’s what was paid for. Why it’s a downer sometimes is that there’s a thin line between research and learning for the formal student. Research is necessarily learning. When an assignment needs proper research to answer?

    Pardon the argument. We do know what they mean with the students license.

    Scilab is a very welcome development, and I think more educational institutions should promote it’s use and code porting from software that have restrictive licenses. It’s simply the smart thing to do, for the students, staff, and eventually industry. Having a format you could always access and manipulate irrespective of any software licenses is good backup sense, to say the least.

    If institutions drive ‘worthy’ applications like Scilab, Openmodelica, Octave etc, and engage in research that make them fully competitive with the commercial alternatives, there might come a time when we wouldn’t need Matlab and co.

    Is that really possible since a few commercial applications dominate the industries we’re concerned about. And I guess with good reason. As businesses serious about their products, they shouldn’t just stand by and watch free/opensource software take market from them. Also, we’d certainly want our graduates to have industry relevant software skills, so those site licenses et al would be with us for, well, a long while.

    Maybe when working knowledge of free/opensource software becomes directly industry relevant, not just welcome as a transferable skill, the status quo may change for universities.

  2. April 15th, 2015 at 08:54
    Reply | Quote | #2

    Is it possible to create a model in Scilab finite state machine? This resource description is, and no examples. http://help.scilab.org/docs/5.5.2/ru_RU/AUTOMAT.htm for Example, to create a state machine for switching on/off of the light bulb. Dmitry.