Alec Mihailovs

Dr. Aleksandrs Mihailovs

4495 Reputation

21 Badges

20 years, 341 days
Mihailovs, Inc.
Owner, President, and CEO
Tyngsboro, Massachusetts, United States

Social Networks and Content at Maplesoft.com

Maple Application Center

I received my Ph.D. from the University of Pennsylvania in 1998 and I have been teaching since then at SUNY Oneonta for 1 year, at Shepherd University for 5 years, at Tennessee Tech for 2 years, at Lane College for 1 year, and this year I taught at the University of Massachusetts Lowell. My research interests include Representation Theory and Combinatorics.

MaplePrimes Activity


These are replies submitted by Alec Mihailovs

That can be done as above, or, say, as

f:=(m::integer,n::integer)->if (m+n)::posint then m+n fi;

f(3,5);

                                  8

f(3,-5);

It is not very good for plotting though. Plots in Maple don't work like that.

Alec

 

You can program that. For example,

f:=proc(m,n)
    local a;
    a:=m*n;
    if a::even then a
        else FAIL fi 
end;

Then

f(2,5);
                                  10
f(3,5);
                                 FAIL

Alec

You can program that. For example,

f:=proc(m,n)
    local a;
    a:=m*n;
    if a::even then a
        else FAIL fi 
end;

Then

f(2,5);
                                  10
f(3,5);
                                 FAIL

Alec

In this example, f can be defined as

f:=(m,n)->m*n;

and evaluated as

f(2,3);
                                  6

No domain or codomain specification is needed or used in Maple. Something like domain can be specified as

f:=(m::integer,n::integer)->m*n;

and that would give an error if either m or n is not an integer,

f(2.5,3.2);
Error, invalid input: f expects its 1st argument, m, 
to be of type integer, but received 2.5

Alec

In this example, f can be defined as

f:=(m,n)->m*n;

and evaluated as

f(2,3);
                                  6

No domain or codomain specification is needed or used in Maple. Something like domain can be specified as

f:=(m::integer,n::integer)->m*n;

and that would give an error if either m or n is not an integer,

f(2.5,3.2);
Error, invalid input: f expects its 1st argument, m, 
to be of type integer, but received 2.5

Alec

Really?

The elements of Z×Z are ordered pairs of integers x=(m,n). What would x^2 mean?

Unless you gave 2 different examples, and f and F are unrelated.

In that case, if you would like to define f as a function, the correct syntax is

f:=x->x^2;

After that, its values can be evaluated, for example, as

f(2);
                                  4

Alec

Really?

The elements of Z×Z are ordered pairs of integers x=(m,n). What would x^2 mean?

Unless you gave 2 different examples, and f and F are unrelated.

In that case, if you would like to define f as a function, the correct syntax is

f:=x->x^2;

After that, its values can be evaluated, for example, as

f(2);
                                  4

Alec

It can be done in Sage with about the same amount of effort as in Maple - just with cleaner code, nicer plots,  and working, maybe, 10 or 100 times faster.

In Mathematica, the first part - the RiemannR function, is already done. It still can not be used for the second sum (over trivial roots), but it is easy to do it manually, so that doesn't matter.

Thinking about my favorites, I would, probably, choose assembler first, C and/or C++ second, C# third, maybe, then Python and Perl, Javascript, something else after that, and only then Sage, Mathematica, Matlab with Mupad, and Maple.

Several years ago, Maple was my favorite CAS, but many things have changed since then. Sage is certainly the current leader in the CAS development, Mathematica, Matlab, and Mupad are significantly improved, while Maple has been destroyed, fortunately, not completely yet - such old things like rationalize(1/(sqrt(2)+sqrt(3)+sqrt(5)+sqrt(7)+sqrt(11)+sqrt(13))) still work, but it is possible to guess the number of the version in which they will stop working.

Alec

It can be done in Sage with about the same amount of effort as in Maple - just with cleaner code, nicer plots,  and working, maybe, 10 or 100 times faster.

In Mathematica, the first part - the RiemannR function, is already done. It still can not be used for the second sum (over trivial roots), but it is easy to do it manually, so that doesn't matter.

Thinking about my favorites, I would, probably, choose assembler first, C and/or C++ second, C# third, maybe, then Python and Perl, Javascript, something else after that, and only then Sage, Mathematica, Matlab with Mupad, and Maple.

Several years ago, Maple was my favorite CAS, but many things have changed since then. Sage is certainly the current leader in the CAS development, Mathematica, Matlab, and Mupad are significantly improved, while Maple has been destroyed, fortunately, not completely yet - such old things like rationalize(1/(sqrt(2)+sqrt(3)+sqrt(5)+sqrt(7)+sqrt(11)+sqrt(13))) still work, but it is possible to guess the number of the version in which they will stop working.

Alec

plots:-display(V(f,output=plot),V(g,output=plot));

plots:-display(W(f,output=plot),W(g,output=plot));

scaling=constrained can be added at the end of the display commands for a more realistic view.

The title is wrong though. Another option is to use piecewise to define a piecewise function which is f for x<c and g for x≥c. But that won't look nice in the title either, so the title can be added manually at the end of the display commands, as title="whatever".

Alec

plots:-display(V(f,output=plot),V(g,output=plot));

plots:-display(W(f,output=plot),W(g,output=plot));

scaling=constrained can be added at the end of the display commands for a more realistic view.

The title is wrong though. Another option is to use piecewise to define a piecewise function which is f for x<c and g for x≥c. But that won't look nice in the title either, so the title can be added manually at the end of the display commands, as title="whatever".

Alec

Factorial (i.e. !) is fast in Maple, and the GAMMA function is using a version of Stirling's approximation.

Alec

Factorial (i.e. !) is fast in Maple, and the GAMMA function is using a version of Stirling's approximation.

Alec

So, did you try that?

Some approximations to the sums can be plotted.

It is easier in Mathematica 7, because it has already built in functions for RiemannR, and ZetaZeros.

The student version is dirt cheap, and recently Wolfram started to sell personal (home) versions also very cheap, for about $300.

Alec

So, did you try that?

Some approximations to the sums can be plotted.

It is easier in Mathematica 7, because it has already built in functions for RiemannR, and ZetaZeros.

The student version is dirt cheap, and recently Wolfram started to sell personal (home) versions also very cheap, for about $300.

Alec

First 70 71 72 73 74 75 76 Last Page 72 of 180