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

For example,
dEq := diff(theta(t), t, t) = sin(theta(t)):
soln := dsolve({dEq, theta(0) = 0, (D(theta))(0) = 1}, theta(t),numeric):
f:=u->eval(theta(t),soln(u)):
would give you the solution, with f(t) representing theta(t). For example,
f(0.1);
                         0.100166673739512033
Now, if you want to find the value of t such that f(t)=2, fsolve can be used,
fsolve('f'(u)=2);

                             1.484991931
Check that,
f(%);
                         1.99999999922778282
__________ Alec Mihailovs http://mihailovs.com/Alec/
For example,
dEq := diff(theta(t), t, t) = sin(theta(t)):
soln := dsolve({dEq, theta(0) = 0, (D(theta))(0) = 1}, theta(t),numeric):
f:=u->eval(theta(t),soln(u)):
would give you the solution, with f(t) representing theta(t). For example,
f(0.1);
                         0.100166673739512033
Now, if you want to find the value of t such that f(t)=2, fsolve can be used,
fsolve('f'(u)=2);

                             1.484991931
Check that,
f(%);
                         1.99999999922778282
__________ Alec Mihailovs http://mihailovs.com/Alec/
It's a good idea,
eq:=argument(exp(phi*I))=argument(exp(phi*I+2*Pi*I)):

evalb(eq) assuming real;

                                 true

map(evalc,eq);

                           phi = phi + 2*Pi

isolate(%,2)/2;
                                1 = 0
__________ Alec Mihailovs http://mihailovs.com/Alec/
It's a good idea,
eq:=argument(exp(phi*I))=argument(exp(phi*I+2*Pi*I)):

evalb(eq) assuming real;

                                 true

map(evalc,eq);

                           phi = phi + 2*Pi

isolate(%,2)/2;
                                1 = 0
__________ Alec Mihailovs http://mihailovs.com/Alec/

Well, the answer to Trivia 1 can be obtained by typing just one of these words in a Maple session (not in TTY). I can suggest one answer to Trivia 2 that I discovered recently,

op(ImageTools:-Read(cat(kernelopts(datadir),
  "/help/ImageTools/fjords.jpg")));

It takes some time though. __________ Alec Mihailovs http://mihailovs.com/Alec/

Well, the answer to Trivia 1 can be obtained by typing just one of these words in a Maple session (not in TTY). I can suggest one answer to Trivia 2 that I discovered recently,

op(ImageTools:-Read(cat(kernelopts(datadir),
  "/help/ImageTools/fjords.jpg")));

It takes some time though. __________ Alec Mihailovs http://mihailovs.com/Alec/

As you said, your input is invisible, and I am not that brave to download worksheets - because theoretically speaking, running them in a secure mode should be safe, but knowing Maple for a long time, there is a significant difference between what should be in Maple and what actually is. Nevertheless, I think that the following 2 ways are slightly shorter. 1st way (algebraic).
solve(sqrt((x+c)^2+y^2)+sqrt((x-c)^2+y^2)=2*a,{y^2});

                          2  2    2  2    2  2    4
                    2   -x  a  - c  a  + x  c  + a
                  {y  = ---------------------------}
                                     2
                                    a

collect(op(%),x);

                           2    2   2     2  2    4
                    2   (-a  + c ) x    -c  a  + a
                   y  = ------------- + -----------
                              2              2
                             a              a

simplify((%-op([2,1],%))/op([2,2],%));

                        2  2    2  2    2  2
                      -y  a  - x  a  + x  c
                      ---------------------- = 1
                           2    2    2
                          a  (-a  + c )

collect(%,[x,y]);

                           2        2
                          x        y
                         ---- - -------- = 1
                           2      2    2
                          a     -a  + c
2nd way (geometric)
with(geometry):
interface(showassumed=0):
ellipse(p,['foci'=[point(F1,-c,0),point(F2,c,0)],'MajorAxis'=2*a],[x,y]) 
  assuming a>c,c>0:
Equation(p);
              2       2   2       4       2  2       2  2
        (-16 c  + 16 a ) x  - 16 a  + 16 a  y  + 16 a  c  = 0

simplify(-%/tcoeff(lhs(%),[x,y])+1);

                        2  2    2  2    2  2
                      -x  c  + x  a  + a  y
                      ---------------------- = 1
                           2    2    2
                          a  (-c  + a )

collect(%,[x,y]);

                           2        2
                          x        y
                         ---- + -------- = 1
                           2      2    2
                          a     -c  + a
