1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142
|
program bilandemasse;
uses
crt,Graph;
CONST
ox=60;
oy=600;
unitx=60;
unity=250;
a=1;
p=2;
c=0.5;
m=0.5;
VAR
GraphPilote, GraphMode : integer;
x, y, h, dt, t, Xa, Ya, Xn, Yn, Tmax , stop : real;
i : integer;
procedure Point(x,y:real);
VAR
a,b : integer;
begin;
a:= round(ox+unitx*x);
b:= round(oy-unity*y);
moveto(a,b);
lineto(a,b);
end;
procedure Axes;
VAR
px,py:real;
begin;
setcolor(2);
px:=-1;
py:=-0.1;
repeat
px:=px+h;
py:=py+h;
point(px,0);
point(0,py);
until px>100;
end;
procedure Tics;
var
j:integer;
tx,ty:real;
begin;
setcolor(2);
for j:=0 to 10 do
begin;
tx:=0;
ty:=0;
repeat
tx:=tx+h;
point(10*j,tx);
ty:=ty+h;
point (ty,0.1*j);
until tx>0.05;
end;
end;
procedure Fond;
var
kx:integer;
begin;
setcolor(15);
kx:= 0;
repeat
kx:= kx+1;
moveto(kx,0);
lineto(kx,2000);
until kx>5000;
end;
procedure Trace(xa, ya, xn,yn: real);
var
a,b: integer;
begin
a:= round(ox+unitx*xa);
b:= round(oy-unity*ya);
moveto(a,b);
a:= round(ox+unitx*xn);
b:= round(oy-unity*yn);
lineto(a,b);
end;
Begin
GraphPilote := Detect;
InitGraph(GraphPilote, GraphMode, '');
begin
repeat
Fond;
Axes;
Tics;
write(' Entrer un pas de temps dt = ');
readln(dt);
write(' Entrer un Tmax = ');
readln(Tmax);
write('Entrer une couleur pour la courbe ');
readln(i);
setcolor(i);
{ici commence le trace de la recurrence}
begin
Xa := 1;
Ya := 1;
t := 0;
repeat
Xn := Xa+dt*(a*Xa-p*Xa*Ya);
Yn := Ya+dt*(c*p*Xa*Ya-m*ya);
Xa := XN;
Ya := Yn;
t := t+dt;
until (t>10);
end;
writeln(' Voulez-vous continuez ? oui = 1, non = 2 ');
readln(i);
until i = 2;
end;
writeln();
readln();
end. |