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 PTC Community Badges. Engage with PTC and see how many you can earn! X

linterp, matrix help

uclphd
1-Newbie

linterp, matrix help

Hi,

Finding difficulty in plotting values in a matrix as a function of a variable (based on equations) using the matchad Linterp function. I have attached a mathcad file, if you go through should make sense in what i'm trying to do.

Would be gratefull of any help with this.

Many Thanks.

15 REPLIES 15
StuartBruff
23-Emerald II
(To:uclphd)

Could you possibly post the worksheet in Mathcad 11 or 13 format as well, please?

Stuart

MikeArmstrong
5-Regular Member
(To:StuartBruff)

As requested

Mike

Does the attached help?

Alan

Hi all , thanks for your replies.

Stuart, attached is the problem in version 11.

Mike, unfortunately you attached my original problem.

Alan, the plots do not look correct. If you plot based on Ce being a constant you will see the shape of the plot. What is it that I need to do to adapt what I currently have to take into account Ce as a variable?

If you go through what I have attached it should be clear.

Many Thanks.

MikeArmstrong
5-Regular Member
(To:uclphd)

Mike, unfortunately you attached my original problem.

Yes, but saved as an M11 format as requested by Stuart.

Mike

Ah I see. Thanks Mike

MikeArmstrong
5-Regular Member
(To:uclphd)

Still not fully clear what your after, or maybe its me.

What are you trying to plot Ce against?

Mike

In Problem 1.2 attached the value of Ce is a constant (ignore it's heading "variable")

The matrix B1 Desribes what I want ploted. Column 1 against 0. However as it stand in the mathcad file Ce is a constant.

If you look at equations 1.1, 1.2 and 1.3 you will see that they are all functions of Ce. Therefore the consequent equations 1.4, 1.5 and 1.6 will be effected Ce is varied e.g Ce=1,1.1...20. Consequently matrix B1 will be effected and will have to be made a function of Ce as it's values tab, tdb and Fb are all functions of Ce.

As mentioned, in the current file attached Ce is a constant therfore you get just the one triangular shaped plot. How would I go about representing the same plot for varying Ce? (which would give me a range of linear interpolation "curves" of matrix B1 on the same plot.)

I'm sure there is an efficient way of doing it on Mathcad, i'm just unsure how.

Thanks.

You need to learn about functions.

Thanks for that, however how would you plot it the curves over a range of Ce, without having to plot on the axis for each value of Ce? is that in the "functions" help on mathcad?

You can make a three dimensional plot. If you want to put multiple plots of the triangular "curves" onto one 2D plot, that can be done; but labelling which Ce for each line is going to be problematic!

Hi Alan, taking a look again I think that you have plotted correctly. Many Thanks for your help.

Difficulty in using the information from matrix B1 and b1 (as you programmed) to input into the pslpline and interp functions. error states "This value must be a matrix of real numbers" - what can I do to ensure they are real numbers? Is it due to the NaN Spacer in the b1 program?

Have attached file to show in M11 to illustrate.

Gratefull of any help. Thank you.

Omar Al-Omar wrote:

Difficulty in using the information from matrix B1 and b1 (as you programmed) to input into the pslpline and interp functions. error states "This value must be a matrix of real numbers" - what can I do to ensure they are real numbers? Is it due to the NaN Spacer in the b1 program?

Have attached file to show in M11 to illustrate.

Gratefull of any help. Thank you.

I wouldn't use spline fits on this data, just use linterp. The NaN's were there simply to aid the graphing. See attached for a couple of options that might (or might not!) help.

Alan

Thanks Alan. I really need to start familiarising myself with the programming functions on mathcad, hopefully your examples will help.

Omar

Top Tags