Skip to main content
1-Visitor
November 8, 2014
Solved

Error in 3D plot

  • November 8, 2014
  • 1 reply
  • 3158 views

Hi

I'm trying to make a 3D plot, but gets the error "The function did not evaluate to a pure real value".

I don't understand this, since the function seems to work just fine, when I enter values into it.

Best answer by AlanStevens

You have some divide by zeros and some imaginary numbers for certain values of du and cu.

A quick and dirty solution is provided in the attached, but you should really investigate the root cause and modify your function accordingly.

Alan

1 reply

19-Tanzanite
November 8, 2014

You have some divide by zeros and some imaginary numbers for certain values of du and cu.

A quick and dirty solution is provided in the attached, but you should really investigate the root cause and modify your function accordingly.

Alan

1-Visitor
November 8, 2014

Thanks. I see the problem now. I'm really only interested in values of du >= 30 mm and cu >= 6 m/s.

I've tried to get that in the plot, but even though there is no error anymore, it doesn't plot anything.

I've never worked with 3D plots before so please excuse me if I'm being ignorant here.

25-Diamond I
November 8, 2014

Ole Møller Christensen wrote:

Thanks. I see the problem now. I'm really only interested in values of du >= 30 mm and cu >= 6 m/s.

In that case you won't run into problems like divison by zero. You can change the range for the two arguments in the 3D plot format menu (double click on the plot) - Quickplot data. But you can be sure about the units you see in the plot then (probably the values get interpreted as meter not millimeter). So I would suggest you create a unitless version of that function (Lunitless(x,y):=L.over(x*mm,y*m/s)*1/km) and plot this. For more convenience you may also use CreateMesh so you don't have to set the limits in the forma menu.

1.png

EDIT: FOrgot to attach the sheet.