Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'll be the first to admit, I am not a math wiz. That said, please forgive my ignorance. I need to write a script for work that will take a given temperature/pressure and output the other (pressure/temperature). How do I find the function of the data?

share|cite|improve this question
Try regression: – ziyuang May 20 '11 at 17:07
On the other hand, the ideal gas assumption might not hold for certain regimes of pressure/temperature, in which case equations of state that account for nonideality (e.g. van der Waals, Redlich-Kwong) might be needed. – J. M. Jul 31 '11 at 13:29
up vote 1 down vote accepted

First you should plot the data to see what it looks like. The ideal gas law suggests that if you have a closed volume and fixed amount of gas, the pressure will be proportional to the temperature. Excel will run a linear regression to give a straight line fit through the data and give you the equation of the line, so you could try that first. Excel will also do a higher order polynomial fit if the errors in the straight line fit are too large.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.