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

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Interpolation of a Matrix

cedwards
1-Newbie

Interpolation of a Matrix

I am doing some strain evaluation for dents in natural gas pipelines. I am looking to interpolate matrix to generate a larger matrix with more points. I am not sure how to go about doing this in mathcad.

My Matrix can vary in rows in and columns based on the user input. For this example 18 rows and 85 columns. Essentially I am looking to have more data points in order to evaluate the dent geometry.

1 ACCEPTED SOLUTION

Accepted Solutions

Curtis Edwards wrote:

It should provide a smoother dent profile (i.e.more points to run strain calculations on). I have attached the matrix above. Essentially from left to right it is measurements of the dent depth in the longitudinal direction and from top to bottom it is in the circumfrential direction.

The measurements are taken by gridding the pipe with half-inch squares and taking a measurement in each grid. When I receive the data it is merely a matrix like the one attached.

Your profile won't get smoother so maybe some kind of regression is more appropriate. You woud have to decide what kind to choise.

For whatever its worth here is a sheet which seems to do what you want using interpolation.

As an example I doubled the intervals in both directions. Here are the results with linear interpolation and cspline interpolation.

1.png

View solution in original post

13 REPLIES 13

May be so

http://twt.mpei.ac.ru/ochkov/TTMI/1/1-2.png

Which version of Mathcad? Prime or real Mathcad?

Mathcad 15.

Im working off a sheet that a previous employee used to generate strain values on a dent. The strain values are approximated using a centered finite difference method. I am trying to track what the individual was doing but get lost at a point in the calculations.

In all references I've read it suggests using bspline interpolation. I'm not familar with that either.

RichardJ
19-Tanzanite
(To:cedwards)

Don't use bspline. It doesn't necessarily interpolate data, because it is not forced to go through the existing data points. You can use either linear interpolation or spline interpolation, but then you should use cspline (or lspline or pspline, they are almost the same). To interpolate a matrix, just interpolate in one direction, then the other (for example, interpolate the columns to generate another row, then interpolate the rows to generate another column).

Curtis Edwards wrote:

Mathcad 15.

Im working off a sheet that a previous employee used to generate strain values on a dent. The strain values are approximated using a centered finite difference method. I am trying to track what the individual was doing but get lost at a point in the calculations.

In all references I've read it suggests using bspline interpolation. I'm not familar with that either.

Here are routines for 2D and even 3D interpolation you might find useful. I provided routines for linear and all three types ofspline interpolation for 2D interpolation. 3D is only using linear interpolation but can easaily changed to allow for splines, too.

RichardJ
19-Tanzanite
(To:Werner_E)

A handy set of functions.

The worksheet could use an example or two though

Richard Jackson wrote:

A handy set of functions.

The worksheet could use an example or two though

You are right. The routines basically stem from this thread http://communities.ptc.com/message/219752#219752

where it was used in the context of a specific problem.

Curtis Edwards wrote:

Mathcad 15.

Mathcad 15 (Not real Mathcad Prime) WITH NOT FULL MATRIX:

http://twt.mpei.ac.ru/ochkov/TTMI/1/1-7.png

What if I do not have any column headers?

Can I still interpolate ?

I have matrix of n rows and m columns

i,j is the position in the matrix (X.0,0 being the orgin)

Attached is an example of the matrix I want to interpolate. I would like to take Matrix (G) and return an interpolated version of G (G2).

Thanks

Curtis Edwards wrote:

What if I do not have any column headers?

Can I still interpolate ?

Sure. Do you mean you don't know the meaning of the rows and columns in the matrix you have? In this case you may just use the row and column indices. But you have to be aware that adding values via interpolation does in no way add any precision and you sure will not get any additional information.

Maybe you set up a simplified worksheet and post it here to demeonstrate what exactly you need. In fact I am nor sure in which way additional interpolated matrix values would help you "to evaluate the dent geometry" as you wrote.

EDIT: OK, you edited your post while I was typing this reply and have added a sheet with a 18 x 85 matrix. Now we would need to know what exactly you mean with "interpolated version of G". What would you like your new matrix G2 look like? Again, you can magically add by interpolation additional information which simply is not here. So what exactly is the purpose of the interpolation you have in mind?

It should provide a smoother dent profile (i.e.more points to run strain calculations on). I have attached the matrix above. Essentially from left to right it is measurements of the dent depth in the longitudinal direction and from top to bottom it is in the circumfrential direction.

The measurements are taken by gridding the pipe with half-inch squares and taking a measurement in each grid. When I receive the data it is merely a matrix like the one attached.

RichardJ
19-Tanzanite
(To:cedwards)

Interpolation will not provide a smoother dent profile. All your existing points will be the same. Interpolation adds additional points between the ones you have, but it does not smooth anything.

Curtis Edwards wrote:

It should provide a smoother dent profile (i.e.more points to run strain calculations on). I have attached the matrix above. Essentially from left to right it is measurements of the dent depth in the longitudinal direction and from top to bottom it is in the circumfrential direction.

The measurements are taken by gridding the pipe with half-inch squares and taking a measurement in each grid. When I receive the data it is merely a matrix like the one attached.

Your profile won't get smoother so maybe some kind of regression is more appropriate. You woud have to decide what kind to choise.

For whatever its worth here is a sheet which seems to do what you want using interpolation.

As an example I doubled the intervals in both directions. Here are the results with linear interpolation and cspline interpolation.

1.png

Top Tags