Unusual method of measuring alkalinity

hb-zg

New Member
View Badges
Joined
Jul 18, 2024
Messages
2
Reaction score
0
Location
taiwan
Rating - 0%
0   0   0
不会,盐和碱不会蒸发。然而,我们处理的并不是真正的蒸发,而是雾化。小水滴会随着时间的推移被物理喷入空气中并被吸入泵中。
我已经成功安装了PyCO2SYS的库函数,但是却无法正确计算出我想要的结果,可以分享一下你的python代码吗?

Translation:
I have successfully installed the PyCO2SYS library function, but I cannot correctly calculate the results I want. Can you share your python code?
 

Randy Holmes-Farley

Reef Chemist
View Badges
Joined
Sep 5, 2014
Messages
73,959
Reaction score
72,266
Location
Massachusetts, United States
Rating - 0%
0   0   0
I have successfully installed the PyCO2SYS library function, but I cannot correctly calculate the results I want. Can you share your python code?

Translation:
I have successfully installed the PyCO2SYS library function, but I cannot correctly calculate the results I want. Can you share your python code?

Welcome to Reef2Reef!

I'll have to let others answer about the program.
 

hb-zg

New Member
View Badges
Joined
Jul 18, 2024
Messages
2
Reaction score
0
Location
taiwan
Rating - 0%
0   0   0

arking_mark

2500 Club Member
View Badges
Joined
Mar 2, 2016
Messages
2,609
Reaction score
1,828
Location
Potomac
Rating - 0%
0   0   0
Anyone who can help me with this, I would be very grateful to him. Also thank you for communicating with me.
Here is my raw code...

from PyCO2SYS import CO2SYS
import math

par1type = 1 # The first parameter supplied is of type "1", which means "alkalinity"; type "4" which means Seawater partial pressure of CO2; 8" which means "Aqueous CO2""; "9", which is "Dry mole fraction of CO2""

alk = 8.2

par1 = alk*1000*0.36 # value of the first parameter

print("Tank measured Alk =", alk, "dKH (", par1, ")")

#par1 = 1500

#print("Tank target CO2 =", par1, "matm ")

par2type = 9 # The second parameter supplied is of type "3", which means "pH"; type "4" which means Seawater partial pressure of CO2; 8" which means "Aqueous CO2""; "9", which is "Dry mole fraction of CO2""

# par2 = 7.73 # value of the second parameter

# print("Tank measured pH =", par2, "NBS")

par2 = 400

print("Air CO2 =", par2, "ppm")

sal = 35 # Salinity of the sample

tempin = 25 # Temperature at input conditions

tempout = 25 # Temperature at output conditions

presin = 0 # Pressure at input conditions

presout = 0 # Pressure at output conditions

sil = 50 # Concentration of silicate in the sample (in umol/kg)

po4 = 2 # Concentration of phosphate in the sample (in umol/kg)

pHscale = 4 # pH scale at which the input pH is reported ("1" means "Total Scale") ("3" means Free Scale)("4" means NBS)

k1k2c = 4 # Choice of H2CO3 and HCO3- dissociation constants K1 and K2 ("4" means "Mehrbach refit")

kso4c = 1 # Choice of HSO4- dissociation constants KSO4 ("1" means "Dickson")

# Do the calculation. See CO2SYS's help for syntax and output format
CO2dict = CO2SYS(par1, par2, par1type, par2type, sal, tempin, tempout, presin, presout, sil, po4,pHscale, k1k2c, kso4c)

print()
print("Calculated Results:")
dkh = CO2dict["TAlk"][0]/1000/0.36
print("Alk =",dkh,"dKH")
print("pH =", CO2dict["pHoutTOTAL"][0], "Total")
print("pH =", CO2dict["pHoutNBS"][0], "NBS")
print("xCO2 = %.0f" % CO2dict["xCO2out"][0], "Dry mole fraction of CO2")
print("pCO2 = %.0f" % CO2dict["pCO2out"][0],"Seawater partial pressure of CO2")
print("CO3out =", CO2dict['CO3out'])
print("HCO3out =", CO2dict['HCO3out'])

print("CO3 % =", 100*CO2dict['CO3out']/(CO2dict['CO3out']+CO2dict['HCO3out']))

CarbonateAlk = (CO2dict['CO3out']/60 + CO2dict['HCO3out']/30)

#print("Carbonate Alk =", CarbonateAlk)


#print(CO2dict)
 

TOP 10 Trending Threads

DO YOU GET EXCITED TO SHOW OFF YOUR TANK TO FELLOW REEFERS, OR ARE YOU HESITANT?

  • I get excited because _________! (Share in the comments!)

    Votes: 19 27.1%
  • I am hesitant because ________. (Share in the comments!)

    Votes: 19 27.1%
  • It depends on the day...

    Votes: 25 35.7%
  • Other (please explain).

    Votes: 7 10.0%
Back
Top