Alejandro Jakubi

MaplePrimes Activity


These are answers submitted by Alejandro Jakubi

Certainly, support in Maple for abstract sets (in terms of predicates) and operations over them is poor and at most fragmented (special cases in routines and packages). Yet, you could try doing something with patterns. For two numbers in this set:

n1:=a1+b1*sqrt(3):
n2:=a2+b2*sqrt(3):

You can check that their sum (after taking sqrt(3) as factor) satisfies a conditional pattern where a and b are being checked as integer under the assumptions:

`+`(op(factor~([selectremove(x->has(x,sqrt(3)),n1+n2)])));
patmatch(%,conditional(a::nonunit(algebraic)+b::algebraic*sqrt(3),
_is(a,integer) and _is(b,integer)),'p')
assuming a1::integer, a2::integer, b1::integer , b2::integer;p;p:='p': 1/2 (b1 + b2) 3 + a1 + a2 true [a = a1 + a2, b = b1 + b2]

This is one of many areas of symbolic computation that is underdeveloped in Maple. First, there is no support for symbolic sums over an index satisfying a predicate different from the standard form name=range, as in your elementary example i<>k (noted in other languages as i!=k). And there is no available package for manipulation of sums, equivalent to IntegrationTools.

Yet, Maple (its programming language) could, in principle, be used for these symbolic computations by writting these tools from scratch.

A pair of tests that yield false when the ratio does not include A:

a:= A*some*other*stuff:
b:=C:

not(has(a/b,A));
                                     false
type(a/b,Not(dependent(A)));
                                     false

