// data parametres scalar g = 9.81 [m/s2]; scalar m1 = 1 [kg]; scalar m2 = 6 [kg]; scalar m3 = 4 [kg]; scalar r1 = 0.4 [m]; scalar r2 = 0.3 [m]; scalar l = 0.1 [m]; scalar a1 = 0.2 [m]; scalar a2 = 0.1 [m]; scalar phi1 = 0.165148676 [rad]; scalar phi2 = 0.35877067 [rad]; scalar psi = 6.71096627 [rad]; scalar mu = 0.05 []; scalar nu = 0.05[]; // points point K = ( -r1*cos(phi1), r1*sin(phi1)+r1, 0 [ m ] ); point C = ( 0 [ m ], 0 [ m ], 0 [ m ] ); point L = ( r1*cos(phi1), r1-r1*sin(phi1), 0 [ m ] ); point M = ( r1*cos(phi1)+l*cos(psi), r2-r2*sin(phi2), 0 [ m ] ); point D = ( r1*cos(phi1)+l*cos(psi)+r2*cos(phi2), 0 [ m ], 0 [ m ] ); point N = ( r1*cos(phi1)+l*cos(psi)+2*r2*cos(phi2), r2+r2*sin(phi2), 0 [ m ] ); point A = ( -a1*sin(phi1), r1-a1*cos(phi1), 0 [ m ] ); point B = ( r1*cos(phi1)+l*cos(psi)+r2*cos(phi2)+a2*sin(phi2), r2-a2*cos(phi2), 0 [ m ] ); point o1 = ( 0 [ m ], r1, 0 [ m ] ); point o2 = ( r1*cos(phi1)+l*cos(psi)+r2*cos(phi2), r2, 0 [ m ] ); // shperes line hshere1 = circlePPP( L, K, C, arc = arc: ); line hshere2 = circlePPP( M, N, D ); solid mshere1 = sphere( A, 0.001 [ m ], mass = m2 ); solid mshere2 = sphere( B, 0.001 [ m ], mass = 4 [ kg ] ); // stick solid solid1 = cylinder( M, L, 0.01 [ m ], mass = m1 ); // bodies body big = body( color = RGB( 229, 229, 229 ) ); body small = body( color = RGB( 255, 153, 153 ) ); body stick = body( color = RGB( 255, 153, 102 ) ); body bodyinert = body( color = RGB( 255, 255, 153 ) ); // joints joint joint1 = rotational( stick, big, L, projectZ ); joint joint2 = rotational( small, stick, M, projectZ ); // vectors of gravitation shperes vector vgbig = ( 0 [ m ], -6*9.81 [ m ], 0 [ m ] ); vector vgsmall = ( 0 [ m ], -4*9.81 [ m ], 0 [ m ] ); vector vectorgrav = reverse( projectY ); vector vectorKL = vectorPP( K, L ); vector vectorLM = vectorPP( L, M ); vector vectorMN = vectorPP( M, N ); // gravitation gravity gravity = parallel( vectorgrav ); // the inertbody-floor point pointleft = point( -1 [ m ], 0 [ m ], 0 [ m ] ); point pointright = point( 1 [ m ], 0 [ m ], 0 [ m ] ); line floor = polyLine( list( pointleft, pointright ) ); // joints of spheres - floor joint jointbig = contactLineLine( hshere1, floor ); joint jointsmall = contactLineLine( hshere2, floor ); // sensors sensor phi1t = angleVV( vectorKL, projectX ); sensor phi2t = angleVV( vectorMN, projectX ); sensor psit = angleVV( vectorLM, projectX ); // functions function hA(phi1t[rad]) = r1-a1*cos(#phi1t); function hB(phi2t[rad]) = r2-a2*cos(#phi2t); function hQ(phi1t[rad],psit[rad]) = r1-r1*sin(#phi1t)-l*sin(#psit)/2; sensor Pbig = m2*g*hA(phi1t); sensor Psmall = m3*g*hB(phi2t); sensor Pstick = m1*g*hQ(phi1t,psit); sensor sumP = Pbig+Psmall+Pstick; sensor minsumP = min( sumP ); //function mP(minsumP[ J])=#minsumP; //scalar minP = mP(minsumP); event myevent = reformsBySensor( list( stop( ) ), time, 1.65[s] ); //medium medium = mediumV( 1000 [ kg/ m3 ], 400 [ m/ s ], projectX, 0 [ m/ s ] ); /\/////////////////////////////////////////////////////////////////////////////////// /\ Прикрепление объектов body big < (hshere1, mshere1, A ); body small < (hshere2, mshere2, B ); body stick < (solid1 ); body bodyinert < (floor, C, D ); /\/////////////////////////////////////////////////////////////////////////////////// /\ Инерциальное звено; set ground = bodyinert; /\/////////////////////////////////////////////////////////////////////////////////// /\ Единицы измерения; set units = SI;