Alec Mihailovs

Dr. Aleksandrs Mihailovs

4495 Reputation

21 Badges

20 years, 337 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

Since Maple is already using NAG libraries for linear algebra and numerical integration, why not to use them for the inverse Laplace transform as well, C06LBF and C06LCF? __________ Alec Mihailovs http://mihailovs.com/Alec/
I used your M in this example, with units. Plot commands, such as pointplot, are designed to work only with numbers, so units have to be stripped off, one way, or another. eval(M,Unit=1) does that. If you need to do that often, you can make it into a procedure,
Upp:=M->plots[pointplot](eval(M,Unit=1),args[2..-1]):
and use it, for example, as,
Upp(M,color=red);
__________ Alec Mihailovs http://mihailovs.com/Alec/
As you said, it is easy to do that by getting rid of units. For example,
pointplot(eval(M,Unit=1), color = red, labels=[atm,L]);
__________ Alec Mihailovs http://mihailovs.com/Alec/
Will, Excellent work! This site is getting better and better every day! __________ Alec Mihailovs http://mihailovs.com/Alec/
It works if the first residue command (giving the wrong answer) was not issued, or after restart,
restart;
f := 1/(1-2^s):
p := 2*Pi/log(2):
`normal/expanded`:=combine:
residue(f,s=I*p);
                            -1/ln(2)
Also, forget can be used to clear the remember table,
restart;
f := 1/(1-2^s):
p := 2*Pi/log(2):
residue(f,s=I*p);
                               0
forget(residue):
`normal/expanded`:=combine:
residue(f,s=I*p);
                           -1/ln(2)
Without restart or forget, residue looks in its remember table first and gives the answer from there instead of calculating it again. By the way,
`normal/expanded`:=normal:
also works the same as `normal/expanded`:=combine: in the latter example, and it is, perhaps, better to use it in that form, with normal if possible - that might have less undesirable consequences in further calculations. normal doesn't work the same as combine for your first example in this thread though. It is a kind of humorous that
`normal/expanded`:=x->x:
also works in both examples. _________ Alec Mihailovs http://mihailovs.com/Alec/
It is interesting that
residue(1/(1-exp(Pi*s)),s=2*I);

                               -1/Pi
works OK. That can be used to produce the correct answer in the original residue as
restart;
`normal/expanded`:=combine:
residue(1/(1-exp(Pi)^s),s=2*I);

                                -1/Pi
