Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X
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)
Solved! Go to Solution.
@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:
As soon as p*alpha exceeds 1, the function must fail because p*alpha is a probability and cannot exceed 1.
A quick hack:
or
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.
@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:
I was curious and tried your last example in Mathcad 15.
The plot was done without problems.
So it looks you found a new Prime bug .
Thanks. I'm new to this site and am not sure how to report bugs.
@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.
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.
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.