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

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

Correcting units

ptc-3820221
1-Newbie

Correcting units

I converted a file from Mathcad 15 to Mathcad Prime and I am now having trouble with some of the units. The values are correct and match what I calculated in 15, but I can't get the units to read out correctly. They should be in*lb, but it keeps adding 1/kg*m to the units. If I switch to USCS for the unit system, it adds 1/ft*lbf and then the value is incorrect. I'm wondering if it has something to do with the excel inputs I added, as this is the only addition I've made after converting to Prime. I've attached the file for reference.

Any help would be appreciated, thanks!

1 ACCEPTED SOLUTION

Accepted Solutions

I guess the problem are the input values at the top of the Excel component. You feed the component with values of unit lb*in but Prime has to strip the units as Excel doesn't understand units. But Prime does not strip lb*in just because you defined the values that way, but it will strip the default units which are kg*m in your sheet. So Excel gets wrong values. So you have to strip the units yourself by just dividing by the correct units and add the units you want at the end for the output variables. I hope this solves your problem - you don't state in your file which values are wrong and what the correct result is you expect, so I can only guess.

24.04.png

View solution in original post

8 REPLIES 8

Not sure why you expect something else.

The problem seems to be that you read M.total and M.section via Excel component and those moments are dimensionless. You should add the appropriate units - you can do this directly in the Excel component:

24.04.png

Yes, but where to add them? I've tried adding them in the excel output definition (as you have shown) and it seems to correct the units, but the caluculated value is no longer correct. The values in the excel spreadsheet are defined earlier in the matchcad sheet, with units. Do they need to be redefined once I input them into the excel sheet?

I guess the problem are the input values at the top of the Excel component. You feed the component with values of unit lb*in but Prime has to strip the units as Excel doesn't understand units. But Prime does not strip lb*in just because you defined the values that way, but it will strip the default units which are kg*m in your sheet. So Excel gets wrong values. So you have to strip the units yourself by just dividing by the correct units and add the units you want at the end for the output variables. I hope this solves your problem - you don't state in your file which values are wrong and what the correct result is you expect, so I can only guess.

24.04.png

Sorry about the lack of information, but even without it, you've been very helpful! That did the trick. I've updated it and reattached it....wondering if you can now help me figure out how to take my final values and input them into one more excel spreadsheet. I have tried to input the out.mx1 and out.mx2 into an excel sheet, but i must have something wrong in my syntax, because the two columns are reading out out values that don't match the results of the calculation.

Its the same problem again!

You expect the values in lb/in^2 but Mathcad strips kg/m^2 when it hands over the values to Excel.

The solution also is the same as before - strip the units yourself by dividing by lb/in^2 (or probably better by muliplying with in^2/lb).

You're right, I can't believe I missed that! It certainly corrected the values so they are the correct units, but they still are the same in the two columns, when they should be different (since out.mx1 does not equal out.mx2). Suggestions?

since out.mx1 does not equal out.mx2.

Thats not true! both functions are defined the same (max(x,y); necessary, as we cannot vectorize max()) and you provide the very same arguments (your old sigmas are gone!!), so its no surprise that the results are the same, too.

I guess you had something like the attched in mind.

Thank you! I had wondered about that when I first set it up (before adding the excel component) and when it worked initially I didn't think more about it, but I can now see why that was the problem. Thanks for all your help. Everything is in working order now.

Top Tags