Numerically find temperature in function of concentration....

Click For Summary

Discussion Overview

This thread discusses a numerical methods problem related to finding the temperature as a function of oxygen concentration in fresh water using the bisection method. Participants explore the application of a specific equation that relates the saturation concentration of oxygen to temperature, and how to implement a numerical solution to find temperature values based on given concentrations.

Discussion Character

  • Homework-related
  • Mathematical reasoning
  • Technical explanation

Main Points Raised

  • One participant presents the equation for the coefficient of saturation of oxygen and outlines the problem statement, including the need to use the bisection method to find temperature.
  • Another participant questions how to apply the bisection method to find temperature in Celsius, suggesting that rewriting the equation could clarify the process.
  • There is a discussion about the correct formulation of the equation, with one participant noting a potential error in the exponent of the final term, which could affect the results.
  • Participants clarify that the absolute temperature Ta should be converted to Celsius by subtracting 273.15, correcting a misunderstanding about the temperature conversion.

Areas of Agreement / Disagreement

Participants generally agree on the approach to use the bisection method for finding temperature, but there is some initial confusion regarding the formulation of the equation and the correct conversion to Celsius. The discussion reflects a mix of clarifications and corrections without a definitive consensus on the final implementation details.

Contextual Notes

There are unresolved aspects regarding the implementation of the bisection method and the specific conditions under which it should be applied. Additionally, the potential error in the equation's exponent may impact the accuracy of the results, but this has been acknowledged and corrected by participants.

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!
 
  • Like
Likes   Reactions: ramzerimar
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.
 

Similar threads

  • · Replies 16 ·
Replies
16
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 7 ·
Replies
7
Views
5K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 14 ·
Replies
14
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K