scalar m1=20[ kg ]; scalar m2=80[ kg ]; scalar mu=0.01[s/m]; scalar v0=4[m/s]; scalar t1=2[s]; scalar f=0.1; scalar g=10[m/s2]; scalar tau1=4[s]; scalar tau2=8[s]; scalar G_theor=80[ N ]; scalar h=2[m]; point pointA=point( -26*h, 3*h, 0 [ m ] ); point pointB=point( -14*h, h, 0 [ m ] ); point pointS=point( 0[ m ], 0[ m ], 0[ m ] ); point pointX=point( -50*h, h, 0 [ m ] ); solid solidA=box( nodePoint( pointA ), 2*h, 2*h, 2*h, mass = m1 ); solid solidB=box( nodePoint( pointB ), 28*h, 2*h, 14*h, mass = m2 ); gravity gravity1=parallel( reverse( projectY ), g = g ); body base=body( color = RGB( 229, 229, 229 ) ); set ground = base; body base < ( pointX ); body bodyA=body( color = RGB( 255, 153, 153 ) ); body bodyA < ( solidA, pointA ); body bodyB=body( color = RGB( 255, 153, 102 ) ); body bodyB < ( solidB, pointB, pointS ); joint joint1=translational( bodyA, bodyB, pointA, projectX ); joint joint2=translational( bodyB, base, pointB, reverse( projectX ) ); sensor v_A=velocity( pointA ); sensor v_B=velocity( pointB ); sensor v_A_B=transVelocity( bodyB, projectX, bodyA, pointA, fixingVector = lockVector: ); sensor NA=jointForce( force:, bodyA, pointA, projectY, joint1 ); sensor NA1=prevValue( NA ); sensor NB=jointForce( force:, bodyB, pointB, projectY, joint2 ); sensor NB1=prevValue( NB ); condition condition1=transVelocity( base, projectX, bodyA, pointA, v0 ); function function1(N[N],v[m/s])=f*#N*sign(#v); function function2(N[N],v[m/s])=mu*#v*sign(#v)*#N; function function3(t[s])=0.25[m/s2]*(#t-t1)*(#t-t1); force forceA=force( bodyA, move( pointA, reverse( projectY ), h ), reverse( projectX ), function1, list( NA1, v_A ) ); force forceB=force( bodyB, move( pointB, reverse( projectY ), h ), projectX, function2, list( NB1, v_B ) ); actuator actuator1=forcePP( bodyB, pointB, base, pointX ); sensor s=bodyDisplacement( base, point( 0[ m ], 0[m], 0 [ m ] ), reverse( projectX ), bodyB, pointS, fixingVector = lockVector: ); motion motion1=ideal( actuator1, function3, s, time, work = off: ); sensor G=actuatorForce( force:, bodyB, pointB, reverse( projectX ), motion1 ); event event1=reformsBySensor( list( motionsOn( list( motion1 ) ) ), time, t1 ); event event2=reformsBySensor( list( ), v_A_B, 0 [ m/ s ], gauge = list( time ) ); event event3=reformsBySensor( list( stop( ) ), time, t1+tau2 ); command RK_const_step=constRK4( t1+tau2, 1.00000e-003 [ s ] ); sensor tau1_rel_ERROR=abs((event2.time-tau1-t1)/(tau1+t1)); sensor G_rel_ERROR=abs((G-G_theor)/G_theor); /\/////////////////////////////////////////////////////////////////////////////////// /\ Список главных команд; set dynamics = RK_const_step; /\/////////////////////////////////////////////////////////////////////////////////// /\ Единицы измерения; set units = SI;