Компьютерное моделирование и анализ кинематики плоских рычажных механизмов, страница 10

bx := cx + l4*cos(fi3) - l3*sin(fi3);     by := cy + l4*sin(fi3) + l3*cos(fi3);     fi2 := Atan2(bx - ax,by - ay);     a11 := - l2*sin(fi2); a12 := - cos(fi3);     a21 :=   l2*cos(fi2); a22 := - sin(fi3);     znam := a11*a22 - a21*a12;

b1 := vcx - vax + omega3*(l4*a22 + l3*a12);     b2 := vcy - vay - omega3*(l4*a12 - l3*a22);     omega2 := (b1*a22 - b2*a12)/znam;     v4 := (a11*b2 - a21*b1)/znam;

b1 := acx - aax  - (l4*cos(fi3) - l3*sin(fi3))*sqr(omega3);     b1 := b1 + l2*cos(fi2)*sqr(omega2);

b1 := b1 - 2*v4*sin(fi3)*omega3 -  epsi3*(l4*sin(fi3) + l3*cos(fi3));     b2 := acy - aay - (l4*sin(fi3) + l3*cos(fi3))*sqr(omega3);     b2 := b2 + l2*sin(fi2)*sqr(omega2);

b2 := b2 + 2*v4*cos(fi3)*omega3 + epsi3*(l4*cos(fi3)     l3*sin(fi3));

epsi2 := (b1*a22 - b2*a12)/znam;     a4 := (a11*b2 - a21*b1)/znam;

End; { Diada2v }

Procedure Diada3v;   Begin   { Diada3v }

l3 := sqrt(sqr(ax - cx) + sqr(ay - cy) - sqr(l2));     fi3 := Atan2(ax - cx,ay - cy) - ArcTan(l2/l3);     a11 := cos(fi3); a12 := - (l3*sin(fi3) + l2*cos(fi3));     a21 := sin(fi3); a22 := l3*cos(fi3) - l2*sin(fi3);     znam := a11*a22 - a21*a12;     b1 := vax - vcx; b2 := vay - vcy;     v3 := (b1*a22 - b2*a12)/znam;     omega3 := (a11*b2 - a21*b1)/znam;

b1 := aax - acx + 2*v3*a21*omega3 + a22*sqr(omega3);     b2 := aay - acy - 2*v3*a11*omega3 - a12*sqr(omega3);     a3 := (b1*a22 - b2*a12)/znam;     epsi3 := (a11*b2 - a21*b1)/znam;

End;   { Diada3v }

Procedure Diada4v;   Begin  { Diada4v }

a11 := cos(fi2); a12 := - cos(fi3);     a21 := sin(fi2); a22 := - sin(fi3);     znam := a11*a22 - a21*a12;

b1 := cx - ax + l2*a21 + l3*a22;     b2 := cy - ay - l2*a11 - l3*a12;     l1 := (b1*a22 - b2*a12)/znam;     l4 := (a11*b2 - a21*b1)/znam;

b1 := vcx - vax + omega2*(l1*a21 + l2*a11) + omega3*(l4*a22 + l3*a12);     b2 := vcy - vay - omega2*(l1*a11 - l2*a21) - omega3*(l4*a12 - l3*a22);     v1 := (b1*a22 - b2*a12)/znam;     v4 := (a11*b2 - a21*b1)/znam;

b1 := acx - aax + 2*v1*a21*omega2 + sqr(omega2)*(l1*a11 - l2*a21) + epsi2*(l1*a21 + l2*a11);

b1 := b1 + 2*v4*a22*omega3 + sqr(omega3)*(l4*a12 - l3*a22)

+ epsi3*(l4*a22 + l3*a12);

b2 := acy - aay - 2*v1*a11*omega2 + sqr(omega2)*(l1*a21 + l2*a11) epsi2*(l1*a11 - l2*a21);

b2 := b2 - 2*v4*a12*omega3 + sqr(omega3)*(l4*a22 + l3*a12)

- epsi3*(l4*a12 - l3*a22);     a1 := (b1*a22 - b2*a12)/znam;     a4 := (a11*b2 - a21*b1)/znam;

End; { Diada4v }

Procedure Diada5v;   Begin   { Diada5v }

a11 := cos(fi3); a12 := cos(fi3 + alpha);     a21 := sin(fi3); a22 := sin(fi3 + alpha);     znam := a11*a22 - a21*a12;     b1 := ax - cx + l2*a22;     b2 := ay - cy - l2*a12;

Bx3 := (b1*a22 - b2*a12)/znam;     Ax2 := (a11*b2 - a21*b1)/znam;

b1 := vax - vcx + omega3*(Bx3*a21 + Ax2*a22 + l2*a12);     b2 := vay - vcy - omega3*(Bx3*a11 + Ax2*a12 - l2*a22);

Vbx3 := (b1*a22 - b2*a12)/znam;     Vax2 := (a11*b2 - a21*b1)/znam;

b1 := aax - acx + 2*omega3*(Vbx3*a21 + Vax2*a22) +           sqr(omega3)*(Bx3*a11 + Ax2*a12 - l2*a22) +           epsi3*(Bx3*a21 + Ax2*a22 + l2*a12);     b2 := aay - acy - 2*omega3*(Vbx3*a11 + Vax2*a12) +           sqr(omega3)*(Bx3*a21 + Ax2*a22 + l2*a12)           epsi3*(Bx3*a11 + Ax2*a12 - l2*a22);

Abx3 := (b1*a22 - b2*a12)/znam;

Aax2 := (a11*b2 - a21*b1)/znam;

End;  { Diada5v }

End.  { Unit Diada }

ПРИЛОЖЕНИЕ 2.Текст программы анализа кинематики шестизвенника

Program Example;

Uses diada,crt,graph;

Label start;

Const nc = 360;

Var

i,j,d,r,ox,oy,pvx,pvy,pax,pay, x1,y1,x2,y2,kl,kv,ka : integer; l1,l30,l4,lcd,cx,cy,fi1,fi3,fi4,om1,om3,om4,epsi3,epsi4         : real; l5,v5,a5,bx,by,dx,dy,ex,vbx,vby,abx,aby,vdx,vdy,adx,ady    : real; l3,v3,a3,lcb                                                                           :   real;

ch                                     : char;