Sunteți pe pagina 1din 5

Program trCoul;

uses graph;
{ traiectorii Coulomb ale particulei alpha in
c�mpul nucleelor tinta de masa A2 si sarcina Z2}

{pentru vizualizare traiectorii se genereaza 10


traiectorii si se apeleaza procedura grafica}
{ pentru sectiuni se genereaza Monte Carlo 100
valori pentru parametrul de ciocnire uniform
distribuit pe suprafata cercului de raza=bmax fm,
b=sqrt(2*r)*bmax fm. r este un numar aleator
uniform distribuit pe intervalul [0,1). Se deseneaza cu puncte
dsigma/domega pentru unghiurile rezultate din integrarea ecuatiilor
de miscare;cu cerculete se deseneaza dsigma/domega functie de
1/sin^4(theta/2) pentru valori echidistante ale lui
theta;
procedura graficas }
type glnarray=array[1..4] of real {cerut de rk4};
label 25, 30, unu, doi, trei, patru, 35, 40;
const n=4;t0=0.; tf=1.; dt=5.E-03;
pi=3.14159; amu=931.478; clum=2.99793E+03;
hc=197.32; p13=0.333333; e2c2=129.6E+05;e2=1.44;
xlat0=80.; a1=4; z1=2;
var rint, cp, cm, cz, c1, c2, v0, cb, cw:real;
cs, cs2, bmax, dmin:real;
y, dydx:glnarray;
st:array[1..20]of string;
stdim,a2c,z2c,elabc:string;
bcioc,tetaf:array[1..100]of real;
xt,yt:array[1..250] of real;
xtg, ytg:array[1..20,1..250] of integer;
xsigtg, ysigtg:array[1..100] of integer;
xsigt, ysigt:array[1..100]of real;
xtmax, ytmax, xtmin, ytmin:real;
xscal, yscal, arg, dsigmax, dsigmin :real;
dsig:array[1..100] of real;
nmax,ndim, nparc, l, i, j:word;
clum2, a2, z2, ared, elab, ecm, vinit, moml:real;
r0, z0, z0g, w0, r, x:real;
tetat, dsigt:array[1..20] of real;
xsigtt,ysigtt:array[1..20] of integer;
ia:char;
{$F+}
procedure derivs(x:real; y:glnarray;var dydx:glnarray);
{ceruta de rk4}
begin dydx[1]:=y[2]*y[3]*y[3]+cz/y[2]/y[2];
dydx[2]:=y[1];
dydx[3]:=-2*y[1]*y[3]/y[2];
dydx[4]:=y[3];
end; {end derivs}
{$F-}
function putere(baza,exponent:real):real;
begin
putere:=EXP(exponent*LN(baza));
end; {end putere}
procedure grafica;
var i:word; gd, gm:integer;
xc, yc:integer;
begin
gd:=detect;
Initgraph(gd,gm,'C:\TPC\bgi');
xc:=400; yc:=400;
{coordonatele centrului sistemului de referinta}
setbkcolor(15); setcolor(1);
moveto(0,yc);lineto(600,yc);
outtextxy(610,yc,'X');
setfillstyle(1,1);
fillellipse(xc,yc,trunc(rint+0.5),trunc(rint+0.5));
outtextxy(xc-10,yc+10,'A2='+a2c);
outtextxy(xc-10,yc+30,'Z2='+z2c);
outtextxy(10,50,'miscarea particulei alpha in campul Coulomb al nucleului Z2,
A2');
outtextxy(10,70,'energia'+elabc+'MeV');
outtextxy (500,330,'dmin='+stdim+'fm');
outtextxy(470,30,'unghiul de deviatie');
for i:=1 to nparc do
begin
for j:=1 to nmax-1 do
putpixel(xc+xtg[i,j],400-ytg[i,j],1);
outtextxy(530,10+i*30,st[i]);
end;
end; {end grafica}
procedure graficas;
var i:word; gd, gm:integer;
xc, yc:integer;
begin
gd:=detect; Initgraph(gd,gm,'C:\TPC\bgi');
xc:=5; yc:=400;
{coordonatele centrului sistemului de referinta}
setbkcolor(15);
setcolor(1);
moveto(0,yc);
lineto(600,yc);
outtextxy(600,yc-10,'theta');{axa X}
outtextxy(xc,yc+10,'0');
outtextxy(10,50,'miscarea particulei alpha in campul Coulomb al nucleului
Z2= '+z2c);
outtextxy(10,70,'energia'+elabc+' MeV');
moveto(trunc(xscal*pi)+xc,410);
lineto(trunc(xscal*pi)+xc,390);
outtextxy(trunc(xscal*pi)+xc,410,'pi');
moveto(trunc(xscal*pi/2)+xc,410);
lineto(trunc(xscal*pi/2)+xc,390);
outtextxy(trunc(xscal*pi/2)+xc,410,'pi/2');
moveto(xc,0);
lineto(xc,400);
outtextxy(xc,10,'dsig/domega');
for i:=1 to nparc do putpixel(xc+xsigtg[i],400-ysigtg[i],1);
{distr. rezultata din generarea lui b}
for j:=1 to 18 do circle(xc+xsigtt[j],400-ysigtt[j],2);
{distr. teoretica}
end; {end graficas}
{$i rk4.inc}
BEGIN
clum2:=clum*clum;
{ marimi ce caracterizeaza sist.de ioni grei}
write( 'a si z pentru tinta: ');
readln( a2, z2);
str(a2:5:1,a2c);
str(z2:5:1,z2c);
write('elab=');
readln( elab );
{calcul constante ce depind de sistemul de ioni grei}
ared:=a1*a2/(a1+a2)*amu;
cm:=clum2/ared;
rint:=1.5*putere(a2,p13);
cz:=z1*z2*e2c2/ared;
cb:=hc/ared/sqrt(2*elab/a1/amu);
cw:=hc*clum/ared;
ecm:=a2/(a1+a2)*elab;
cs:=z1*z2*e2/2./ecm;
cs2:=cs*cs;
vinit:=clum*sqrt(2*elab/a1/amu);
writeln(' a2=',a2:5:1,' z2=',z2:5:1);
writeln(' elab=',elab:10:2,' ecm=',ecm:10:2,ared=',ared:10:2 ,'
rint=',rint:10:2);
ndim:=trunc((tf-t0)/dt); writeln('ndim=',ndim:5);
dmin:=z1*z2*e2/2/ecm;
str(dmin:6:2,stdim);
str(elab:6:1,elabc);
{nparc=10 pentru traiectorii, nparc=100 pentru sectiune}
write(' pentru traiectorii tastati t, pentru sectiune tastati s:');
readln(ia);
if upcase(ia)='T'; then goto unu;
if upcase(ia)='S' then goto doi;
unu: nparc:=10;
for i:=1 to nparc do
begin
if i<= 3 then bcioc[i]:=2*i else bcioc[i]:=3*i;
l:=trunc(bcioc[i]/cb);
moml:=sqrt(l*(l+1));
r0:=sqrt(bcioc[i]*bcioc[i]+xlat0*xlat0);
z0:=pi-Arctan(bcioc[i]/xlat0);
z0g:=z0*180/pi; w0:=moml*cw/r0/r0;
x:=t0; y[1]:=-vinit; y[2]:=r0; y[3]:=-w0; y[4]:=z0;
for j:=1 to ndim do
begin
derivs(x,y,dydx);
rk4(y,dydx,4,x,dt,y);
x:=x+dt;
xt[j]:=y[2]*cos(y[4]);
yt[j]:=y[2]*sin(y[4]);
if abs(y[2]) > 100 then goto 25
end;
nmax:=j-1;
25: nmax:=j;
30: if xt[nmax] < xt[nmax-1] then
tetaf[i]:=pi-arctan((yt[nmax]-yt[nmax-1])/(xt[nmax-1]-xt[nmax]))
else tetaf[i]:=arctan((yt[nmax]-yt[nmax-1])/(xt[nmax]-xt[nmax-1]));
tetaf[i]:=tetaf[i]*180./pi;
str(tetaf[i]:10:2,st[i]);
xtmax:=xt[2]; xtmin:=xt[2]; ytmax:=yt[2];
ytmin:=yt[2];
for j:=1 to nmax do
begin
if xtmax < xt[j] then xtmax:=xt[j];
if xtmin > xt[j] then xtmin:=xt[j];
if ytmax < yt[j] then ytmax:=yt[j];
if ytmin > yt[j] then ytmin:=yt[j];
end;
{factorii de scalare pentru grafica}
xscal:=600./(xtmax-xtmin); yscal:=400./(ytmax-ytmin);
for j:=1 to nmax do
begin
xt[j]:=xscal*xt[j]; yt[j]:=yscal*yt[j];
end;
for j:=1 to nmax do
begin
xtg[i,j]:=trunc(xt[j]+0.5);
ytg[i,j]:=trunc(yt[j]+0.5);
end;
end; {end pe ciclul dupa i de la 1 la nparc}
grafica; readln; closegraph;
writeln(' doriti sectiuni? d/n');
read(ia);
if upcase(ia)='N' then goto trei
else goto doi;
{se genereaza aleator 100 parametri de ciocnire}
{functia de distributie este p(b)db=2bdb/bmax/bmax,s-a luat bmax=3*rint}
doi: nparc:=100; randomize; bmax:=3*rint;
for i:=1 to nparc do
begin
patru: r:=random(100)/100.;
bcioc[i]:=sqrt(2*r)*bmax;
if bcioc[i]<0.5 then goto patru;
l:=trunc(bcioc[i]/cb); moml:=sqrt(l*(l+1));
r0:=sqrt(bcioc[i]*bcioc[i]+xlat0*xlat0);
z0:=pi-Arctan(bcioc[i]/xlat0); z0g:=z0*180/pi;
w0:=moml*cw/r0/r0; x:=t0;
y[1]:=-vinit; y[2]:=r0; y[3]:=-w0; y[4]:=z0;
for j:=1 to ndim do
begin
derivs(x,y,dydx);
rk4(y,dydx,4,x,dt,y);
x:=x+dt;
xt[j]:=y[2]*cos(y[4]); yt[j]:=y[2]*sin(y[4]);
if abs(y[2]) > 100 then goto 35
end;
nmax:=j-1;goto 40;
35: nmax:=j;
40: if xt[nmax] < xt[nmax-1] then
tetaf[i]:=pi-arctan((yt[nmax]-yt[nmax-1])/(xt[nmax-1]-xt[nmax]))
else tetaf[i]:=arctan((yt[nmax]-yt[nmax-1])/(xt[nmax]-xt[nmax-1]));
end; {inchide ciclul dupa i de la 1 la nparc}
for i:=1 to nparc do
begin
arg:=tetaf[i]/2.;
dsig[i]:=cs2/sin(arg)/sin(arg)/sin(arg)/sin(arg);
end;
dsigmax:=dsig[1]; dsigmin:=dsig[1];
for i:=2 to nparc do
begin
if dsig[i] > dsigmax then dsigmax:=dsig[i];
if dsig[i] < dsigmin then dsigmin:=dsig[i];
end;
yscal:=400./(dsigmax-dsigmin);
xscal:=600./3.14159;
for j:=1 to nparc do
begin
xsigt[j]:=xscal*tetaf[j]; ysigt[j]:=yscal*dsig[j];
end;
for j:=1 to nparc do
begin
xsigtg[j]:=trunc(xsigt[j]);
ysigtg[j]:=trunc(ysigt[j]);
end;
for j:=1 to 18 do
begin
tetat[j]:=j*10*pi/180;arg:=tetat[j]/2.;
dsigt[j]:=cs2/sin(arg)/sin(arg)/sin(arg)/sin(arg)*ysca;
tetat[j]:=xscal*tetat[j]; xsigtt[j]:=trunc(tetat[j]);
ysigtt[j]:=trunc(dsigt[j]);
end;
graficas; readln; readln;closegraph;
trei:end.