Get Help

Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Community
- :
- PTC Mathcad
- :
- PTC Mathcad
- :
- Interpolations and extrapolation of matrix.

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

11-04-2019
05:22 AM

11-04-2019
05:22 AM

Hello,

Newly introduced to MathCAD Prime 6.0 here and I want to put the following image as a matrix. Then, write a program where, at any given roof angle, between 0-30, and 1) if solidity ratio is 0 or 1, then interpolate to get corresponding Cp value. 2) if solidity ratio is between 0 and 1, then do bi-linear interpolation to get a corresponding Cp value. 3) if solidity ratio is greater than 1, then extrapolate to get a corresponding Cp value.

Would really appreciate some help on how I could go about this. Thank you!

*EDIT* I have now been able to convert this data as a matrix. I used another thread as an example to be able to extract the roof angle matrix, Solidity ratio = [0 1] and the Cp values matrix. After this I am stuck on how to program the conditions stated above. Please refer to the mdcx file attached. Also familiar with the linterp, and interp functions. But unsure on how to use them for my requirements.

Solved! Go to Solution.

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

11-04-2019
09:14 AM

11-04-2019
09:14 AM

I did not look at your sheet as it wasn't attached from the beginning.

Unfortunately you don't show in the sheet you attached how you used my function.

So my best guess is that you forgot to transpose y.

The row and column headers must both be (column)vectors.

9 REPLIES 9

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

11-04-2019
06:51 AM

11-04-2019
06:51 AM

Re: Interpolations and extrapolation of matrix.

Look up interpolation functions such as linterp(), interp() and spline functions.

Success!

Luc

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

11-04-2019
07:00 AM

11-04-2019
07:00 AM

Re: Interpolations and extrapolation of matrix.

Hello, thank you for replying. I took a look at those functions earlier and added a worksheet to my original post with an update on what I did. Did something which seemed to work out but again hit another road block.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

11-04-2019
07:19 AM

11-04-2019
07:19 AM

Re: Interpolations and extrapolation of matrix.

I guess the routine(s) I posted here

should help.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

11-04-2019
08:06 AM

11-04-2019
08:06 AM

Re: Interpolations and extrapolation of matrix.

Hi, I actually used your and another person's feedback to create my solution. But in the f(x,y) values, when I input the values in the function, such as f(11,0). Then I get an error saying "this value must be a vector".

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

11-04-2019
09:14 AM

11-04-2019
09:14 AM

I did not look at your sheet as it wasn't attached from the beginning.

Unfortunately you don't show in the sheet you attached how you used my function.

So my best guess is that you forgot to transpose y.

The row and column headers must both be (column)vectors.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

11-04-2019
01:12 PM

11-04-2019
01:12 PM

Re: Interpolations and extrapolation of matrix.

The Cp() function below may be what you are looking for.

Success!

Luc

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

11-04-2019
11:50 PM

11-04-2019
11:50 PM

Re: Interpolations and extrapolation of matrix.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

11-05-2019
12:04 AM

11-05-2019
12:04 AM

Re: Interpolations and extrapolation of matrix.

You're absolutely right. I didn't transpose the "y" submatrix. Thank you very much for your help. Really appreciate it.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

11-05-2019
12:06 AM

11-05-2019
12:06 AM

Re: Interpolations and extrapolation of matrix.

Hello, thank you for your solution. It was just as helpful as the other person as it gave a better perspective in programming the solution. Really appreciate your feedback.