program GIIdisk;

{$APPTYPE CONSOLE}

uses
  SysUtils,math;

  var G, M, rho, r, Rz, z, p, dP, dZ, T, mmol: real;

begin
G:=6.67E-11;
M:=1E31;
r:=1E8;
z:=0;
dz:=3E2;
rho:=1E-10;
mmol:=1E-3;
T:=100;
p:=8.31*T*rho/mmol;

// repeat
repeat
begin
Rz:=sqrt(r*r + z*z);
z:=z+dz;
dP:=((G*M*rho*power(Rz,-2))*(z/Rz))*dz;
rho:=p*mmol/(T*8.31);
p:=p-dp;
writeln(r,'   	 ',z,'     ',rho,'     ',p,'     ',dp);
end;
until p < 1E-20;
// r:=r+3E4;
// until r > 1E9;

end.

//  dP/dz + GMrho/r^2*sin(alpha) = 0, kde sin(alpha) = z/r a r = (R^2+z^2)^(1/2).
// GIIdisk.exe>GIIdisk.txt
