Introduction to XCOS
XCOS is a tool in Scilab that is used to model and simulate dynamic systems that is similar to Simulink in MATLAB. XCOS can be used for both continuous time and discrete time models. XCOS allows us to represent models in the form of blocks and block diagrams rather than those frustrating lengthy equations and hence making it simpler to understand.
In this introductory tutorial on XCOS, we shall learn how to develop systems in XCOS by using a simple example.
To open XCOS, we just type xcos in the console or head to the top left and click on the region shown.
When you open XCOS, you are greeted with the following two windows.
The one to the left is called the palette browser which is a library of all the set of predefined blocks and the one to the right is called the editing window which is the main working area where we design the block diagrams and create system models.
To get started with designing the systems, click on the blocks you want to use and drag them to the editing window. Once all the needed blocks are present in the editing window, connect them using their different ports in a desired manner.
We shall understand this basic procedure with a simple example. Here we shall use the step function (STEP_FUNCTION) as the source and an oscilloscope (CSCOPE) as the sink. In between the source and sink, we shall use a simple transfer function block (Don’t bother much about the transfer function for now. Just consider it as blackbox that is used to represent a certain system). We shall also use a clock(CLOCK_c) to time the oscilloscope.
Use the search box in the palette browser to find the required blocks. In order to connect these blocks, move the cursor near the ports and it will automatically guide you to connect. Input and output ports are indicated by the direction of the ports on the blocks. If the direction of the port is inwards, then it’s an input port and if the direction of the port is outwards, it’s an output. The parameter and properties of the block can be changed by double clicking on that particular block. Once we have finished connecting, click on the run button on the top. Simple!. Isn’t it? The output is seen as shown below.
Let’s not scratch our head in understanding the above response in this tutorial. We will keep it for some other day.
This is sufficient for one to try and get his/her hand dirty with Scilab and XCOS. Download the free copy and try out the things by taking different examples.
In this tutorial, we learnt how the XCOS environment looks like, how to build block diagrams of systems and then simulate it. In the upcoming tutorials, we shall use the basics we gained in this and the previous tutorial and understand how Scilab and XCOS makes our lives much more easier as electrical engineers. We shall also learn about more features of Scilab and XCOS as and when required.
Get the latest tools and tutorials, fresh from the toaster.