|
|
DataMuseum.dkPresents historical artifacts from the history of: RC4000/8000/9000 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about RC4000/8000/9000 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 1536 (0x600)
Types: TextFile
Names: »superfinn«
└─⟦00964e8f7⟧ Bits:30007478 RC8000 Dump tape fra HCØ.
└─⟦b2ec5d50f⟧
└─⟦this⟧ »superfinn«
pH af monobasiske syrer i vand
begin
integer n,i;
real Kw,Kw2,COH,ha,hb,ht,s0;
MORE:
n:=readi(<:antal syrer :>);
begin
array K,C(1:n);
repeat
write1(out,<:pK1...pKn,C1...Cn :>,n);
outendcur('nl');
i:=read(in,K,C);
until i=2*n;
for i:=1 step 1 until n do K(i):=10**(-K(i));
Kw:='-14;Kw2:=sqrt(Kw);
COH:=readr(<:COH:>);
ha:=-COH;
for i:=1 step 1 until n do
ha:=ha+C(i);
ha:=if ha>0 then Kw2+ha else Kw2;
hb:=if COH<0 then Kw2 else Kw/(COH+Kw2);
for ht:=sqrt(ha*hb) while ha/hb > 1.0005 do
begin
s0:=K(n)*C(n)/(K(n)+ht);
for i:=n-1 step -1 until 1 do
s0:=s0+(K(i)*C(i)/(K(i)+ht));
s0:=ht-Kw/ht+COH-s0;
if s0>0 then ha:=ht else hb:=ht
end;
write1(out,<:ph= :>,-ln(ht)/ln10);
if readb(<:mer endnu:>) then goto MORE
end
end
▶EOF◀