Numerically find temperature in function of concentration....

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
4 replies · 2K views
ramzerimar
Messages
178
Reaction score
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
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   Reactions: ramzerimar
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!
 
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.