Welcome Guest ( Log In | Register )

 Bouncing problem (Modelica in Scilab/Scicos implementation)
 Daniel_Nitecki Feb 28 2009, 03:38 PM Post #1 Newbie Group: Members Posts: 1 Joined: 28-February 09 Member No.: 31,842 Hi,I'm another newbie in Modelica In general my problem is connected with demo "bouncing ball", which is implemented in Scilab's help.I use Modelica language in Scicos's MBLOCK element.Attachment contains a picture that describes the model: I can't attach a .cos file, because of some forum's problem, so I did a print screen Variables for "From workspace" blocks can be generated like this:CODEk=struct('values',=10*ones(100+1,1),'time',[0:100]');v_koncowe=struct('values',12.81*ones(100+1,1),'time',[0:100]');masa_wozka=struct('values',10*ones(100+1,1),'time',[0:100]');dlugosc_toru=struct('values',37.61*ones(100+1,1),'time',[0:100]');punkt_zwolnienia=struct('values',12.19*ones(100+1,1),'time',[0:100]');max_dlugosc_hamowania=struct('values',(2.5+37.61)*ones(100+1,1),'time',[0:100]');Here is the model in Modelica block:CODEclass zderzenie      //input variables      Real k,v_koncowe,masa_wozka,dl_toru,punkt_zwolnienia;      //output variables      Real x,v,a;equation    der(x)=v;der(v)=a;a =    if (x<=punkt_zwolnienia and v>=0) then (v_koncowe*v_koncowe)/(2*punkt_zwolnienia)    else if (x>dl_toru) then -k*(x-dl_toru)/masa_wozka    else if (x<=punkt_zwolnienia and v<0) then 0    else 0;when x

1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 Lo-Fi Version Time is now: 21st January 2020 - 04:36 PM