// begin data for stick scalar m = 1 [kg ]; scalar g = 9.81 [m/s2]; scalar pA = 0.433012701 [m]; scalar pC = 0.21650635 [m]; point pointA = point( 0[ m ], pA, 0[m] ); point pointB = point( 0.25 [m], 0[m], 0[m] ); point pointC = point( 0.125 [ m ], pC, 0 [ m ] ); solid stick = cylinder( pointA, pointB, 0.002 [ m ], mass = m ); // data for inertbody - angle point pointup = point( 0 [ m ], 2 [ m ], 0 [ m ] ); point pointzero = point( 0 [ m ], 0 [ m ], 0 [ m ] ); point pointright = point( 2 [ m ], 0 [ m ], 0 [ m ] ); line angle = polyLine( list( pointup, pointzero, pointright ) ); line gorizont = polyLine( list( pointzero, pointright ) ); //bodies body distriction = body( color = RGB( 229, 229, 229 ) ); body body1 = body( color = RGB( 229, 229, 229 ) ); // vectors of angle phi vector vector1 = vectorPP( pointB, pointA ); vector vector2 = reverse( projectX ); // researched sensors sensor Vx = rotVelocity( body1, projectX, distriction ); sensor Vy = rotVelocity( body1, projectY, distriction ); sensor Wx = rotAcceleration( body1, projectX, distriction ); sensor Wy = rotAcceleration( body1, projectY, distriction ); sensor phi = angleVV( vector1, vector2 ); // functions for forces of stick function valN1(phi[rad])=m*g*sin(#phi)*cos(#phi); function valN2(phi[rad])=m*g*cos(#phi)*cos(#phi); // forces force N1 = force( body1, pointB, projectX, valN1, list( phi ) ); force N2 = force( body1, pointC, reverse( projectY ), valN2, list( phi ) ); // down joint (stick-floor) joint joint1 = contactPointLine( pointB, gorizont ); scalar epstime = 0.25[s]; // the moment of department stick of wall event myevent = reformsBySensor( list( stop( ) ), time, epstime ); // (not used) /* scalar phi0 = 1.57 []; vector vector10 = vectorPP( pointBs, pointAs ); vector vector20 = reverse( projectX ); point pointAs = point( 0[ m ], pA, 0[m] ); point pointBs = point( 0.25 [m], 0[m], 0[m] ); sensorValue(sensorphi,eps) -> stop(); actuator beginactivator = forcePP( body1, pointC, distriction, pointzero ); motion beginmotion=forcesOn(list(N1,N2)); reform beginreform = motionsOn(list(beginmotion)); event myevent = intervalSwitch(forcesOn(list(N1,N2)), stop(), sensorphi, phi0, 0, eps); event v = reformsBySensor( list( forcesOn( list( Ftrload ) ) ), time, 0 [ s ], timer = timerOn: ); phi<=eps->event myevent = reformsBySensor( list( stop( ) ), sensorphi, phi ); */ /\/////////////////////////////////////////////////////////////////////////////////// /\ Прикрепление объектов body distriction < (gorizont, pointzero, pointright ); body body1 < (stick, pointA, pointB, pointC ); /\/////////////////////////////////////////////////////////////////////////////////// /\ Инерциальное звено; set ground = distriction; /\/////////////////////////////////////////////////////////////////////////////////// /\ Единицы измерения; set units = SI;