Alejandro Jakubi

MaplePrimes Activity


These are answers submitted by Alejandro Jakubi

You may use:

> type(z, '`+`'(name));
                                      true

Note that unevaluation quotes need to be used here, because the kernel procedure `+` makes an unary sum. Compare:

> `+`(name);
                                      name
> lprint('`+`'(name));
`+`(name)

Thus, as stated in ?type,structured:

`+`(type)                   a sum of terms of the given type

seems incorrect to me.

The assumption mechanism should work for conveying the information to the system that a symbol represents a real variable. However, here the ouput of the integral, computed via the method FTOC, is expressed in a piecewise form, which is actually designed to handle real conditions rather than complex ones, see this simpler example:

> f:=piecewise(a+I*b>0,1,0);
                               { 1        0 < a + b I
                          f := {
                               { 0         otherwise

> simplify(f) assuming a::real,b::real;
                            { 0        a + b I <= 0
                            {
                            { 1        0 < a + b I

So, a workaround is using integral transform routines which, for some reason, are not tried in the computation of the integral. Something like:

> f:=1/((x+z1)*(x+z2)):
> sqrt(Pi/2)*(inttrans[fouriercos](f,x,t)+
> I*inttrans[fouriersin](f,x,t));
     1/2   1/2 / 1/2
1/2 2    Pi    |2    (cos(z1 t) Ci(z1 t) + sin(z1 t) Ssi(z1 t)
               \
                                                   /              1/2     1/2
     - cos(z2 t) Ci(z2 t) - sin(z2 t) Ssi(z2 t))  /  ((z1 - z2) Pi   ) + 2    (
                                                 /
    cos(z1 t) Ssi(z1 t) - sin(z1 t) Ci(z1 t) - cos(z2 t) Ssi(z2 t)
                               /              1/2 \
     + sin(z2 t) Ci(z2 t)) I  /  ((z1 - z2) Pi   )|
                             /                    /

It depends on the complete calculation. Note that symbols like a and b are implicitly assumed as complex by default, allowing the case a+I*b real.

This is a good question. The prefix form of the product that is returned does not seem satisfactory to me:

> c:=a<b: 
> c/d; *(a < b, 1/d)

It arises in `simpl/reloprod` line 16:

> stopat(`simpl/reloprod`,16): 
> c:=a/d:
> c/d;
1/d
`simpl/reloprod`:
  16*    return ('`*`')(args[relop],pr)
DBG> ('`*`')(args[relop],pr) 
`*`(a < b,1/d)
...

It would make much more sense that map were used instead, similarly to what Preben has shown.

Yet, this is at the syntactic level. A mathematical level way that takes into account the sign condition on d is needed.

PS It looks like there is a bug in rendering this post.

In this thread, Jacques told a bit on the history of Maple lists and how they have got the current design.

I think that ?member is not clear about the types allowed for its first argument. Probably it cannot be a container structure as the list c. Then, its elements have to be used individually as in:

> seq([member(i,A,'pos'),pos],i in c);
                    [true, 2, 1], [true, 2, 2], [true, 1, 3]

It goes more in line with the implementation for the standard constants to use a similar extension of evalf, like:

> constants := constants, phi;
       constants := false, gamma, infinity, true, Catalan, FAIL, Pi, phi
> `evalf/constant/phi`:=()->evalf((sqrt(5)+1)/2):
> evalf(phi);
                                  1.618033988
> type(phi+Pi,constant);
                                      true

It seems like Maplesoft is happy with that organic ecosystem approach to development...

There are several reasons for duplication. One reason is change of developer. The developer of the first command/package leaves and the developer that takes charge of the subject some time later has different design ideas, or the original code was not properly documented and it becomes simpler to rewrite than update.  Another reason is changes in the underlying system (language facilities, etc), also prompting rewrite. But newer packages frequently do not provide all the functionality of the older ones. And there is always library code somewhere depending on that old command. Hence, packages keep accumulating like geological layers...

I think that there is no way to modify such behavior, change the assigned key, program a different editor action, etc. The Standard GUI is, I would say, monolithic and inflexible. A big problem, in my opinion. This is one of the reasons why I prefer using Maple in an IDE-like editor centric way. As the editor that I am using has an interface programming language, I can customize its behavior the way I like.

See also this thread. Note, however, that currently several comments are missing there. Presumably due to bugs in this site.

In the Standard GUI Typesetting:-mambiguous is an internal function of the typesetting system (TypeMK) used to represent in output a parsing error and the like (the red-dotted rectangle). I know how to debug such issues in Standard, but never tried with MapleSim.

You can use nested `if` calls like:

> map(x->if x<5 then f(x) elif x=5 then x else x-1 fi,A);
                        [1, 4, 9, 16, 5, 5, 6, 7, 8, 9]
> map(x->`if`( x<5, f(x), `if`(x=5,x,x-1)),A);
                        [1, 4, 9, 16, 5, 5, 6, 7, 8, 9]

I think that the main advantages of the operator form are compacteness and usage within expressions, like "Simple Case 2" in ?if > Examples.

In the (automatic) normalization of the cos function call, the even symmetry is used like:

> cos(-x);
                                     cos(x)

So, a way for bypassing this normalization is using the inert form %cos instead:

> %cos(-x);
                                    %cos(-x)

Hence:

> li := a*%cos(7*x+8*x*y+9*y)*%cos(-7*x-8*x*y-9*y);
           li := a %cos(8 x y + 7 x + 9 y) %cos(-8 x y - 7 x - 9 y)
> ab:=7*x+8*x*y+9*y:
> ac:=20*y:
> subs(ab = ac, li);
                    a %cos(20 y) %cos(-8 x y - 7 x - 9 y)

I wonder also whether there is a good equivalent. This thread is somewhat related. I guess that better answers could be got in a specialized Windows forum. Perhaps Cygwin is a way.

A priori, it looks like a bug. There is a procedure (assigned to) `pdsolve/BC/2nd_order/Series/2/integrate` and a procedure `pdsolve/BC/2nd_order/Series/4/integrate`, but not a procedure assigned to the name `pdsolve/BC/2nd_order/Series/3/integrate`. So the function call to the latter made in the the line 2 here:

> showstat(`pdsolve/BC/2nd_order/Series/3`);
`pdsolve/BC/2nd_order/Series/3` := proc(PDE, BC, F, INFOSET, series_hint)
local intermediate_result;
   1   if `PDEAdvisor/2nd_order/Series/3`(PDE,BC,F,INFOSET,'intermediate_result',series_hint) then
   2     `pdsolve/BC/2nd_order/Series/3/integrate`(intermediate_result)
       end if
end proc

remains as is, and so it returns.

First 6 7 8 9 10 11 12 Last Page 8 of 29