point A = point( 0 [ m ], 0 [ m ], 0.0000e+000 [ m ] ); point B = point( 0 [ m ], -0.3 [ m ], 0.0000e+000 [ m ], visible = hide: ); point C = point( 0 [ m ], -0.6[ m ], 0.0000e+000 [ m ], visible = hide: ); solid СтерженьAB = cylinder( A, B, 0.01 [ m ], mass = 2 [ kg ] ); solid СтерженьBC = cylinder( B, C, 0.01 [ m ], mass = 2 [ kg ] ); body Подвес = body( color = RGB( 229, 229, 229 ) ); color синий = RGB( 19, 44, 217 ); body AB = body( color = синий ); color желтый = RGB( 208, 208, 40 ); body BC = body( color = желтый ); gravity g = parallel( reverse( projectY ) ); joint Шарнир1 = rotational( Подвес, AB, A, projectZ ); joint Шарнир2 = rotational( AB, BC, B, projectZ ); sensor альфа = angleVV( reverse( projectY ), vectorPP( A, B ) ); sensor бета = angleVV( reverse( projectY ), vectorPP( B, C ) ); function function1(x [ rad ],y [rad])=9.81*cos(#x+#y)*1[ N ]; force FX = force( BC, C, projectX, function1, list( Шарнир1.gamma, Шарнир2.gamma ) ); function function2(x [ rad ],y[ rad ])=9.81*sin(#x+#y)*1 [ N ]; force FY = force( BC, C, reverse( projectY ), function2, list( Шарнир1.gamma, Шарнир2.gamma ) ); sensor NAx = jointForce( force:, AB, A, projectX, Шарнир1 ); sensor NAy = jointForce( force:, AB, A, projectY, Шарнир1 ); sensor Na = sqrt(NAx*NAx+NAy*NAy); sensor NBx = jointForce( force:, BC, B, projectX, Шарнир2 ); sensor NBy = jointForce( force:, BC, B, projectY, Шарнир2 ); sensor Nb = sqrt(NBx*NBx+NBy*NBy); scalar alpha = arctg(1/3); scalar beta = 45[ deg ]; scalar Теория_Na = 9.81*sqrt(17)*1[N]; scalar Теория_Nb = 9.81*sqrt(5)*1[N]; sensor Погрешность_Na = abs((Na-Теория_Na)/Теория_Na); sensor Погрешность_Nb = abs((Nb-Теория_Nb)/Теория_Nb); /\/////////////////////////////////////////////////////////////////////////////////// /\ Прикрепление объектов body Подвес < (A ); body AB < (СтерженьAB, B ); body BC < (СтерженьBC, C ); /\/////////////////////////////////////////////////////////////////////////////////// /\ Инерциальное звено; set ground = Подвес; /\/////////////////////////////////////////////////////////////////////////////////// /\ Единицы измерения; set length = m; set angle = deg; set mass = kg; set time = s; set force = N; set work = J; set pressure = Pa; set power = W; set frequency = Hz; set temperature = K; set current = A; set voltage = V; set resistance = Ohm; set capacity = F; set charge = C; set induction = T;