// begin data scalar m1 = 20[kg]; scalar m2 = 80[kg]; scalar mu = 0.01[s/m]; scalar v0 = 1[m/s]; scalar t1 = 2[s]; scalar f = 0.1[s/m]; scalar g = 10[m/s2]; scalar N = (m1+m2)*g; scalar Nload = m1*g; // points point pointzero = ( 0[m], 0[m], 0[m] ); point c1 = ( 0[m], 0.1[m], 0[m] ); point c2 = ( 3[m], 0[m], 0[m] ); point left = point( 0 [ m ], 0 [ m ], 0 [ m ] ); point right = point( 6 [ m ], 0 [ m ], 0 [ m ] ); // vectors vector rox = reverse( projectX ); // surfaces solid ld = sphere( c1, 0.1 [ m ] ); plane pl = planePV( c2, projectY ); line gorizont = polyLine( list( left, right ) ); // gravity vector vectorgrav = reverse( projectY ); gravity gravity = parallel( vectorgrav, g = g ); // bodies body load = body( color = RGB( 229, 229, 229 ) ); body plate = body( color = RGB( 255, 153, 153 ) ); body floor = body( color = RGB( 255, 255, 153 ) ); // v0 //condition condition = sensorValue( vloadsensor, v0 ); condition vload = transVelocity( floor, projectX, load, c1, v0 ); // functions function FunctionFtrload(v[m/s])=m1*g*f*#v; //function FunctionFtrplate(vplatesensor[m/s])=(m1+m2)*g*mu*#vplatesensor; //function functionG(aplate[m/s2])=#aplate*m2; // sensors sensor vloadsensor = transVelocity( floor, projectX, load, c1 ); //sensor vplatesensor = velocity( c2 ); //sensor aplate = componentAcceleration( c2, projectX ); //sensor tau = sensorDelay( time, t1 ); //actuator actuatorplate_floor = forcePP( plate, c2, floor, pointzero ); // forces/* vloadsensor*/ force Ftrload = force( load, c1, rox, FunctionFtrload, list( vloadsensor ) ); //force Ftrplate = force( plate, c2, projectX, FunctionFtrplate, list( vplatesensor ) ); //force forceplate = force( plate, c2, rox, functionG, list( aplate ) ); // action //event v = reformsBySensor( list( forcesOn( list( Ftrload ) ) ), time, 0 [ s ], timer = timerOn: ); //reform myreform = forcesOn( list( forceplate ) ); //event myevent = reformsBySensor( list( myreform ), tau, 0 [ s ] ); // result //sensor G = -aplate*m2+FunctionFtrplate(vplatesensor); /\/////////////////////////////////////////////////////////////////////////////////// /\ Прикрепление объектов body load < (c1, ld ); body plate < (pl, c2 ); body floor < (gorizont ); /\/////////////////////////////////////////////////////////////////////////////////// /\ Инерциальное звено; set ground = floor; /\/////////////////////////////////////////////////////////////////////////////////// /\ Единицы измерения; set units = SI;