scalar c=100[ N/m ]; scalar lambda=0.1[m]; scalar m=2[kg]; scalar h=0.1[m]; point zero=point( 0 [ m ], 0 [ m ], 0 [ m ] ); point pointB=point( 5*h, h, 0 [ m ] ); point pointA=mirror( pointB, planePV( zero, projectX ) ); color colorA=index( 12 ); color colorB=index( 45 ); solid A=box( nodePoint( pointA ), 2*h, 2*h, 2*h, mass = m, color = colorA ); solid B=box( nodePoint( pointB ), 3*h, 2*h, 2.5*h, mass = 2*m, color = colorB ); body bodyA=body( color = RGB( 229, 229, 229 ) ); body bodyA < ( A, pointA ); body bodyB=body( color = RGB( 255, 153, 153 ) ); body bodyB < ( B, pointB ); force force1=spring( bodyA, pointA, bodyB, pointB, c, F0 = lambda*c ); body base=body( color = RGB( 229, 229, 229 ) ); set ground = base; joint joint1=translational( base, bodyA, pointA, projectX ); joint joint2=translational( base, bodyB, pointB, projectX ); sensor F_A=force( force:, bodyA, pointA, projectX, force1, fixing = lock: ); sensor v_A=velocity( pointA ); sensor v_A_theor=lambda*sqrt(2*c/(3*m)); sensor v_A_rel_ERROR=abs((v_A_theor-v_A)/v_A_theor); event event1=reformsBySensor( list( stop( ) ), F_A, 0 [ N ], ratio = single: ); command RK_const_step=constRK4( 1.00000e+000 [ s ], 1.00000e-003 [ s ] ); /\/////////////////////////////////////////////////////////////////////////////////// /\ Список главных команд; set dynamics = RK_const_step; /\/////////////////////////////////////////////////////////////////////////////////// /\ Единицы измерения; set units = SI;