Interpolating a Surface: Finding Approximations for Thermodynamic Properties

  • Thread starter Saladsamurai
  • Start date
  • Tags
    Surface
In summary, the conversation discusses the method of linear interpolation for approximating a value of a function f(x,y) within a small interval between two known points (x1, y1) and (x2, y2). The conversation also mentions a possible alternative method using a general plane, but points out that it requires more information to accurately estimate the two partial derivatives. The person asking the question provides an example of needing to approximate a value of v for a given value of pressure (P) using tabulated data.
  • #1
Saladsamurai
3,020
7
So I have this surface that I am trying to make approximations on. Now I have values for [itex]f(x_1,y_1)[/itex] and [itex]f(x_2,y_2)[/itex]. I want to find the value of [itex]f(x,y)[/itex] where x and y lie between (x1, x2) and (y1, y2). I am willing to assume that f changes linearly in both x and y for this small interval. Would the appropriate interpolation function then be

[tex]f(x,y)=f(x_1,y_1) + \frac{f(x_2,y_2) - f(x_1,y_1)}{x_2 - x_1} *(x - x_1) + \frac{f(x_2,y_2) - f(x_1,y_1)}{y_2 - y_1} *(y - y_1)[/tex]

?

I feel like it would be ... but I also feel like it could be

[tex]
f(x,y)=
f(x_1,y_1) +
\sqrt{
[\frac{f(x_2,y_2) - f(x_1,y_1)}{x_2 - x_1} *(x - x_1)]^2
+
[\frac{f(x_2,y_2) - f(x_1,y_1)}{y_2 - y_1} *(y - y_1)]^2
}
[/tex]What do you think? I am really confusing myself here :smile: First or second one?
 
Physics news on Phys.org
  • #2
Your second possibility isn't first degree in its variables, which is what I think you mean. Let's say f(x1,y1) = z1 and f(x2,y2) = z2

Then a general plane through the first point would be:

z = a(x-x1) + b(y - y1) + z1.

Making the plane go through the second plane requires:

z2 = a(x2-x1) + b(y2 - y1) + z1

This does not completely determine a and b. The problem is that there are infinitely many planes, first degree in each variable, passing through those two points, so there isn't any reasonable way to pick a best one. If you think about the straight line joining your two points in 3D, any plane containing that line interpolates your two points. You need another condition.
 
  • #3
Hi LCKurtz :smile: I think I am more confused now haha. I am thinking along the lines of something like this: I have some value f(x1,y1). Now couldn;t I say that for some local region "around" the point (x1,y1) I can approximate f(x,y) = f(x1,y1) + Δf where Δf is the "finite analog" to [itex]df = (\partial{f} /\partial{x})*dx + (\partial{f}/\partial{y})*dy[/itex].

Am I still missing your point? Or does that work? Note that this is a "real problem" that I am working on here. I have some tabulated data and I am making some assumptions about the nature of the unknown funciton.

Thanks.
 
  • #4
LCKurtz said:
Your second possibility isn't first degree in its variables, which is what I think you mean. Let's say f(x1,y1) = z1 and f(x2,y2) = z2

Then a general plane through the first point would be:

z = a(x-x1) + b(y - y1) + z1.

Making the plane go through the second plane requires:

z2 = a(x2-x1) + b(y2 - y1) + z1

This does not completely determine a and b. The problem is that there are infinitely many planes, first degree in each variable, passing through those two points, so there isn't any reasonable way to pick a best one. If you think about the straight line joining your two points in 3D, any plane containing that line interpolates your two points. You need another condition.

Saladsamurai said:
Hi LCKurtz :smile: I think I am more confused now haha. I am thinking along the lines of something like this: I have some value f(x1,y1). Now couldn;t I say that for some local region "around" the point (x1,y1) I can approximate f(x,y) = f(x1,y1) + Δf where Δf is the "finite analog" to [itex]df = (\partial{f} /\partial{x})*dx + (\partial{f}/\partial{y})*dy[/itex].

Am I still missing your point? Or does that work? Note that this is a "real problem" that I am working on here. I have some tabulated data and I am making some assumptions about the nature of the unknown funciton.

Thanks.

Yes, you could with more information. That is the same thing as my suggestion z = a(x-x1) + b(y - y1) + z1 where your two partials are my a and b. The problem is that you don't have enough information to estimate the two partials fx and fy, which are a and b.
 
  • #5
LCKurtz said:
Yes, you could with more information. That is the same thing as my suggestion z = a(x-x1) + b(y - y1) + z1 where your two partials are my a and b. The problem is that you don't have enough information to estimate the two partials fx and fy, which are a and b.

I am sorry, I still don't follow. I thought that I did estimate the two partials :confused:

[tex](\partial{f} /\partial{x}) \approx \frac{f(x_2,y_2) - f(x_1,y_1)}{x_2 - x_1} \text{ and }(\partial{f} /\partial{y}) \approx\frac{f(x_2,y_2) - f(x_1,y_1)}{y_2 - y_1}
[/tex]
 
  • #6
But you wouldn't estimate the fx by changing the y variable nor fy by changing the x variable. You would hold the other variable constant.

