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

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

Programming with units

drgriffin
1-Newbie

Programming with units

How well does 14 handle units in programs ? I know earlier versions didn't do so well.
8 REPLIES 8
RichardJ
19-Tanzanite
(To:drgriffin)

The only real problem I can think of with units in programs is returning multiple values with different units. In this respect Mathcad 14 is the same as before. The only way to return multiple values is in an array, and mixed units are not allowed in arrays.

Richard

On 11/10/2009 3:42:25 PM, rijackson wrote:
>The only real problem I can
>think of with units in
>programs is returning multiple
>values with different units.
>In this respect Mathcad 14 is
>the same as before. The only
>way to return multiple values
>is in an array, and mixed
>units are not allowed in
>arrays.

Richard

Second problem - if(...,kg,m)

Val
http://twt.mpei.ac.ru/ochkov/v_ochkov.htm

On 11/11/2009 4:04:08 AM, VFO wrote:

>Second problem - if(...,kg,m)

Well, that's just a problem with SUC. It's not specific to programming.

Richard

On 11/11/2009 8:49:16 AM, rijackson wrote:
>On 11/11/2009 4:04:08 AM, VFO wrote:
>
>>Second problem - if(...,kg,m)
>
>Well, that's just a problem with SUC.
>It's not specific to programming.
>
>Richard
OK!
kg if ...
m otherwise

Val
http://twt.mpei.ac.ru/ochkov/v_ochkov.htm

So if you're returning multiple values with different units from your program, the last step has to be to divide by the appropriate units to make all the values unitless. Then you have to re-attach (multiply) those units after exiting the program.

Preston

On 11/10/2009 3:42:25 PM, rijackson wrote:
>The only real problem I can
>think of with units in
>programs is returning multiple
>values with different units.
It's not specific to programming too.

Val
http://twt.mpei.ac.ru/ochkov/v_ochkov.htm

On 11/11/2009 12:59:03 PM, VFO wrote:

>It's not specific to programming too.

True. I could write a function with no programming that had the same problem.

Richard

On 11/11/2009 1:44:12 PM, rijackson wrote:
>On 11/11/2009 12:59:03 PM, VFO wrote:
>
>>It's not specific to programming too.
>
>True. I could write a function with no
>programming that had the same problem.
>
>Richard
It is only one programming tool in Mathcad - Add Line operator.
Local vars we see in the summ operator (i)
While has until operator analog...


Val
http://twt.mpei.ac.ru/ochkov/v_ochkov.htm
Top Tags