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

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

Error: The function did not evaluate to a pure real value

pchristensen-2
4-Participant

Error: The function did not evaluate to a pure real value

I have tried plotting multiple 3D graphs, but keep getting the error: The function did not evaluate to a pure real value

Does anybody have a prober fix to this?

1 ACCEPTED SOLUTION

Accepted Solutions

This is a bit tricky as Mathcads 3D-plot is quite limited.

You can only plot over a rectangular area  of the xy-plane.

You can set the x- and y limits when you double click the plot to get into the plot format menu and then chose the tab "QuickPlot Data".

If you set eg Range1 to run from -10 to 0  and Range2 from 2 to 10 you will see a plot as all meshpoint evaluate to real values.

As you have seen, the whole plot fails even if just one single pair (x,y) evaluates to a non-real number or to NaN.

Another way round is to redefine your function to return a dummy value (-1 in my example) in case the value would get non-real.

Then I set the z-axis manually to go from 0 to whatever seems appropriate so the dummy values are hidden.

One other thing is to use CreateMesh. It gives you a better control over the x- and y-limits and you don't have to change them in the format menu.

View solution in original post

1 REPLY 1

This is a bit tricky as Mathcads 3D-plot is quite limited.

You can only plot over a rectangular area  of the xy-plane.

You can set the x- and y limits when you double click the plot to get into the plot format menu and then chose the tab "QuickPlot Data".

If you set eg Range1 to run from -10 to 0  and Range2 from 2 to 10 you will see a plot as all meshpoint evaluate to real values.

As you have seen, the whole plot fails even if just one single pair (x,y) evaluates to a non-real number or to NaN.

Another way round is to redefine your function to return a dummy value (-1 in my example) in case the value would get non-real.

Then I set the z-axis manually to go from 0 to whatever seems appropriate so the dummy values are hidden.

One other thing is to use CreateMesh. It gives you a better control over the x- and y-limits and you don't have to change them in the format menu.

Top Tags