__________
Alec Mihailovs 
http://mihailovs.com/Alec/
That's what I wanted to avoid in the post starting this thread, I wrote: "(to avoid inserting picture manually)". That's exactly what I did in the worksheet - set plotsetup to gif and then manually inserted pictures. That takes some time when there are many pictures. It would be nice if instead of manual inserting gifs I could type something like ImportPicture(...); that produced the same effect. That was the original suggestion.
You should be able to see plots if you produse a .ps (PostScript) file. Some DVI viewers show them too (through postscript). They can not be used in pdf directly. You first have to use something like epstopdf to convert them to pdf and then change corresponding places in the .tex file with references to them (from eps to pdf). As far as I recall, I used graphix package for making references to them (that was long time ago and there might exist better ways now, it is a good idea to look through the pdftex documentation or examples.) Another way is first produce a .ps file and then convert it to pdf. Actually, the best pdf files that I produced (see my old Maple page), I made in another way - first using export to rtf from the worksheet, then opening the produced rtf file in Word and using Acrobat to produce pdf. There are also free tools for converting rtf (or doc) to pdf - for example, it can be printed to a file using a pdf printer driver (that doesn't produce bookmarks or http links though.)
You should be able to see plots if you produse a .ps (PostScript) file. Some DVI viewers show them too (through postscript). They can not be used in pdf directly. You first have to use something like epstopdf to convert them to pdf and then change corresponding places in the .tex file with references to them (from eps to pdf). As far as I recall, I used graphix package for making references to them (that was long time ago and there might exist better ways now, it is a good idea to look through the pdftex documentation or examples.) Another way is first produce a .ps file and then convert it to pdf. Actually, the best pdf files that I produced (see my old Maple page), I made in another way - first using export to rtf from the worksheet, then opening the produced rtf file in Word and using Acrobat to produce pdf. There are also free tools for converting rtf (or doc) to pdf - for example, it can be printed to a file using a pdf printer driver (that doesn't produce bookmarks or http links though.)
identify, or convert/rational can be used,
a:=Optimization:-Maximize(t^2*(1-t)^2*(1+t^2)*(1+(1-t)^2),t=0..1);

       a := [0.0976562500000000002, [t = 0.499999999999999888]]

identify(a[1]);

                                 25
                                 ---
                                 256

convert(rhs(a[2,1]),rational);

                                 1/2
identify, or convert/rational can be used,
a:=Optimization:-Maximize(t^2*(1-t)^2*(1+t^2)*(1+(1-t)^2),t=0..1);

       a := [0.0976562500000000002, [t = 0.499999999999999888]]

identify(a[1]);

                                 25
                                 ---
                                 256

convert(rhs(a[2,1]),rational);

                                 1/2
Jan, Thank you, I didn't realize that. Prewiew(Read(... does almost exactly what I wanted,
BM:=proc(n::posint,m::posint)
local X,N,W,A,c,i;
uses Statistics,ArrayTools,ImageTools;
X:=RandomVariable(Normal(0,1/sqrt(n)));
N:=Concatenate(2,Array(1..m),Alias(Sample(X,m*n),[1..m,1..n]));
W:='CumulativeSum(N[i])'$i=1..m;
A:=`+`(W)/m;
c:=[seq(evalhf(i/n),i=0..n)];
plotsetup(jpeg,plotoutput=cat("BM",args,".jpg"));
print(plots[display](
LineChart(A,xcoords=c,color=red,thickness=2),LineChart([W],xcoords=c),
symbolsize=1,axes=boxed));
plotsetup(default);
print(Preview(Read(cat("BM",args,".jpg"))))
end:

BM(1000,1000); 
           It took a lot of time and memory, but the worksheet size was smaller (15 MB comparing to 87 MB), still too big though. The produced plot size was rather small (thumbnail) and it was included in a larger box with additional axes. Also, I couldn't see the red color on the picture (it seems to be the jpeg driver's fault.) So I am reformulating my suggestion as follows: to extend Preview command in such way that it produced standard looking plots if desirable - full size and without additional axes. The following manipulation does that,
plots[display](ImageTools:-Preview(ImageTools:-Read("BM10005.jpg")),
axes=none);
but the quality is not that great. Another suggestion is to add to ImageTools a command inverse to Preview that creates an ImageTools Array from a plot structure (without intermediate writing on the disk.) _________ Alec Mihailovs http://mihailovs.com/Alec/
Axel, Excellent idea! Thank you! I'll try to incorporate it and maybe we could submit the worksheet to the Maple Application center, with 4 authors: you, Alex, Stephen Ryder, and me. _________ Alec Mihailovs http://mihailovs.com/Alec/
It seems odd that while that works nicely with the definite integral, that doesn't work the same for the indefinite integral,
int(sqrt(x^4+1)/x^2,x);

      4     1/2                                   /
    (x  + 1)                2   1/2       2   1/2 |
  - ----------- + 2 I (1 - x  I)    (1 + x  I)    |
         x                                        \

                    / 1/2             \
                    |2             1/2|
        EllipticF(x |---- + 1/2 I 2   |, I)
                    \ 2               /

                       / 1/2             \    \     /
                       |2             1/2|    |   / |
         - EllipticE(x |---- + 1/2 I 2   |, I)|  /  |
                       \ 2               /    / /   \

        / 1/2             \            \
        |2             1/2|   4     1/2|
        |---- + 1/2 I 2   | (x  + 1)   |
        \ 2               /            /
I wonder if there is a way in Maple to convert elliptic functions with a pure imaginary parameter to elliptic functions with a real parameter without using the manually entered well-known formula.
Alex, Thank you. I waited for that. I thought that there should be an effective way of doing that with vectors, without converting them to lists, but couldn't find it. Alec
First 156 157 158 159 160 161 162 Last Page 158 of 180