Расчет системы автоматической стабилизации заданного значения выходной координаты, страница 8

                outtextxy(170,130,st);

                outtextxy(630, 190, 't'); line(0,180,640,180);

                outtextxy(90, 20, 'Y'); line(100,480,100,0);

                outtextxy(80,360-round(dx1*mash-25), 'Y0');

                line(100,180-round(-dx1*mash),640,180-round(-dx1*mash));

                zz:=1;

                setlinestyle(dashedln, 0, normwidth);

                str(Tmax:3:3,st);

                st:='Tm='+st;

                outtextxy(80+round(Tmax*mash),160,st);

                line(100+round(Tmax*mash),170,100+round(Tmax*mash),180-round(ymax1*mash));

                str(Tre:3:3,st);

                st:='Tp='+st;

                outtextxy(80+round(Tre*mash),160,st);

                line(100+round(Tre*mash),170,100+round(Tre*mash),180-round(-dx1*mash));

                str(Per:3:3,st);

                st:='Tk='+st;

                outtextxy(110+round((Tmax+Per/2)*mash),150,st);

                line(100+round((Tmax+Per/2)*mash),180,100+round((Tmax+Per/2)*mash),150);

                line(100+round((Tmax+Per/2+Per)*mash),180,100+round((Tmax+Per/2+Per)*mash),150);

                setlinestyle(dottedln, 0, normwidth);

                for j:= 1 to i do

                               begin

                                               putpixel(100+round(mast[j]*mash),180-round(masy[j]*mash),blue);

                                               if j=round(i/9)*zz then

                                                               begin

                                                                              str(mast[j]:2:1,st);

                                                                              outtextxy(100+round(mast[j]*mash) , 170, st);

                                                                              inc(zz);

                                                               end;

                               end;

                readkey;

                closegraph;

end;

BEGIN

                clrscr;

                Writeln('Vvedite trebyemie parametri!');

                Write('   T = ');      Readln(T);

                Write('  T0 = ');     Readln(T0);

                Write('  T2 = ');     Readln(T2);

                Write('  T3 = ');     Readln(T3);

                Write('  Kz = ');     Readln(Kz);

                Write('   Z = -');     Readln(z);

                Write(' Krs = ');   Readln(Krs);

                Write(' dx1 = ');    Readln(dx1);

                z:=-z;

                Initab;

                assign(f,'result.dat');

                rewrite(f);

                writeln(f,'      t           y            pr');

                i:= 1;

                Tre:=0;

                y:= newY;

                zn3:=false;

                mast[i]:= tt; masy[i]:= y; maspr[i]:= pr;

                writeln(f, tt:10:4, y:10:3, pr:10:3);

                repeat

                               inc(i);

                               tt:= tt + h;

                               y:= newY;

                               writeln(f, tt:10:4, y:10:3, pr:10:3);

                               mast[i]:= tt; masy[i]:= y; maspr[i]:= pr;

                               if maspr[i-1]<0 then zn1:= true else zn1:= false;

                               if pr<0 then zn2:= true else zn2:= false;

                               if zn1<>zn2 then

                                               begin

                                                               if zn3=false then