Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Paramatising a solve block with multiple unit types 1

Status
Not open for further replies.

chrisjc

New member
Dec 1, 2012
13
0
0
GB
Hi there,

I have set of equations that I need to solve numerically (colebrook-white, darcy, and bernouli equations). I express these equations in a solve block and use find to solve. Explicit matrix form works fine:
{x, y, z} = find(x,y,z)

However, I want to paramatise this solve block i.e:

f(x,y,z) = find(x,y,z)

but, x,y, and z, have the dimensions (m/s), (1) and (m) and mathcad doesnt support matricies of differing types as mentioned in the help page for find.

Mathcad must have a good reason for maintaining data in homogeneous matricies but I guess there must be a way to do what I need.

Any ideas how to achieve this?

I tried getting just one variable from the solve block, since this can be used to identify the state of all others but mathcad needs all three variables specified in the find function in order to solve (not sure why this is).

Thanks for reading.

 
Replies continue below

Recommended for you

No, Mathsoft didn't have a particularly good reason to restrict arrays to single data type. From Mathcad 12 onwards it was disallowed because the newly introduced static data type checking couldn't guarantee the result type if mixed units were allowed. Allowing mixed data types (and a return to allowing functions and values to be mixed in an array, as in Mathcad 11) was a long-standing feature request from many users. For some reason, Mathsoft and, subsequently, PTC stubbornly refused to do anything about it. However, I believe PTC have lifted the restriction in Mathcad Prime.

As for getting round it, I'm afraid the only method I know of is to remove units from the variables and add them back afterwards (look up the SIUnitsOf function).
 
Status
Not open for further replies.
Back
Top