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

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Possible bug in Prime10 Symbolic math

JK_10910070
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: 

JK_10910070_0-1722714338781.png

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:

JK_10910070_1-1722714438417.png

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.

1 ACCEPTED SOLUTION

Accepted Solutions

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

Mathcad 15:

Werner_E_0-1722724553735.png

 

Prime 10:

Werner_E_1-1722724602910.png

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:

Werner_E_2-1722725144770.png

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

Werner_E_5-1722725448376.png

or even

Werner_E_4-1722725420818.png

🙂

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

 

 

View solution in original post

3 REPLIES 3

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:

Werner_E_0-1722720208591.png

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.

Werner_E_1-1722720516052.png

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:

Werner_E_2-1722720648037.png

 

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:

Werner_E_3-1722722571403.png

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

Werner_E_4-1722722728250.png

 

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

Werner_E_9-1722723754968.png

 

 

Additional remark:

I hoped and expected that the following approach would work

Werner_E_6-1722723365016.png

but as you can see it doesn't.

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

Werner_E_7-1722723415982.png

or better

Werner_E_8-1722723439490.png

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

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

Mathcad 15:

Werner_E_0-1722724553735.png

 

Prime 10:

Werner_E_1-1722724602910.png

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:

Werner_E_2-1722725144770.png

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

Werner_E_5-1722725448376.png

or even

Werner_E_4-1722725420818.png

🙂

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

 

 

JK_10910070
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!!!

Top Tags