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

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

Units and Functions

hvanderwalt
1-Newbie

Units and Functions

Hi everyone

I am fairly new to Mathcad and hope to find an answer here for a problem I have. I have written a function that calculates material condictivity and takes a temperature as an argument:

k(T) := A*T^2 + B*T + C W/m*K

It works fine but refuses to accept anything but a unitless temperature input. How do I specify the units of function arguments?

Thanks
Hannes
6 REPLIES 6

Posting a worksheet would be helpful.

The formula you typed only used a variable "T", and Mathcad has no way of knowing you meant for it to be a temperature unit. Depending on the format of the result, you may need to "divide out" the temperature unit in the function assignment.

Thanks,
Preston
PhilipOakley
5-Regular Member
(To:ptc-1176891)

If T is in Kelvin, then A must be in units of per Kelvin^2, likewise for each term so that all the terms become unitless so can be added. (assuming you want the result to be unitless)

Note that temperture units can be very awkward because most folk (and their empirical equations) don't start at absolute zero...

Probably a good time to take a few moment to go through the tutorial sheets on units and temperature.

Philip Oakley

In the equation as written, if A and B are unitless constants, then T has to be dimensionless. Otherwise you would be trying to add a temperature to the square of a temperature, an operation that makes no sense and is not allowed by Mathcad.

Assuming that that unit expression tacked on at the end represent the units that you want for the result, then you need for C to have the units of the result, W/(m·K), B must have units of that over K, W/(m·K²), and A must have units of W/(m·K³). Or at least units representing those dimensions. You can input the values using any units you wish, as long as the result represents the correct physical quantity.

That is the basis for Mathcad's unit support -- it stores representations of physical quantities, not specific units. Thus it makes absolutely no difference if you define a variable as 1000·m or 1·km -- they both represent the same length, and are stored by Mathcad exactly the same.
__________________
� � � � Tom Gutman

See in attached file.
Viktor Korobov
Viktor

>I have written a function that calculates material conductivity ...<<br> __________________________

Which material conductivity ? thermal, electric ... ?
Your formulation is inconsistent, nothing to do with your formula, get one that works from Engineering and convert the variable if not in the unit system it was designed for .

jmG

Thanks vikkor, that was exactly what I was wanting to know! You are a champion! Thanks also to all who had mercy on a new user!
Hannes
Top Tags