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

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

Including units with the polyfit function

ptc-6130833
1-Newbie

Including units with the polyfit function

Hello all,

I am a fairly new user of Mathcad. I have a question about utilizing units with the polyfit function. I have experimental data relating temperature pressure and density. I wrote a program which needs to look up the density as a function of pressure and temperature. The original data was in excel, it had several curves for a few temperatures as a function of pressure.The data was very linear and the curves were fairly parallel, so i took the linear regression curves from excel and brought them into mathcad. I then created a program which allowed me to choose a temperature, it would then choose the two curves which the chosen temperature was between and linearly interpolated between the two points. I got this program to work with units and is the top portion of the attached file.

I thought there must be a better way, so I decided to try the polyfit function. I imported the test data and utilized the polyfit function to "fill in" the holes in my data and create a polynomial to describe the surface. I could not get the polyfit function to work with units. The polyfit is a much more elegant solution. Both approaches give very close results but I was wondering if anyone else was having this same type of problem?

The reason I need the units to work out is because I reference this calculation in a program. I apologize but I can not attach the program.

Thanks in advance for any help/ insight.

1 ACCEPTED SOLUTION

Accepted Solutions
RichardJ
19-Tanzanite
(To:ptc-6130833)

The polyfit function works fine with units. The problem is that the 3D plot will not accept units on the x or y axes (lame, but true).

View solution in original post

2 REPLIES 2
RichardJ
19-Tanzanite
(To:ptc-6130833)

The polyfit function works fine with units. The problem is that the 3D plot will not accept units on the x or y axes (lame, but true).

Thank you, I should have seen that.

Top Tags