cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

MathCAD 15 Interpolation in 2D

cmcnamara-2
1-Newbie

MathCAD 15 Interpolation in 2D

Hey everyone, I was hoping that I could get some confirmation on how to do splining for interpolation in two dimensions.

Recently I've been working on a project that deals with the vaporization of propane so the use of propane saturation properties have been of great importance. MathCAD has been super useful in this respect by using splining and interpolation functions on the data from propane tables to automate calculations. This has been relativeley easy by selecting either Pressure or Temperature as the independent variable and using the functions to curve fit to that.

However recently, I've began to toy with the idea of doing the same with superheated/compressed liquid data but that makes for a more daunting task since these regions have no relation between Pressure and Temperature and therefore the properties require both temperature and pressure specified to be determined. Therefore any property (eg enthalpy, entropy, density, etc.) is of the form z=f(x,y).

I've seen some examples of how to go about this type of multivariate interpolation in MathCAD but I'm having a bit of trouble making sense of exactly how to go about it. I'm hoping my reasoning can be validated by someone. Here is what I think the steps would be:

1) Supply a vector of Temperature as independent.

2) Supply a vector of Pressure as independent.

3) Supply a matrix of properties such that the i-j component of the matrix is a property at Temperature i, Pressure j

4) Use the augment function on the matrix

5) Use a splining function on the matrix and the (x y) column vector.

6) Use the interpolation function with those values.

Is this close to what should be going on? Anyone have some other examples?

I appreciate the help in advance!

8 REPLIES 8
Werner_E
25-Diamond I
(To:cmcnamara-2)

You should state which version of Mathcad you use.

The kind of interpolation is available in Mathcad as well as in Prime. But in MC the table of values you would have to provide has to be quadratic and so most of the times you will have to create your own small routine (similar to what you outlined). If you browse through the forum you will find a lot of examples.

You may consider posting a sheet to show what you have done so far and where you got stuck.

EDIT: Sorry, wasn't looking close enough at the subject which states clearly that you use Mathcad 15.

Werner_E
25-Diamond I
(To:cmcnamara-2)

Here is an example which, as I think, will do what you demand.

RichardJ
19-Tanzanite
(To:cmcnamara-2)

I'm not sure what you intend with step 4, but yes, other than that you have the correct approach. The built-in spline functions can handle a square matrix. For a rectangular matrix, first interpolate one way (e.g. columns), then the other.

Christopher McNamara wrote:

Anyone have some other examples?

I have a lot some examples:

See one of them - http://twt.mpei.ac.ru/TTHB/2/R410aEng.html

Valery Ochkov wrote:

I have a lot some examples:

See one of them - http://twt.mpei.ac.ru/TTHB/2/R410aEng.html

Hmmm, the protected areas sure will be a great help to Christopher, I guess.

Werner Exinger wrote:

Valery Ochkov wrote:

I have a lot some examples:

See one of them - http://twt.mpei.ac.ru/TTHB/2/R410aEng.html

Hmmm, the protected areas sure will be a great help to Christopher, I guess.

Opsss. But no problem to send the password if Christopher needs.

Good answers above, but there is an additional point you might need to note if you are crossing a phase boundary. Some parameters, eg density, can change very rapidly across a phase boundary and a simple interpolation may not always give a good result. This problem can be minimised by using a very detailed matrix of values to be interpolated, or by using a more complicated interpolation algorithm than just fitting splines and using the interpolation function.

Alan

AlanStevens wrote:

Good answers above, but there is an additional point you might need to note if you are crossing a phase boundary. Some parameters, eg density, can change very rapidly across a phase boundary and a simple interpolation may not always give a good result. This problem can be minimised by using a very detailed matrix of values to be interpolated, or by using a more complicated interpolation algorithm than just fitting splines and using the interpolation function.

Alan

All proplems are solved.

Sorry - we try to solve its.

Do you need the password?

Announcements

Top Tags