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

1-Newbie

Function of vector gives different (wrong) result, compared with range variable (Prime 2.0)

Hello,

I've got a severe issue with Mathcad Prime 2.0, and I'm not sure if it is my fault, or a bug in the program. Attached, you can find the example worksheet. I've cut it out from a more complex sheet and simplified it as much as possible (all units left out etc.).

In the upper area, a function k(T,M) is defined. I now want to cut out one-dimensional slices of this 2-dimensional function: k_hi(T) and k_lo(T), where M is not constant, but depends on the given constant parameter P and T.

I define both a range variable Temp=200, 220 ... 300 and a vector Temp' with the same values.

Now I output both k_hi(Temp), using the range variable, and the vector k'_hi = k_hi(Temp'). (same for lo instead of hi).

As you can see, the results for the vector are different from the range variable result!

They are in the same order of magnitude, though, so it could be a numerical precision issue. (Is there any possibility to play around with internal floating point precision in Mathcad Prime 2.0?) But this does not seem to make any sense.

By the way: "manual" calculation with my calculator favors the results from the range variable method.

Does anybody know what's going on here?

1 ACCEPTED SOLUTION

Accepted Solutions
15-Moonstone
(To:ptc-5373017)

You need to vectorise the 'vector' calculations to get the element by element result - see attached.

Alan

4 REPLIES 4
15-Moonstone
(To:ptc-5373017)

You need to vectorise the 'vector' calculations to get the element by element result - see attached.

Alan

1-Newbie
(To:AlanStevens)

Helle Alan,

thanks for the very quick help. So I understand now, what I was doing wrong, but I still do not understand what the program does if I don't vectorize k'_hi and k'_lo. Because the resulting output is also a vector, and the results are somewhat close to the true results.

Mark

4-Participant
(To:ptc-5373017)

The difference thaat you have between the 2 variants is:

Adding the vectorise operator as the last equation gives the 'correct' result.

Multiplying 2 vectors gives a number of options:

1 & 2 show normal vector operations

3 prime is assuming that it should create a scalar.

4 prime gives an error

3a & 4a the vectorise operator gives a correction

Regards

Andy

Okay, thanks. I think I understand the problem now.

Announcements