Preben Alsholm

13728 Reputation

22 Badges

20 years, 245 days

MaplePrimes Activity


These are replies submitted by Preben Alsholm

Two comments:
(1) The following shows that the number of builtin procedures as found by anames depends on what happens in the session.
Thus it is not a reliable measure of the total number of builtin procedures, but it gives a lower bound.
 

restart;
AB:={anames(builtin)};
nops(AB); # 234 in Maple 2017.2
member(zip,AB); #false
op(3,eval(zip)); # builtin = 589 in Maple 2017.2
## Now continue with
U:=Vector([1,2,3]); #Causes one more builtin to pop up:
AB2:={anames(builtin)};
nops(AB2); # 235 in Maple 2017.2
AB2 minus AB;

AB2 minus AB returns (the set of) the procedure `print/rtable/prepro`.
Added: The list B generated by Carl Love's code contains that procedure:
select(has,B,586); #In Maple 2017.2

(2) In zip the truly builtin procedure rtable_zip is used when rtables are arguments for zip:

member(rtable_zip,AB); #true
op(3,eval(rtable_zip)); # builtin = 401 in Maple 2017.2
showstat(rtable_zip); # The expected error

I tried the code above in Maple releases 12, 15, 16, 17, 18, 2015, 2016, and 2017.
For the sake of clarity the code was:

AB:={anames(builtin)};
nops(AB);
member(zip,AB);
op(3,eval(zip));
showstat(zip);

The results were that
1. nops(AB) returned 195, 216, 222, 226, 228, 233, 232, 234.
2. member(zip,AB) returned false in all those releases.
3. op(3,eval(zip)) returned Copyright 1999 in Maple 8, Copyright 2007 in Maple 12, 15, 16, 17, and 18, in Maple 2015: builtin=578, Copyright 2007, in Maple 2016: builtin=585, Copyright 2007, in Maple 2017: builtin=589, Copyright 2007.
4. All but Maple 8 showed 103 lines of code in showstat(zip). In Maple 8 showstat(zip) showed that the real code was put in ZipImplementation:-zip, which has 99 lines of code (as shown by showstat).

In the code for zip in all but Maple 8 (of the ones I looked at) there is a procedure keep_sparse. I wonder what that is doing.

@AndersDD When clicking I get a "Page Not Found" error.
Try again and this time maybe change the name of the file to e.g.  Afleveringssaet-1.maple or whatever doesn't have æ, ø, or å in it.

@tomleslie The integral over the whole plane Maple finds easily, and it is found to be 1.
 

P := (x,y)->(1/2)*exp(-(1/2)*(x^2+G*y^2-2*B*x*y)/(-B^2+G))/(Pi*sqrt(-B^2+G));
A:=Int(Int(P(x,y),x=-infinity..infinity),y=-infinity..infinity);
value(A) assuming G>B^2;

Furthermore, if we know the value of the integral over e.g. the integral over the fourth quadrant (value = v4, say) then the value over the other quadrants (v1,v2,v3) are simply v2 = v4, v3 = eval(v4,B=-B), and v1 = v3.
It is easily verified that if (as I guessed and _Maxim_ confirms above)
v4 = arctan(sqrt(-B^2+G), B)/Pi/2 then
v1+v2+v3+v4 = 1 all assuming that G > B^2.

@tomleslie Yes that specification of the ranges must be interpreted.
But if the whole plane was meant, why write it that complicated when ranges x= -infinity..infinity, y=-infinity..infinity would do the job?

I have had no such problem with Maple 15 nor have I had with Maple 2015 (just in case that is really the one you are talking about?).

@tomleslie
1. You just changed coordinates in P, not in the integral of P.
2. The question is about the sum of the integrals over the second and the fourth quadrants.
Thus you need a factor r in your polar integral and you need to change the angular limits.

@tomleslie This morning I received 10 notifications, so something happened.

@Carl Love Thank you Carl. The result in Maple 2017.2 is 320. I get 316 in Maple 216.2.
Strangely, I get the upper limit 9999 in all these: 12, 15,16,17,18, 2015.

I noticed that if I write the following line in Maple 12, 15,16,17,18, 2015:

proc() option builtin=4711; end proc;

and press enter, the response is just the echo

whereas if I do it in Maple 2016 and 2017 the response is
proc () end proc
The number 4711 is not important, it is the same with e.g. 123456789.

