How to Solve for T in the Wagner Equation using MatLAB

  • Thread starter CrazyDiamond
  • Start date
In summary, the Wagner Equation is being used to calculate vapour pressure at work. The equation uses variables T and p, and can easily find p when T is known. However, the conversation revolves around finding T when p is known. Some options discussed include using MatLAB or online equation solvers, but ultimately it is suggested to solve the equation approximately in Excel. Other potential solutions include using VBA in Excel or downloading a program like Pari/GP. Linear regression in Excel is also mentioned as a potential method.
  • #1
CrazyDiamond
5
0
I'm using the Wagner Equation for Vapour pressure at work.This equation is :

lnp=((-7.7069(1-T)) + (2.4932(1-T)^1.5158) -(2.9212(1-T)^1.9907) -(3.8684(1-T)^4.3798) + (0.46898(1-T)^1.7461) - (0.00008336))/x

[I haven't been able to find an online version of this equation]

Here, T and p are variables. Its obviously easy to find p if I know T, but now I need to find T given that p is known. This is getting very complicated, and I don't have access to MatLAB either.Could someone who has MatLAB please help me out - I simply need an equation for T in terms of p.

Online Equation solvers give me an answer for T if I feed in the equation, but they do not give me an equation for T, which is what I need so I can put it into an Excel Spreadsheet.

Thanks.
 
Mathematics news on Phys.org
  • #2
Don't think there is an analytical solution for this equation.
 
  • #3
I also don't think there is an analytical solution.

If you must, you can probably solve it approximately in Excel (without scripting!) with bisection. If you want 9 decimals of precision you'll need ~30 rows for the calculation.

You could solve it with VBA in Excel, though you'll get warnings about the script being potentially unsafe whenever you open it. (Kinda makes you wish Excel could tell when no file access was being done by the script...)

You could download any number of programs, like Pari/GP, that would make solving it simple. Of course then you'd have to enter the data into Excel manually.
 
  • #4
I used linear regression in Excel..my boss is too stingy to give me access to VBA.
Thanks for the help guys !
 

1. What is the Wagner Equation?

The Wagner Equation is a mathematical formula used to describe the behavior of a fluid near its critical point. It was developed by German physicist Johannes Wagner in 1883 and is commonly used in thermodynamics and fluid mechanics.

2. How is the Wagner Equation used in science?

The Wagner Equation is used to calculate the thermodynamic properties of fluids near their critical point, such as density, pressure, and temperature. It is also used to predict phase transitions and critical points in various systems.

3. What are the limitations of the Wagner Equation?

The Wagner Equation is only accurate for fluids that behave according to the Van der Waals equation of state. It also does not account for changes in composition or chemical reactions.

4. Can the Wagner Equation be applied to all fluids?

No, the Wagner Equation is only applicable to fluids that exhibit critical behavior. This includes substances such as water, carbon dioxide, and ammonia.

5. Are there different versions of the Wagner Equation?

Yes, there are different versions of the Wagner Equation that have been modified to account for different variables or to improve accuracy. Some examples include the Redlich-Kwong-Soave equation and the Peng-Robinson equation.

Similar threads

Replies
2
Views
250
Replies
3
Views
7K
  • General Math
Replies
7
Views
3K
  • Calculus and Beyond Homework Help
Replies
2
Views
195
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
  • Introductory Physics Homework Help
Replies
5
Views
3K
Replies
2
Views
1K
  • Precalculus Mathematics Homework Help
Replies
8
Views
574
  • Differential Equations
Replies
3
Views
2K
Replies
5
Views
1K
Back
Top