

From the point the view of acquisition, SCILAB is a free software through the licence CeCIILL (CEA CNRS INRIA Logiciel Libre). Mainly, the idea of materialization of such a work has come out of necessity of programs usage that imply low purchase costs. Also some remarks, concerning the software’s efficiency and an economic analysis efficiency-cost of the two software, are presented in this study which have an identical use/purpose. #include #include #include #include #include #define length 5 #define g 9.The study presents a comparison between a graphic simulation of a slider crank mechanism developed both in Matlab and Scilab environments. LOCATE( SUB(xc,y1), SUB( yc, x1) ), PRNL( Pen ) LOCATE( ADD(xc,y1), SUB( yc, x1) ), PRN( Pen )

LOCATE( SUB(xc,y1), ADD( yc, x1) ), PRN( Pen ) LOCATE( ADD(xc,y1), ADD( yc, x1) ), PRN( Pen ) LOCATE( SUB(xc,x1), SUB( yc, y1) ), PRN( Pen ) LOCATE( ADD(xc,x1), SUB( yc, y1) ), PRN( Pen ) LOCATE( SUB(xc,x1), ADD( yc, y1) ), PRN( Pen ) LOCATE( ADD(xc,x1), ADD( yc, y1) ), PRN( Pen ) STOR( DIV(dx, paso) DIV(dy, paso), dx, dy ) LOCATE (2, 55) PRNL("Press any key to quit")īACK-IF ( NOT( KEY-PRESSED? ), Animate All ) LET( speed := ADD( speed, DIV(accel, 100) ) ) LET( accel := MUL(g, SIN(theta) DIV-INTO(l) DIV-INTO(4) ) )

SET( theta, M_PI_2 ) // pi/2 constant -> flow.h Velocity * Float_Type ( Time ) end Update_Pendulum end Pendulums Velocity + Acceleration * Float_Type ( Time ) Item. Y end Get_Y procedure Update_Pendulum ( Item : in out Pendulum Time : in Duration ) is Acceleration : constant Float_Type := Gravitation / Item. X end Get_X function Get_Y ( From : Pendulum ) return Float_Type is begin return From. Velocity := 0.0 return Result end New_Pendulum function Get_X ( From : Pendulum ) return Float_Type is begin return From. With _Elementary_Functions package body Pendulums is package Math is new _Elementary_Functions (Float_Type ) function New_Pendulum ( Length : Float_Type Theta0 : Float_Type ) return Pendulum is Result : Pendulum begin Result. X and Y are relative positions of the pendulum to the anchor.
#Scilab animation update
If you want, you can replace the output method with graphical update methods. This does not use a GUI, it simply animates the pendulum and prints out the positions.