So in the versions prior to Maple 2016 I suppose we would have to select those procedures that have option builtin = some name.

PS. I get no notifications anymore from MaplePrimes to my subscriptions.
I shall pose a question about that in this forum.

PPS: I wrote a selection procedure that seems to work in Maple releases 15 and up, but not in Maple 12. It converts eval(P) to a string.
The problem in Maple 12 is that although e.g.
eval(ASSERT);
prints

 

as soon as we do
convert(eval(ASSERT), string) ;
we get
"proc () option builtin = 124; end proc"

Anyway, for Maple 15,16,17,18,2015,2016,2017 I get these numbers:
356, 360, 361, 363, 381, 316, 320.
I'm not totally convinced about the reliability of these though.

@Carl Love Over a beer I had a look at the result of the following in Maple releases 8, 12, 15, 16, 17, 18, 2015, 2016, and 2017:

op(3,eval( `evalf/hypergeom/kernel`));

I found the following numbers: 186 (*), 236, 309, 315, 317, 319, 321, 325, 326.
(*) For Maple 8 just do eval( `evalf/hypergeom/kernel`); to find the number.

Assuming that the builtin procedures are numbered lexicographically, and using that the letter e is the fifth in the alphabet, can we get an estimate of the number of procedures that are builtin in Maple?
Well, other characters may be used as the first besides the ones in the alphabet.
But anyway, do you have an estimate of the number of builtin procedures in Maple 2017?

@vv I don't think that the range I..I*infinity was caught by design.
It appears to have been caught by `evalf/int/improper` in line 18 where the lower limit is checked for type numeric.
That was probably put there to catch something like a lower limit that is just a name as a is in

`evalf/int/improper`(1/t^2,t,a,infinity*I,.5e-9,_DEFAULT,[]);

Note. I had to remind myself that I*infinity as well as 1+I*infinity is of type infinity.

About your last statement:

"But anyway evalf should transform correctly the complex limits into reals."

As it is right now `evalf/int` is not trying to do that at all in the case of complex limits having infinity.
It isn't doing it incorrectly, it is not doing it at all.
The help page could be more explicit about that.
Another note:
The integration path is not indicated unambiguously in the integral:
Int( 1/(1+s^2), s=1-infinity*I..1+infinity*I);
I suppose that it is supposed to be the straight line s = 1+t*I, t=-infinity..infinity.
But clearly, it could be different. Which brings up the rhetorical question: What is the difference between 1+infinity*I, infinity*I, or just plain infinity?

 

 

@claus christensen I have been using Maple with Windows for many years (since Maple V, Release 2,1992, I believe).
I have had problems with the Danish characters in the past too.

@ThU The question was: how do i select different literal subscripts in a formula in Maple?
The question is not quite clear: Is the meaning: Find the terms with the literal subscript b?
Or does it really have nothing to do with literal subscripts (taken to mean names generated as in xxx__yyy), but is just: Find the first and third operand in the sum.
In the latter case you provide the answer.
But if we understand the question in the first sense, then what to do with something like
u:=a__b+b__a+a__b^2+7+a*b+q__b;

How do you select the terms having xxx__b  for some name xxx without relying on the visual order of the terms?
Since
whattype(a__b);
returns symbol, it is not immediately obvious.

@Kitonum Yes, but what is its advantage then?

@claus christensen If you yourself use different Maple releases at various occasions, or if you are writing a package to be used by other people who might have older Maple releases, then you could have a problem.
I made a test. I wrote two simple .mpl files in Notepad++ (which by default) saves in UTF-8.
The first file TEST.mpl contains the definition of a package (a module) that only exports the procedure to be found in the other file TestProcedure.mpl.
Here are the files:
 

TEST:=module() option package; export TestProcedure;
$include "C:/Users/Bruger/maple/toolbox/TEST/Procedurer/TestProcedure.mpl"
end module;
TestProcedure:=proc()
print("hüstel");
print("Rødgrød med fløde på en æblebund")
end proc:

Then I used my usual way of saving this package as an archive named TEST.mla.
Testing simply like this:

restart;
with(TEST);
TestProcedure();

It worked nicely in Maple 2017.2, but not in Maple 17.02.

First 58 59 60 61 62 63 64 Last Page 60 of 230