Alec Mihailovs

Dr. Aleksandrs Mihailovs

4455 Reputation

21 Badges

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

Social Networks and Content at Maplesoft.com

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 answers submitted by Alec Mihailovs

I understand that it easy to say, but I would use LinearAlgebra instead of linalg, with Arrays instead of arrays, Matrices instead of matrices etc.

linalg is deprecated now and may not work properly in some situations.

Also, LinearAlgebra and Matrices are often much faster, especially with datatype=float[8].

Alec

If you look at the beginning of the outputs of

showstat(GraphTheory:-EdgeConnectivity);

and

showstat(GraphTheory:-VertexConnectivity);

you will see that lines 3 - 6 from the VertexConnectivity were inserted as lines 1 -4 into the EdgeConnectivity. That gives 2 bugs - one that you mentioned, for weighted graphs, and another one - for directed graphs.

For undirected weighted graphs a workarond is simple (assuming that the rest of EdgeConnectivity procedure is correct, which I didn't look at and am not sure of) - make it unweighted, and apply EdgeConnectivity to that unweighted graph.

Alec

PS If you care about fixing that in next Maple release, you could Submit Maple Software Change Request -Alec

method=float in Determinant may be not the best choice. Did you try to set datatype= float[8] in your matrix instead?

Alec

?polyrefs has 2 additional references.

See also this thread.

Alec

group is an old package, small, and dedicated to subgroups of symmetric groups.

with(group):
Z2:=permgroup(2,{[[1,2]]}):
elements(Z2);

                            {[], [[1, 2]]}

S3:=permgroup(3,{[[1, 3]], [[2, 3]]}):
elements(S3);

     {[], [[1, 2]], [[1, 3]], [[2, 3]], [[1, 2, 3]], [[1, 3, 2]]}

Z2Z2:=permgroup(4,{[[1,2]],[[3,4]]}):
elements(Z2Z2);

              {[], [[1, 2]], [[3, 4]], [[1, 2], [3, 4]]}

This link could be useful.

Alec

piecewise(x < -1, x^3,-1 < x and x <1 , x, x >= 1, 1-x)

That would give 0 for x=-1 though, you could see that after

simplify(%)

Also, a normal use of piecewise would be something like

piecewise(x < -1,x^3,x < 1,x,1-x);

Alec

J:=Sum(Sum((-1)^(r+s)*factorial(i+j-r-s)*pochhammer(mu+1/2, i+j-r-s)/
(pochhammer(mu+1/2, i-r)*pochhammer(mu+1/2, j-s)*
factorial(r)*factorial(s)*factorial(i-r)*factorial(j-s)),
r = 0 .. i), s = 0 .. j);

S:=value(J);

value(eval(J,[i=1,j=2,mu=1.]));
                             3.666666667

value(eval(J,[i=2,j=1,mu=1.]));

                             3.666666665

eval(S,[i=1,j=2,mu=1.]);

                             3.850606387

eval(S,[i=2,j=1,mu=1.]);

                             3.798787228

Alec

I've just noticed that mu is supposed to be positive. I just tried a few values of i and j and they gave nonnegative answers. So it could be nonnegative for mu>0.

Alec

convert(ODE, FirstKind) converts this equation to a more simple Abel differential equation of first kind. There is a table in Maple including known cases where such equations are solvable. Checking if this equation can be reduced to one in these tables  involves calculating some polynomial (or rational) invariants of coefficients which are quite large in size - that can be seen with infolevel[dsolve] set to 4 or 5. Even checking one of such classes - 45, for instance, takes a very long time. I stopped Maple before it could finish it.

Alec

1.You can't use the same summation index r in both sums - after you finish the inner sum, there won't be r in the result - unless you just want to repeat the inner sum (i+1) times.

2. I in Maple is used for sqrt(-1) - it is not a good idea to use this expression to rename it.

3. If you posted it in Maple notation instead of crippled Latex, it would be easier to copy it and to post into Maple. Personally, I stopped correcting it just after noticing double summation over the same variable r.

Alec

I agree with acer that a better advice can be done after looking at the code. There are various possibilities that work in some situations and don't work in others. From things that were not mentioned, I'd like to mention using global variables in procedures, especially those that are used in loops, instead of local variables. That could prevent some typical memory leaks.

Alec

Edwin,

It is so great to see you here!

I think, Edit - Paste as Maple Text might work.

By the way, I found your solution to the reverse problem of copying from Maple to Outlook Express in the MUG group. You wrote:

I was having a similar problem copying from Maple 8 and pasting into
Outlook Express. It was solved by using the Copy as Maple Text option
under Edit.

Alec

 

Another approach (cheating) is to use the solutions of the system.

sys:={diff(x(t),t)=x(t)+y(t), diff(y(t),t)=4*x(t)+y(t)}:sol:=dsolve(sys);

  sol := {x(t) = 1/2 _C1 exp(3 t) - 1/2 _C2 exp(-t),

        y(t) = _C1 exp(3 t) + _C2 exp(-t)}

solve(sol,{_C1*exp(3*t),_C2*exp(-t)});
Warning, solving for expressions other than names or functions is not recommended.

   {_C1 exp(3 t) = 1/2 y(t) + x(t), _C2 exp(-t) = -x(t) + 1/2 y(t)}

Now, to cancel the exponents,

rhs(%[1])*rhs(%[2])^3;
                                                    3
                (1/2 y(t) + x(t)) (-x(t) + 1/2 y(t))

Alec

Just tried plot(x^2, x = -1 .. 1, y = 0 .. 1, labeldirections = [horizontal, vertical]);

In Windows.

Seems to be vertical.

Alec

My favorite tool for this is sprintf. For example, creating a list of digits of a positive integer can be done as

f:=(x::posint)->map(parse,StringTools:-Explode(sprintf("%a",x))):

For example,

n:=987654321:
f(n);
                     [9, 8, 7, 6, 5, 4, 3, 2, 1]

473rd digit of Pi can be found as

parse(sprintf("%a",op(1,evalf[500](Pi)))[473]);

                                  8

Also, procedure NthDigitOfPi from my blog, Search Pi, can be used,

NthDigitOfPi(472);
                                  8

Alec

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