I've just upgraded to v10, and have noticed that some of my trusty old notebooks which used RegionPlot
now fail to run. I've boiled down the problem I'm having to the following examples.
This first example works fine. This function outputs the value of a paraboloid polynomial:
parabolloid = Function[{input1, input2},
x = input1;
y = input2;
x^2 + y^2
]
Suppose I want to plot the region for which the function output is <1:
RegionPlot[parabolloid[x, y] < 1, {x, 0, 2}, {y, 0, 2}]
Result is as expected:
Now let's rewrite the function like so, swapping where I write the exponent:
parabolloid = Function[{input1, input2},
x = input1^2;
y = input2;
x + y^2
]
This ought to give us identical results. First, let's test the function:
parabolloid[2, 2]
The returned value is 8, as expected. So the function still seems to work a-ok.
But when I evaluate the function in RegionPlot as above, my CPU churns away for a few seconds before getting a beep with kernal quit. No error messages or warnings, just a Kernel quit.
Surely we ought to be able to perform operations on input arguments within a function, and on v8, that seemed to work fine. (Admittedly, I don't have v8 handy at the moment, so I can't test my simple examples above, so I suppose I can't prove without doubt that this is a version-specific issue)
x
andy
. $\endgroup$x
andy
). $\endgroup$