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

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

4-Participant

## Possible bug in Prime10 Symbolic math

I could be doing something wrong here, but it seems that I see an inconsistency in the substitution function in the symbolic math in Mathcad Prime 10.

I started with:

The result here in incorrect in that the first term (se^2*Vc*t^2) should be divided by 2.

If I do the same integral without using the substitute function as follows:

Here we arrived at the correct answer.  It seems possible to me that it might have something to do with the limits of integration.  I tried using a top limit that was not the same as the integration variable and it did not make any difference.

I will be really grateful for anyone's perspective here especially if you see that I am incorrectly using the function.

ACCEPTED SOLUTION

Accepted Solutions
25-Diamond I
(To:Werner_E)

I consider it as being a bug that substitution does not work as we were used from real Mathcad;

Prime 10:

And yes, I checked that all occurrences of f and x are labelled the same (a common problem in Prime).

The bug has nothing to do with the new symbolic engine (FriCas/Axiom) introduced in Prime 6, the behaviour is the very same in older Prime versions which use the same symbolic engine (muPad) as Mathcad 15.

EDIT: The last remark is not fully correct! The behaviour is correct up to Prime 5. In Prime 6 it got broken, no matter if we use the old or the new symbolic engine (P6 was the only version were we could switch between muPad and FriCAS as symbolic engines).

Here what we see in Prime 5:

And of course the integral in question works OK, too, in Prime 5 with substitution, if we use "I" as a function

or even

🙂

Actually I don't understand why "simplify" was needed in the simpler example with f(x) but not needed for the last one ...

3 REPLIES 3
25-Diamond I
(To:JK_10910070)

It has nothing to do with the limits.

The substitution just is done AFTER the integral is calculated and so the extra variable of integration t which is introduced by the substitution is not yet taken into account when integrating.

So its the same as integrating as a fist step and then apply the substitution in a second step:

You may define I as a function of t to make it work.

And, yes, its not correct to use the variable of integration as an integral limit. Even though its convenient and Primes symbolics accepts it, you should use different names.

Don't mind the red error - it does not matter in symbolic calculations.

To avoid that error which is thrown by the numeric engine, you would have to turn I into a function of all involved unknowns:

Of course you could also do the same without a function definition, but then we are back to the formal error of an integral limit being ident with  the variable of integration:

and it may look strange in the context of your sheet if you define I with tau instead of t

You may combine the two regions (function definition and integral) in one program region if you like:

I hoped and expected that the following approach would work

but as you can see it doesn't.

It worked OK in real Mathcad (version 15 and below)

or better

Seems to be one of the things which were broken in Prime 😞

25-Diamond I
(To:Werner_E)

I consider it as being a bug that substitution does not work as we were used from real Mathcad;

Prime 10:

And yes, I checked that all occurrences of f and x are labelled the same (a common problem in Prime).

The bug has nothing to do with the new symbolic engine (FriCas/Axiom) introduced in Prime 6, the behaviour is the very same in older Prime versions which use the same symbolic engine (muPad) as Mathcad 15.

EDIT: The last remark is not fully correct! The behaviour is correct up to Prime 5. In Prime 6 it got broken, no matter if we use the old or the new symbolic engine (P6 was the only version were we could switch between muPad and FriCAS as symbolic engines).

Here what we see in Prime 5:

And of course the integral in question works OK, too, in Prime 5 with substitution, if we use "I" as a function

or even

🙂

Actually I don't understand why "simplify" was needed in the simpler example with f(x) but not needed for the last one ...

4-Participant
(To:Werner_E)

Thank you for such a thoughtful answer!  I agree - the substitution was done AFTER the integration, and the method you suggested for forcing it to do the integration AFTER the substitution does make sense.  I still consider it a limitation but can work with your suggested solution!  Thank you!!!

Announcements

Top Tags