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

The community will undergo maintenance on October 16th at 10:00 PM PDT and will be unavailable for up to one hour.

Function returning two vectors, but with different units

ClaudioPedrazzi
11-Garnet

Function returning two vectors, but with different units

Hi everybody,

I am trying to build a function that should give back two vectors (and that is not the problem), only those vectors have different units.

The only way I can imagine is to adimensionalize the vectors, using UnitsOf (or SIUnitsOf) and the assemble them in the array of vectors that I want to get back.

Somehow this it is cumbersome and error prone, since outside the function I will have to multiply back the variables by their units.

Unbenannt.JPG

Thanks a lot

Best regards

Claudio

ACCEPTED SOLUTION

Accepted Solutions

Hi Claudio,

Unfortunately, Mathcad 15 doesn't allow mixed units in an array, and adimensionalizing them is (almost) the only way to get round the problem ... When I say almost, you could try returning both vectors in the units of one of the items and then correcting the units on the other one (at least, it reduces your error probability by 50% !).

This is one of the few aspects in which Prime is better than M15, as Prime can handle mixed-unit (well, mixed-dimension, technically) arrays.

Stuart

View solution in original post

1 REPLY 1

Hi Claudio,

Unfortunately, Mathcad 15 doesn't allow mixed units in an array, and adimensionalizing them is (almost) the only way to get round the problem ... When I say almost, you could try returning both vectors in the units of one of the items and then correcting the units on the other one (at least, it reduces your error probability by 50% !).

This is one of the few aspects in which Prime is better than M15, as Prime can handle mixed-unit (well, mixed-dimension, technically) arrays.

Stuart

Announcements

Top Tags