Have you tried to get it right first without the Van 't Hoff corrections?
Your formula uses two constants - 29.42 and -2400 - that are not clear to me.
I mean: I could probably attempt to guess where they came from, but it would be better if you explain everything from the very beginning. So far I am guessing my way through things you have never stated, it is a waste of time
Yeah, when I run the numbers without altering the temp (aka, just using Henry's constant as-is), the amounts change slightly, but nothing notable
Sorry, I take for granted that I have figured parts out, and haven't expressly shared the logic I am using
Also, I am reviewing my code, I made some mistakes when I "translated" my code to an equation
The Equation should read like this:
C = (P/10^6) / 29.76 * exp(2400/8.314*(1/(T+273.15)-1/298.15))
C(ppm) = C * 44.1 * 1000
C = Concentration in Water
P = PPM of co2 in cup
C(ppm) = Concentration in PPM
T = Temp in Celsius
Here is where I got the constants from:
29.76 is Henry's constant for CO2 with STP. I can't find the exact resource I used to learn that, but this
website confirms it (I had a slightly different number but this seems to be the correct one)
8.314 is the Molar Gas Constant
2400 is the value given as the constant on the same page I listed above
also, after going over some of the resources, I altered Henry's Constant by using the equation below, opposed to the van't Hoff equation:
kH(T) = k°H exp(d(ln(kH))/d(1/T) ((1/T) - 1/(298.15 K)))
Sorry, I REALLY didn't want to make so many mistakes, but this is a project I have been working on for a while, andI got a little confused