Hi,
I am running into an issue I did not have before : draw3d does not seem to recognize x[i] in an expression as variables for explicit 3d plots (See below for a test session, f and g are the same functions). Do I miss something here in order to make the input cell %i5 work? (Renaming all variables in my real codes is a no go.)
Test session
kill(all);
load(draw);
g:x^2+y^2-4*x*y;
draw3d(explicit(g,x,-5,5,y,-5,5),xlabel="x1",ylabel="x2");
f:x[1]^2+x[2]^2-4*x[1]*x[2];
draw3d(explicit(f,x[1],-5,5,x[2],-5,5));
The draw3d with g works but not the second one with f
Error message (tested in maxima console)
draw3d (explicit): non defined variable in term x
2
My system is an up to date debian buster :
apt policy wxmaxima maxima
wxmaxima:
Installé : 19.01.2-1
Candidat : 19.01.2-1
Table de version :
*** 19.01.2-1 500
500 http://deb.debian.org/debian buster/main amd64 Packages
100 /var/lib/dpkg/status
maxima:
Installé : 5.42.1-1
Candidat : 5.42.1-1
Table de version :
*** 5.42.1-1 500
500 http://deb.debian.org/debian buster/main amd64 Packages
100 /var/lib/dpkg/status
Note: bug also reported at https://github.com/wxMaxima-developers/wxmaxima/issues/1490
Here is a one-line patch -- if you wish you can apply this to your local copy.
Looks like other tests for undefined variables need to be fixed up as well ...
I will work on this but it may be a week or so until I push a commit for the bug fix.
If it ever worked, my guess is that's because of Lisp implementation-specific behavior in SUBSETP when the test is not specified.
Thank you very much for the patch. I have not tested it yet but you are right. Other functions in draw have the same problem (
region, etc.) I am looking forward your bug fix.Best regards.
I can confirm the bug is in git HEAD. The fix is simple and I will push
the commit shortly.
Leo
Fixed in commit b6bf72f70d3. I added a bunch of tests to check it works for all the relevant access points in draw.
Robert, I didn't see your comments til I came to close the bug report. I used
likebecause that is used innset.lispto test equality. Is there a reason to preferalike1?Leo, I'm looking at this again after a long interval, sorry for the delay. About LIKE vs ALIKE1, in general I think it's appropriate to use Maxima functions instead of ostensibly similar Lisp functions, since then the results are more nearly likely to conform to Maxima user's expectations. Maxima
is(a = b)is implemented by ALIKE1, so testing ALIKE1 is (I hope) the same as testing via"=". There are probably cases in which two expressions passALIKEbut failLIKE.Fixed by commit b6bf72. Thanks to Leo B.