By the way, it is an example of a thing that shouldn't happen, but it does. Why I use interface(showassumed=0)? Because a and c shouldn't get trailing tildes after using assuming, but they did. __________ Alec Mihailovs http://mihailovs.com/Alec/
I didn't read the Compiler help files recently, but as far as I recall, integer[4] is the largest available format for integer and float[8] - for float. Even if integer[8] was supported, that wouldn't help in this situation, because x86 registers are 32 bit - they can't fit longer numbers, so longer integers would have to be transfered to FPU anyway, the same as float[8] (and the FPU is about 3 times slower than x86). Actually, only c needed to be transfered there - and there is only one operation with it during a loop, so that doesn't slow down much the whole process. Certainly, in the form it is written, it is not a big problem to rewrite it directly in assembler - that would give at least 3 times speed increase comparing to C (usually it is much more, but for such simple things as adding or subtracting 1s C compilers can't do much worse than making it about 3 times slower than assembler, I think). With optimization, I might get to 10-20 times speed increase - that would allow to get F(14) in a reasonable time - but optimization in assembler requires a lot of hard work, and I am not that interested in that to do it... All sequences in the OEIS are interesting. There was a discussion about this particular sequence on the seqfan mailing list. __________ Alec Mihailovs http://mihailovs.com/Alec/
By the way, an interesting question is about Maplet construction sources. Now, when Java became GPL'd, all its extensions should be provided with sources (and should be GPL'd as well). While the interface is just a Java application and the sources in that case may be perhaps treated differently, Maplets are clearly the extension of Java language, so all the sources of all of their elements should be clearly available, in plain text format - not just somewhere in the library (in binary). __________ Alec Mihailovs http://mihailovs.com/Alec/
By the way, an interesting question is about Maplet construction sources. Now, when Java became GPL'd, all its extensions should be provided with sources (and should be GPL'd as well). While the interface is just a Java application and the sources in that case may be perhaps treated differently, Maplets are clearly the extension of Java language, so all the sources of all of their elements should be clearly available, in plain text format - not just somewhere in the library (in binary). __________ Alec Mihailovs http://mihailovs.com/Alec/
My guess would be that the implicitplot was recently improved (it didn't work that great earlier, but it works much better now) while spherical plot is still using some old adaptive algorithm that goes into great detail near the singularity. Also, the functions plotted in implicitplot and in spherical plot, are different. Implicitplot is plotting a polynomial that should be handled very well by external libraries and evalhf, but the spherical plot is plotting RootOf that can not be handled by external libraries or evalhf. Which angle coordinate is which, can be seen from comparing 2 plots,
plot3d(1,theta=0..2*Pi,phi=0..Pi/2,
coords=spherical,scaling=constrained,axes=boxed);

plot3d(1,theta=0..Pi/2,phi=0..2*Pi,
coords=spherical,scaling=constrained,axes=boxed);
Regards, __________ Alec Mihailovs http://mihailovs.com/Alec/
I just wonder if -x^2*z*3 is intentional, or it meant to be -x^2*z^3 (the plots look similar) ? By the way, it is not related to the topic, but the standard angle limits in spherical coordinates are theta=0..2*Pi, phi=0..Pi. __________ Alec Mihailovs http://mihailovs.com/Alec/
solvefor produces the following warning:
Warning, solvefor is deprecated. Please use solve command.
Obviously, that was written by a Java programmer. In Java, "deprecated" means that it exists in the current Java distribution, but it is not supported and may (or will) disappear in the next JDK release. Maple, as we know, supports backwards (to Maple 6) compatibility, so the command, probably, won't disappear. However, it may be not maintained anymore. Comparing showstat(solve) and showstat(solvefor), one can see that solve is about twice as long as solvefor, so it may include various cases not covered by solvefor. __________ Alec Mihailovs http://mihailovs.com/Alec/
solvefor produces the following warning:
Warning, solvefor is deprecated. Please use solve command.
Obviously, that was written by a Java programmer. In Java, "deprecated" means that it exists in the current Java distribution, but it is not supported and may (or will) disappear in the next JDK release. Maple, as we know, supports backwards (to Maple 6) compatibility, so the command, probably, won't disappear. However, it may be not maintained anymore. Comparing showstat(solve) and showstat(solvefor), one can see that solve is about twice as long as solvefor, so it may include various cases not covered by solvefor. __________ Alec Mihailovs http://mihailovs.com/Alec/
New features seem very exciting. I certainly agree that I should be able to try them out. However, I don't have an access to beta. __________ Alec Mihailovs http://mihailovs.com/Alec/
First 143 144 145 146 147 148 149 Last Page 145 of 180