Preben Alsholm

13471 Reputation

22 Badges

20 years, 262 days

MaplePrimes Activity


These are replies submitted by Preben Alsholm

@dineshchawde You gave us an image. Thus to experiment with it we would have to type the whole thing ourselves. Needless to say, we don't like that. So please use text or upload a worksheet using the fat green arrow in the MaplePrimes editor.

@Axel Vogt Yes, following your rewriting we find that the integral over the fourth quadrant is given by 26.3.19 in A&S:
 

AS:=1/4-arcsin(B/sqrt(G))/2/Pi; #rho = -R/sqrt(G) in A&S 26.3.19
## Value from the guess:
v4:=arctan(sqrt(-B^2+G),B)/2/Pi;
##
df:=simplify(v4-AS) assuming G>B^2;
convert(df,arctan);
simplify(%) assuming G>B^2,B>0; # 0
simplify(%%) assuming G>B^2,B<0; # 0

 

@NorwegianStudent If a given function is already periodic you don't have to do anything: just plot it.
If, on the other hand, you intend to extend a function given on some interval a..b to a function periodic with period b-a then you could just use the following procedure PeriodicExtension:
 

PeriodicExtension:=proc (fip, itvl::{range, name = range}) local x, f, a, b, p, pr; 
   description "Input a procedure or an algebraic expression and an interval on the form a..b or x = a..b on which the function is given by the procedure/expression.\nOutput is a procedure/expression that is the periodic extension with period b-a."; 
  if type(itvl, range) then 
    f := eval(fip); 
    a, b := op(itvl) 
  else 
    x := lhs(itvl); 
    f := unapply(fip, x); 
    a, b := op(rhs(itvl)) 
  end if; 
  p := b-a; 
  pr := proc (x) f(x-floor((x-a)/p)*p) end proc; 
  if type(itvl, range) then eval(pr) else pr(x) end if 
end proc;
###
### Two examples:
f:=PeriodicExtension(x^2,x=0..1);
plot(f,x=-3..3,discont=true);
##
f:=PeriodicExtension(arcsin,-1..1);
plot(f,-3..3,discont=true);

To get the description do
Describe(PeriodicExtension);

Could you give a simple example of what you mean by "segregate different terms"?

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?

 

 

First 52 53 54 55 56 57 58 Last Page 54 of 225