scalar m=2[kg]; scalar w=500 [deg/s]; scalar l=0.3 [m]; scalar t=2 [s]; scalar g=10 [m/s2]; point point1=point( 0 [ m ], 0 [ m ], 0 [ m ], pointStyle = dot:, visible = hide: ); plane plane1=planePV( point1, projectY, l1 = 22 [ m ], l2 = 3 [ m ], n1 = 4, n2 = 4, surfaceStyle = lineStyle:, visible = show: ); point point2=move( point1, projectY, 0.01 [ m ], visible = show: ); node node1=nodePoint( point2, visible = hide: ); color red=RGB( 255, 0, 0 ); solid solid1=box( node1, 4*l, 0.02 [ m ], 4*l, mass = 16*m, color = red ); point point3=move( point2, projectY, 4*l + 0.01[m] ); line line1=polyLine( list( point3, point2 ) ); vector inverseY=reverse( projectY ); point point_O=move( point3, inverseY, 2*l ); point point4=move( point_O, projectX, 2*l, visible = show: ); point point5=move( point_O, reverse( projectX ), 2*l, visible = show: ); line line2=polyLine( list( point4, point5 ) ); solid solid_A=box( nodePoint( point4 ), 0.01 [ m ], 0.01 [ m ], 0.01 [ m ], mass = m, color = red ); solid solid_B=box( nodePoint( point_O ), 0.01 [ m ], 0.01 [ m ], 0.01 [ m ], mass = m, color = red ); color black=RGB( 1, 0, 0 ); line line_AB=polyLine( list( point_O, point4 ), color = black ); point point_C=move( point_O, projectX, l ); line line_OC=polyLine( list( point_O, point_C ), color = black ); color grey=RGB( 128, 128, 128 ); body inert=body( color = grey ); set ground = inert; body inert < ( plane1 ); color blue=RGB( 0, 0, 255 ); body body1=body( color = blue ); body body1 < ( solid1, line1, line2, point_O, point2, point4, point3, point5 ); body body2=body( color = black ); body body2 < ( line_OC ); body body3=body( color = red ); body body3 < ( line_AB, point_C ); joint joint1 "Движение плиты по плоскости"=translational( inert, body1, point1, projectX, freeze = noFreeze: ); joint joint2 "Вращение кривошипа"=rotational( body1, body2, point_O, projectZ ); joint joint3 "Кривошип в точке С"=rotational( body2, body3, point_C, projectZ ); body body_A=body( color = red ); body body_A < ( solid_A ); body body_B=body( color = red ); body body_B < ( solid_B ); joint joint4 "Движение А"=translational( body1, body_A, point4, projectX ); joint joint5 "Движение В"=translational( body1, body_B, point_O, projectY ); joint joint6 "Связь А и АВ"=rotational( body3, body_A, point4, projectZ ); joint joint7 "Связь В и АВ"=rotational( body3, body_B, point_O, projectZ ); sensor sens_w=derivative( joint2.gamma ); vector grav_direct=rotate( inverseY, projectZ, 30[deg], point = point1, visible = show: ); gravity gravity=parallel( grav_direct, g = g ); actuator actuator1=force( body1, point_O, inverseY, body2, point_C ); motion motion1=ideal( actuator1, w, sens_w, time ); sensor sensor_dist=displacement( point1, point2, projectX ); sensor sens_theor_dist=g*time*time/4 + l*(1 - cos(w*time))/9; sensor sens_delta=abs(sensor_dist - sens_theor_dist); /\/////////////////////////////////////////////////////////////////////////////////// /\ Единицы измерения; set units = SI;