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

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

No 3D plot "must evaluate to real values"

GordonHazen
2-Explorer

No 3D plot "must evaluate to real values"

Using Mathcad 3.1 under Windows 10.  Mathcad refuses to plot a two-variable function even though it will plot the same one-variable function with the other variable fixed.  "Cannot plot this function. It must evaluate to real values."  What is going on?  (File attached)

 

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:GordonHazen)


@GordonHazen wrote:

That was a stupid error on my part, and thanks for the programming workaround.  However, the same problem occurs if I use pCure^alpha and restrict the axis ranges to 0.1 - 0.5 for pCure, and 1 - 3 for alpha.  See upload.


I agree that with this new function no error should be thrown and consider this another bug in Prime. Feel free to report it to PTC support.

 

You may either use the workaround with try and catch shown above or I would suggest using the CreateMesh( ) function which also makes it obsolete to fumble around with the axis limits in the plot:

Werner_E_0-1678395525942.png

 

View solution in original post

8 REPLIES 8
Werner_E
25-Diamond I
(To:GordonHazen)

As soon as p*alpha exceeds 1, the function must fail because p*alpha is a probability and cannot exceed 1.

Werner_E_0-1678382768734.png

A quick hack:

Werner_E_1-1678383006935.png

or

Werner_E_2-1678383163927.png

 

 

That was a stupid error on my part, and thanks for the programming workaround.  However, the same problem occurs if I use pCure^alpha and restrict the axis ranges to 0.1 - 0.5 for pCure, and 1 - 3 for alpha.  See upload.

Werner_E
25-Diamond I
(To:GordonHazen)


@GordonHazen wrote:

That was a stupid error on my part, and thanks for the programming workaround.  However, the same problem occurs if I use pCure^alpha and restrict the axis ranges to 0.1 - 0.5 for pCure, and 1 - 3 for alpha.  See upload.


I agree that with this new function no error should be thrown and consider this another bug in Prime. Feel free to report it to PTC support.

 

You may either use the workaround with try and catch shown above or I would suggest using the CreateMesh( ) function which also makes it obsolete to fumble around with the axis limits in the plot:

Werner_E_0-1678395525942.png

 

Werner_E
25-Diamond I
(To:Werner_E)

I was curious and tried your last example in Mathcad 15.

The plot was done without problems.

Werner_E_0-1678396577712.png

So it looks you found a new Prime bug .

Thanks.  I'm new to this site and am not sure how to report bugs.

Werner_E
25-Diamond I
(To:GordonHazen)


@GordonHazen wrote:

Thanks.  I'm new to this site and am not sure how to report bugs.


If you have a current paid subscription you may try

https://support.ptc.com/apps/case_logger_viewer/cs/auth/ssl/log 

 

Otherwise PTC is not much interested in users reporting bugs.

 

ttokoro
20-Turquoise
(To:GordonHazen)

As Werner_E shows above, use try on error, and you can get below.

Prine sometimes returns complex value at very small value 10^-15 instead real value.

image.pngimage.png

Werner_E
25-Diamond I
(To:ttokoro)


Prine sometimes returns complex value at very small value 10^-15 instead real value.

 


No, this seems not to be the case here. Otherwise using the absolute value or the real part of test would work OK, but it doesn't.

Not sure what may cause the problem but I guess its a more severe bug than simple roundoff errors which may result in small imaginary parts.

Announcements

Top Tags