Skip to main content
25-Diamond I
February 22, 2014
Question

Bug in Prime 3 using regressions with units?

  • February 22, 2014
  • 1 reply
  • 5629 views

As we know Prime in general has a better and more consequent handling of units than Mathcad 15 (units of different dimension in a matrix, odesolve with units, ...). Nevertheless units still don't seem to be integrated that seamless as we'd like it to be.

Playing around with a worksheet from another thread with a question about curve fitting I found that genfit() doesn't calculate the correct results if used with units (which I guess should be possible to do in Prime).

Is it a bug or am I missing something? See the attached file.

22.02.png

1 reply

19-Tanzanite
February 23, 2014

I think it has to do with the scaling. If you divide Volume by m^3, the base unit, you get garbage results (although they are different to v2). Changing CTOL has no effect on those results though.

Werner_E25-Diamond IAuthor
25-Diamond I
February 24, 2014

If we divide by m^3 we have to change the related guess values (first and fourth from 1000 to 1) accordingly and also add the unit m^3 when defining the function f. That way I get the very same result. Interestingly the coefficients are now switched index0 <--> index 4, index1 <--> index5, etc. which doesn't matter because of the symmetric nature of the fit function.

BTW, CTOL has no influence but changing TOL has!

19-Tanzanite
February 24, 2014

When I first open the attached sheet I see this;

units problem.png

If I move the first two regions down until they are after the second two, the second evaluation of vg2 changes so that the two evaluations match. If I then move the two regions back to the top, the two evaluations still match. Do you also see this, or is it just my installation? I see similar weird effects in your genfit worksheets.

Edit: I can the two evaluations to match just by hitting Ctrl F9