Numerically find temperature in function of concentration....

In summary, the equation says that the concentration of oxygen dissolved in fresh water decreases with increasing temperature. Using the bisection method, I was able to develop a program to solve for the temperature given an initial approximation of the temperature and the concentration of oxygen dissolved in water.
  • #1
ramzerimar
178
23

Homework Statement


I don't even know if this is the correct forum for this question, but here we go. This exercise is from my numerical methods for engineers class, and it says the following:
The coefficient of saturation of oxygen dissolved in fresh water is given by the equation:

$$ \ln(o_{sf}) = - 139.34411 + \frac{1.575701e5}{T_a} - \frac{6.642308e7}{T_a^2} + \frac{1.243800e10}{T_a^3} - \frac{8.621949e11}{T_a^4}$$
Where osf is the concentration of saturation of oxygen dissolved in fresh water at 1atm(mg/L) and Ta is the absolute temperature (K). The problem gives some additional information: this equation can be used to determine the variation of oxygen concentration from 14,621 mg/L at 0ºC to 6,413 mg/L at 40ºC. Given this formula, the oxygen concentration, we can use bisection method to find the temperature.
So, given inital approximations 0 and 40ºC, develop some program using bisection method to determine T = Ta + 273,15 as a function of a given oxygen concentration with a error of 0.05ºC, for osf = 8, 10 and 12mg/L.

Homework Equations


Only the algorithm for the bisection method and the equation above.
The algorithm is:
  1. Find points a and b such that a < b and f(a) * f(b) < 0.
  2. Take the interval [a, b] and find its midpoint x1.
  3. If f(x1) = 0 then x1 is an exact root, else if f(x1) * f(b) < 0 then let a = x1, else if f(a) * f(x1) < 0 then let b = x1.
  4. Repeat steps 2 & 3 until f(xi) = 0 or |f(xi)| <= DOA, where DOA stands for degree of accuracy.

The Attempt at a Solution


Using the method is fine. I developed a program in C so I can solve functions using the bisection method. What I don't know is how can I use this method to find the temperature in celsius given those conditions. I mean, the bisection method will find roots of a function in a given interval, how to apply this to the problem?
I know it's a laborious problem, but I need some help figuring out what to do.
 
Last edited:
Physics news on Phys.org
  • #2
ramzerimar said:

Homework Statement


I don't even know if this is the correct forum for this question, but here we go. This exercise is from my numerical methods for engineers class, and it says the following:
The coefficient of saturation of oxygen dissolved in fresh water is given by the equation:

$$ \ln(o_{sf}) = - 139.34411 + \frac{1.575701e5}{T_a} - \frac{6.642308e7}{T_a^2} + \frac{1.243800e10}{T_a^3} - \frac{8.621949e10}{T_a^4}$$
Where osf is the concentration of saturation of oxygen dissolved in fresh water at 1atm(mg/L) and Ta is the absolute temperature (K). The problem gives some additional information: this equation can be used to determine the variation of oxygen concentration from 14,621 mg/L at 0ºC to 6,413 mg/L at 40ºC. Given this formula, the oxygen concentration, we can use bisection method to find the temperature.
So, given inital approximations 0 and 40ºC, develop some program using bisection method to determine T = Ta + 273,15 as a function of a given oxygen concentration with a error of 0.05ºC, for osf = 8, 10 and 12mg/L.

Homework Equations


Only the algorithm for the bisection method and the equation above.
The algorithm is:
  1. Find points a and b such that a < b and f(a) * f(b) < 0.
  2. Take the interval [a, b] and find its midpoint x1.
  3. If f(x1) = 0 then x1 is an exact root, else if f(x1) * f(b) < 0 then let a = x1, else if f(a) * f(x1) < 0 then let b = x1.
  4. Repeat steps 2 & 3 until f(xi) = 0 or |f(xi)| <= DOA, where DOA stands for degree of accuracy.

The Attempt at a Solution


Using the method is fine. I developed a program in C so I can solve functions using the bisection method. What I don't know is how can I use this method to find the temperature in celsius given those conditions. I mean, the bisection method will find roots of a function in a given interval, how to apply this to the problem?
I know it's a laborious problem, but I need some help figuring out what to do.

If you rewrite the equation above as:

$$- 139.34411 + \frac{1.575701e5}{T_a} - \frac{6.642308e7}{T_a^2} + \frac{1.243800e10}{T_a^3} - \frac{8.621949e10}{T_a^4} - \ln(o_{sf}) = 0$$

then aren't you using the bisection method to find Ta, if you are given osf?

BTW, if Ta is the absolute temperature, then shouldn't T = Ta - 273.15, where T is in °C ?
 
  • Like
Likes ramzerimar
  • #3
SteamKing said:
If you rewrite the equation above as:

$$- 139.34411 + \frac{1.575701e5}{T_a} - \frac{6.642308e7}{T_a^2} + \frac{1.243800e10}{T_a^3} - \frac{8.621949e10}{T_a^4} - \ln(o_{sf}) = 0$$

then aren't you using the bisection method to find Ta, if you are given osf?

BTW, if Ta is the absolute temperature, then shouldn't T = Ta - 273.15, where T is in °C ?
Yeah, I just realized I was confusing everything. By some reason, I was trying to rewrite the whole thing as a 4 degree polynomial in the form ax^4 + bx^3... It's so simple I'm ashamed.
Anyway, thanks for your help!
 
  • #4
  • Like
Likes ramzerimar
  • #5
gneill said:
Just a quick note: The exponent on the coefficient of the final term should be 11, not 10. See:

Office of Water Quality Technical Memorandum 2011.03

You might have some difficulty getting the results you expect if you didn't catch that.
Just corrected that in the post. Thanks for the hint. I can get the results now.
 

1. How is temperature related to concentration in a solution?

The relationship between temperature and concentration in a solution is known as the solubility curve. As the temperature increases, the solubility of a substance in a solution also increases. This means that more of the substance can dissolve in the solution at higher temperatures.

2. What is the equation for finding temperature in function of concentration?

The equation for finding temperature in function of concentration is known as the Van't Hoff equation. It is expressed as: ln(K2/K1) = -ΔH/R(1/T2 - 1/T1), where K is the equilibrium constant, ΔH is the enthalpy change, R is the gas constant, and T is the temperature in Kelvin.

3. Can temperature affect the concentration of a solution?

Yes, temperature can affect the concentration of a solution. As mentioned before, the solubility of a substance increases with temperature. This means that the concentration of a solution can change when the temperature changes, as more or less of the substance is able to dissolve.

4. How do you numerically find the temperature in function of concentration?

To numerically find the temperature in function of concentration, you will need to know the equilibrium constant for the reaction and the enthalpy change. These values can be determined experimentally. Then, you can use the Van't Hoff equation to calculate the temperature at a given concentration.

5. What factors can affect the accuracy of finding temperature in function of concentration?

The accuracy of finding temperature in function of concentration can be affected by several factors. These include experimental errors, such as incorrect measurements or equipment malfunctions, as well as external factors like pressure and impurities in the solution. It is important to conduct multiple trials and use proper techniques to minimize these errors and obtain more accurate results.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
16
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
Replies
8
Views
2K
Replies
7
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
3K
Replies
4
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Precalculus Mathematics Homework Help
Replies
2
Views
2K
  • Differential Equations
Replies
8
Views
1K
Back
Top