Note that the first test is syntactical (like Adri's one, though specific for products), i.e. it looks on whether no symbol A exists in the ratio after automatic simplification, while the second one is (or intends to be) mathematical, namely it looks on whether the ratio does not depend on A. See the difference in this example:

a:=A*Int(A,A=0..1):
b:=A:

not(has(a/b,A));
                                     false
type(a/b,Not(dependent(A)));
                                      true

But the second test is much more costly in terms of computational resources. So, the choice may depend on your intended usage.

I agree with Valery, trigonometry does not seem to be a very fashionable subject among CAS researchers. The intended standard tool in Maple is trigsubs, whose development stopped over 20 years ago and has bugs from about that time. Hence, trigsubs can be used for the required transformation, but it is not as handy as it should:

ex := -2*Pi*sin(Pi*a)/(-1+cos(2*Pi*a)):
evalindets(ex,cos(algebraic),x->trigsubs(x)[6]):
evalindets(%,cos(algebraic)^2,x->trigsubs(x)[1]);
                                      Pi
---------
sin(Pi a)

In the current situation, and for more complex expressions, for which the inverse-transform-inverse kind of tricks do not work, I think that the most systematic way of handling these symbolic manipulations is using transformation rules. You write them once and then use every time you need. For this example it could go like:

coshalf:=cos(a::algebraic)=2*%cos(a/2)^2-1:
cossq:=A::algebraic*%cos(a::algebraic)^2=A-A*sin(a)^2:
evalindets(ex,cos(algebraic),x->applyrule([coshalf,cossq],x));
Pi
---------
sin(Pi a)

Note that one problem with the design of the Maple rule transformer applyrule is that it computes the fix point, presuming that such thing exists. I.e., there is no way to request the application of the rule only once, or some given number of times. So, for avoiding infinite recursion, the rhs of the rule coshalf uses the inert version of cos, i.e. %cos, and the lhs of cossq is modified accordingly.

PD. A correction is in order. I have just realized that the implementation of trigsubs has been updated in Maple 16 to a module. The bugs shown in the linked post are still there. But this modernization brings hope of an improvement.

There are many ways. An easy one is:

a:= A*some*other*stuff:
b:=A:
type(a/b,algebraic);
                                      true

Another way to execute cmaple.exe minimized is launching it with the start shell command with option min. From the cmd box prompt or a batch file you would do something like:

start /min  <path-to-cmaple.exe> <source file>

I think that you should create a shortcut (.lnk) file for cmaple.exe and configure it so that it executes minimized.

Yes, probably it is too much to expect "straight away" simplification of expressions of this size/complexity. Automatic simplification is restricted to smaller expressions like:

> (2*C+C)/C;
                                       3

Somewhat larger expressions like yours lay in the domain of (non-automatic) "normalization". Indeed, simplify calls the builtin procedure normal for such cases (which you could use directly):

> trace(normal):
> (A*C-A*B*C)/C;
                                  A C - A B C
                                  -----------
                                       C
> simplify(%);
execute normal, args = (A*C-A*B*C)/C
                                  -A (-1 + B)

As far as I understand it, all this behavior arises in design decisions where efficiency for algebraic computations is the main concern. As such, I see little chance that this behavior will ever be changed. Certainly never for Maple 13.

On the other hand, note that automatic simplification/normalization is frequently a nuisance for symbolic computations (manipulation of symbols).

If you have already taken the first step of editing your code in a true editor, the next step, avoiding the fuss of copy/pasting back and forth between the editor and the Maple GUI, is go editor-IDE centric: write your code entirely in the editor-IDE and make it call Maple CLI/GUI for its execution. This thread shows some possibilities.

The download page says: Epsilon 0.618 for Maple 8 (and 7).

I cannot explain it. But what you show, the Standard GUI suddenly producing ASCII display, instead of typeset one, reminds me of the ASCII plot bug.

As far as I know, Maple lacks a facility that directly parses (a suitable subset of) LaTeX code as input. Such a facility would be very important, but LaTeX support for input/output has a low priority for Maplesoft...

What is available is a facility for importing MathML code by copy and paste, which in the Standard GUI is converted to 2D input. Certainly the format behind 2D math in the Standard GUI is a variation of MathML named TypeMK. So, you can try a TeX/LaTeX to MathML translator as here. Then select/copy the generated MathML code, as in the page source of the output generated by this online site, and then paste it into the worksheet. I have had some success for simple examples.

Typesetting:-mfenced is a TypeMK command for placing brackets. For instance, round brackets around a fraction:

Typesetting:-mfenced(mfrac(mi("a"),mi("b")));

Or a curly-square brackets combination:

Typesetting:-mfenced(mfrac(mi("a"),mi("b")),open="{",close = "]");

Maple sets (and their operations) are "computational", rather than "mathematical". Actually, Maple misses a good representation of sets and their algebra (in particular "abstract" sets in terms of predicates), though it has several mediocre representations for some kind of sets like intervals. And which one solve uses in its output depends on the form of the variable argument. In particular, for a name it uses the property representation, where intervals are represented by RealRange function calls. This is something weird in my opinion, but it has the advantage that implemented operations are more mathematical. E.g. the representation of intersection of intervals is AndProp, and using it the following workaround could be tried for intersecting the different solution intervals and combining the results:

s1 := solve(x^2+ 3*x + 2 >0, x);                 
      s1 := RealRange(-infinity, Open(-2)), RealRange(Open(-1), infinity)
s2 := solve(x^2 - 9>=0, x);
             s2 := RealRange(-infinity, -3), RealRange(3, infinity)
(AndProp@op)~({seq(seq([s1[i],s2[j]],i=1..2),j=1..2)});
         {BottomProp, RealRange(3, infinity), RealRange(-infinity, -3)}

Here, BottomProp is the property equivalent of the empty set.

I had a similar problem some days (may be two weeks) ago: on Ubuntu Hardy, Firefox (3.6.17) suddenly stopped allowing login to the MaplePrimes site, while SeaMonkey (2.0.11) had no problem. I could solve this problem by cleaning Firefox from cookies (so that this site server should send new cookies). 

First 23 24 25 26 27 28 29 Page 25 of 29