Xcos Simulation Help
Hello scilab/ xcos pros,
I recently started learning about xcos, starting with the basics of graphical simulations. So far most of the examples have been a breeze except for this current example of the video linked below. I am stuck on the first part on the single ( input/0utput of the scope) from 0 min to about 8min mark. I have coded the cubeit function example and it compiles correctly in scilab. I have also made all the necessary parameters adjustments and yet I am getting an error in my attempt to produce a simulation. The graph display pops up but nothing displays. I don't know where to even start the troubleshoot.
Just for context I have a bit of coding background especially in wxmaxima, and as well as some basic knowledge of matlab and some of its other varients i.e. octave, scilab, freemat etc...
Here's the video link: https://youtu.be/K9DC-dNWuNE?si=IvmCL8VLNk83y36r
Also for those of you who have mastered xcos, is there any good sources of materials that you can recommend to make the deep learning of xcos easier? Thanks in advance!
Hello and welcome to Scilabâs Discourse !
Can you save and post here your Xcos diagram (*.zcos
file), as well as the script defining the cubeit
function ?
S.
1 Like
Hello Mottelet
Find attached all the info you requested. Hope it helps in solving this little road block.
cubeit.sci (46 Bytes) ===> scilab script
cubeit.zcos (2.9 KB) ====> xcos script
Scilab is case sensitive, in cubeit.sci
function y = cubeit(p)
y = P^3;
endfunction
p should be lowercase (or uppercase) everywhere, here you mixed both.
S.
1 Like
Thank you Mottelet. It worked! I can not believe this small error was giving me such a headache. I need to be more attentive to my codes from now on. I appreciate you.
P/S
To the last part of my question, is there any materials you can recommend for a deeper dive in xcos simulation? so far most tutorials I am seeing on YouTube (before getting stuck) are pretty basic form of simulation. My long term goal is build enough skills to be able to dive deeper into more advanced domain of real time system simulationsâŠ
I think that the error could have been seen by leaving the mouse cursor above the blinking triangular panel with the exclamation mark. Concerning resources about Xcos there are at least two books : Scicos > Book: Modeling and Simulation in Scilab/Scicos
https://www.researchgate.net/publication/343472236_Introduction_to_Xcos_A_Scilab_Tool_for_Modeling_Dynamical_Systems
1 Like
ah I see. Thanks.
I appreciate the book recommendation! 
Wow! This is one is really good
. Plenty of graphical examples and a walk through of the platform showing where different blocks are located. Perfect and concise introductory material for an xcos noobie such as myself (
). I appreciate you for this.
Mathematically speaking, the second equation on the book cover has no sense. Considering the system which is considered, and the depicted implementation, it should be written
\ddot y = -k\dot y, \mbox{ for }y\leq 0.
Moreover, the proposed implementation is questionable, because the in/then/else block checks the condition only at clock tics, hence the resulting trajectory depends on the clock period. You can check (use the diagram bounce.zcos
below) that actual value of simulated y is negative when âbouncingâ, and worse, that extending the simulation time shows a non convergence of y (there is a slow linear drift towards negative values).
I am sorry to say that, but such books are not thoroughly reviewed.
Bookâs bouncing ball diagram: bounce.zcos (3.6 KB)
There are better implementations, see e.g. the Xcos/Modelica demos/Bouncing ball demo.
S.
1 Like
The second link I provided gives free access to the book content on researchgate.net (donât buy it on AmazonâŠ).
S.
Hi Stéphane
I am interested in a full link to the book on researchgate.
With kind regards,
Claus
Well, didnât I already gave it above ?
1 Like
Hi Stéphane
My apology. I see it now. Either your post âsneakedâ in front of my own post, or the post was modified later to include the link to researchgate.
With kind regards,
Claus
Good to know. Thanks. I already seen the searchgate link on my own search from the title that was provided. The searchgate link unfortunately is a complete txt. I think It only has 100pages of about 400pages total of the material. Still not bad though. Just getting a guide of where things (tool blocks) are located and and descriptions of what they do is a great start. From then Its just a matter of getting down and practice practice and practice!
Hello Claus,
Youâre right the pdf stops at page 80 !
S.