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

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

Prime 5 incorrect derivative

JonWarriner
4-Participant

Prime 5 incorrect derivative

If it isn't obvious from my subject, I'm using Prime 5.  I've run into a few issues where a partial derivative will incorrectly evaluate both symbolically and numerically as 0.  I've attached two files, both are pretty stripped down just to illustrate what I'm seeing. 

 

The first, derivative_error.mcdx, illustrates the issue with a fairly simple example. You can see that the derivatives with respect to the first two variables are correct but the last three evaluate to 0.

 

In the second file, derivative_error2.mcdx, all I did was rename essentially everything and the issue magically disappeared.  This has been my only method around this issue to-date.  Move a piece of my work to a different file, play with variable names, eventually things start working.  I've never been able to fix the issue in my original file though.  

 

I've searched this forum quite a bit and haven't seen a similar issue.  I'm either doing something really stupid or getting really unlucky.

 

Thoughts?

 

Thanks,

Jon

 

 

ACCEPTED SOLUTION

Accepted Solutions
LucMeekes
23-Emerald III
(To:JonWarriner)

This item has passed before (you're not the first to be fooled by the autolabelling feature of Prime). But finding stuff on this forum is difficult, yes.

 

Anyway, here's the advice:

Check your labels.

 

In the first file, Rc as parameter of the function A() is labelled 'variable' while the Rc next to d (in the derivation 'operator') is an 'automatic' (marked as '-'). Change that to 'variable' and it should work.

 

You can find about labels in the 'Math' ribbon.

 

Same goes for Rd.

The story for Rf is different. Since Rf is not a parameter to the function A(), the partial derivative to it is necessarily 0.

 

Success!

Luc

View solution in original post

3 REPLIES 3
LucMeekes
23-Emerald III
(To:JonWarriner)

This item has passed before (you're not the first to be fooled by the autolabelling feature of Prime). But finding stuff on this forum is difficult, yes.

 

Anyway, here's the advice:

Check your labels.

 

In the first file, Rc as parameter of the function A() is labelled 'variable' while the Rc next to d (in the derivation 'operator') is an 'automatic' (marked as '-'). Change that to 'variable' and it should work.

 

You can find about labels in the 'Math' ribbon.

 

Same goes for Rd.

The story for Rf is different. Since Rf is not a parameter to the function A(), the partial derivative to it is necessarily 0.

 

Success!

Luc

LucMeekes
23-Emerald III
(To:JonWarriner)

You can change the appearance associated with the different labels. Note that a 'unit' shows as blue, bold and italic (whereas according to international standards it should be in upright font). If you change the appearance of 'automatic' to be drastically different from 'variable' you will immediatley see if two items with the same (spelled) name are different.

 

I've stated it before, and repeat it here: Prime's autolabelling feature is sometimes a blessing (when detecting units), sometimes a PITA (in cases such as above).

 

Luc

JonWarriner
4-Participant
(To:LucMeekes)

Ugh, thanks Luc.  That did the trick. I didn't even think to check the labels.  I've been burned by those before in converting files from Mathcad 15 to Prime.  

 

The Rf thing was sloppy typing on my part.  It was supposed to be Re.  

 

Thanks again,

Jon

Announcements

Top Tags