Anyway, I'm guessing you haven't really posted what you want or need. Bivariate approximation is a big subject. Do you have a rectangular grid in the xy plane where you know the values? Or scattered values?

I would suggest you Google interpolation of surfaces and look around. You might find just what you need.
 
  • #7
LCKurtz said:
But you wouldn't estimate the fx by changing the y variable nor fy by changing the x variable. You would hold the other variable constant.

Anyway, I'm guessing you haven't really posted what you want or need. Bivariate approximation is a big subject. Do you have a rectangular grid in the xy plane where you know the values? Or scattered values?

I would suggest you Google interpolation of surfaces and look around. You might find just what you need.

Actually, I have been Googling around and got so confused that I came here :redface:

Let me post an example. I have a bunch of data tabulated as follows,

Screenshot2010-08-23at122349AM.png


You can see that for some value of "P" in the header (for example P = 0.06 MPa) we have a bunch of Temperatures and corresponding values of properties. For example for
P = 0.06 MPa we can scroll down to T = 10 and see that the corresponding value of v is
v = 0.37861.

Similarly we can see that for P = 0.10 MPa and T = 30 we have v = 0.24216.

My question is what if I want to approximate a value of v for P = 0.08 MPa and T = 15 ?

I cannot seem to figure out what kind of bivariate interpolation this falls under, nor do I know what determines which kind of interpolation I should use. It seems like I have a regular rectangular grid here... I think. But not all of the tables like the ones above have the same temperature range. But working with the 2 above would be a good start.
 
  • #8
This is getting a bit out of my area of expertise. One method I have read a bit about is the quadratic Shepard's method. This interpolates 2d data with a smooth quadratic function. There are implementations in Fortran and I suppose other languages. For example, look at:

http://people.sc.fsu.edu/~jburkardt/f_src/qshep2d/qshep2d.html

I'm afraid beyond that, I can't help you much.
 
Last edited by a moderator:
  • #9
LCKurtz said:
This is getting a bit out of my area of expertise. One method I have read a bit about is the quadratic Shepard's method. This interpolates 2d data with a smooth quadratic function. There are implementations in Fortran and I suppose other languages. For example, look at:

http://people.sc.fsu.edu/~jburkardt/f_src/qshep2d/qshep2d.html

I'm afraid beyond that, I can't help you much.

Ok. thanks for your help! :smile: I have never had to interpolate about 2 axes before. I have done plenty of regular linear interpolation and thought it was a simple jump to do 2D. I guess I thought wrong, eh? :smile:
 
Last edited by a moderator:
  • #10
Saladsamurai said:
You can see that for some value of "P" in the header (for example P = 0.06 MPa) we have a bunch of Temperatures and corresponding values of properties. For example for
P = 0.06 MPa we can scroll down to T = 10 and see that the corresponding value of v is
v = 0.37861.

Similarly we can see that for P = 0.10 MPa and T = 30 we have v = 0.24216.

My question is what if I want to approximate a value of v for P = 0.08 MPa and T = 15 ?

For these kind of thermodynamic problems, there can be different formulas for different input variable ranges e.g. PV = mRT is one simple formula. However, heat transfer has different formula for different ranges of the inputs.

Best possible thing I can think of at the moment is getting sufficient information to construct a plane. Two points A and B have infinite number of planes. If you get one or more points, you make a plane and use the points as estimation. This should work for smooth graphs without discontinuities.
 
Last edited:

1. What is surface interpolation?

Surface interpolation is a method used to create a continuous surface from a set of discrete data points. It involves estimating the values of data points that lie between known data points, in order to create a smooth and continuous surface.

2. What are the applications of surface interpolation?

Surface interpolation is commonly used in various fields such as computer graphics, geology, meteorology, and geographic information systems. It is used to create 3D models, map terrain, and predict weather patterns, among other applications.

3. What are the different interpolation methods for surfaces?

There are several methods for surface interpolation, including linear interpolation, polynomial interpolation, and spline interpolation. These methods differ in their approach to estimating values between data points and have varying levels of accuracy and complexity.

4. What are the factors that affect the accuracy of surface interpolation?

The accuracy of surface interpolation depends on various factors, such as the distribution of data points, the type of interpolation method used, and the degree of smoothness desired. In general, a higher density of data points and the use of more complex interpolation methods can result in a more accurate surface.

5. How can surface interpolation be visualized and evaluated?

Surface interpolation results can be visualized through 3D plots, contour maps, and other forms of graphical representations. The accuracy of the interpolation can be evaluated by comparing it to the original data points and by measuring the error or deviation from the actual values.

Similar threads

  • Calculus and Beyond Homework Help
Replies
5
Views
1K
  • Calculus and Beyond Homework Help
Replies
2
Views
666
  • Calculus and Beyond Homework Help
Replies
3
Views
4K
  • Calculus and Beyond Homework Help
Replies
2
Views
744
  • Calculus and Beyond Homework Help
Replies
9
Views
543
Replies
3
Views
730
  • Calculus and Beyond Homework Help
Replies
9
Views
2K
  • Calculus and Beyond Homework Help
Replies
1
Views
1K
  • Calculus and Beyond Homework Help
Replies
5
Views
1K
  • Linear and Abstract Algebra
Replies
17
Views
1K
Back
Top