Alec Mihailovs

Dr. Aleksandrs Mihailovs

4495 Reputation

21 Badges

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

preview is not very useful usually - it shows a different output - it looks as if it uses different css sheets. 

Such things didn't happen to me often - and I don't usually bother to change the input format - it is usually OK. But once, I remember, it was changed exactly when I used the preview. So maybe the previewing of the post changes its input format.

Alec

preview is not very useful usually - it shows a different output - it looks as if it uses different css sheets. 

Such things didn't happen to me often - and I don't usually bother to change the input format - it is usually OK. But once, I remember, it was changed exactly when I used the preview. So maybe the previewing of the post changes its input format.

Alec

I changed my username there to Alec Mihailovs, and it crashed right after that - perhaps, that may be the cause - changing it in so many places..., and maybe, a space in it.

Alec

That's an old problem of a computer representation of numbers - if they are represented in a binary form, that differs from their decimal representation. For example,

evalhf(0.10);

                         0.100000000000000004

To avoid problems related to that, one can increase Digits,

Digits:=16;

                             Digits := 16

A:=Matrix([[-0.30,0.20,0.10],[0.20,-0.30,0.10],[0.10,0.10,-0.20]]);

                         [-0.30    0.20     0.10 ]
                         [                       ]
                    A := [0.20     -0.30    0.10 ]
                         [                       ]
                         [0.10     0.10     -0.20]

LinearAlgebra:-ReducedRowEchelonForm(A);

                  [1.    -0.    -1.000000000000000]
                  [                               ]
                  [0.    1.     -1.000000000000000]
                  [                               ]
                  [0.    0.             0.        ]

Another way of dealing with that is setting UseHardwareFloats to false,

restart;
A:=Matrix([[-0.30,0.20,0.10],[0.20,-0.30,0.10],[0.10,0.10,-0.20]]):
UseHardwareFloats:=false:
LinearAlgebra:-ReducedRowEchelonForm(A);

                     [1.    -0.    -1.000000000]
                     [                         ]
                     [0.    1.     -1.000000000]
                     [                         ]
                     [0.    0.          0.     ]

Alec

Similarly - keep track of the sign and print if it changes,

x:=1: sol:=solve(y=x-3): s:=signum(sol):
for x from 2 to 10 do 
sol1:=solve(y=x-3); s1:=signum(sol1); 
if s1<>s then 
if x-1<>printed then print(x-1,sol) fi;
printed:=x; print(x,sol1) fi;
sol:=sol1; s:=s1 od:

                                2, -1
                                 3, 0
                                 4, 1

Alec

Similarly - keep track of the sign and print if it changes,

x:=1: sol:=solve(y=x-3): s:=signum(sol):
for x from 2 to 10 do 
sol1:=solve(y=x-3); s1:=signum(sol1); 
if s1<>s then 
if x-1<>printed then print(x-1,sol) fi;
printed:=x; print(x,sol1) fi;
sol:=sol1; s:=s1 od:

                                2, -1
                                 3, 0
                                 4, 1

Alec

plots look the same (if move Maple's plot up by 1).

(1,0) is the derivative over the first variable. Hypergeometric0F1Regularized(b,x) is hypergeom([],[b],x)/GAMMA(b) in Maple if b is not a nonpositive integer, and the limit of that if it is.

Alec

Replacing evalf with evalhf speeds things approximately 4 times. There are some cases where evalf can be used and evalhf - can't though.

The following also works fast,

x:=[Pi,sqrt(2), sqrt(3), sqrt(5), sqrt(10), sqrt(7)]:
sort([seq([evalhf(i),i],i=x)])[..,2];

                   1/2   1/2   1/2   1/2        1/2
                 [2   , 3   , 5   , 7   , Pi, 10   ]

time(seq(sort([seq([evalhf(i),i],i=x)])[..,2],j=1..100000));

                                4.414

time(seq(attributes~(sort([seq(setattribute(evalhf(i),i),i=x)])),
j=1..100000));
                                4.976

Alec

Replacing evalf with evalhf speeds things approximately 4 times. There are some cases where evalf can be used and evalhf - can't though.

The following also works fast,

x:=[Pi,sqrt(2), sqrt(3), sqrt(5), sqrt(10), sqrt(7)]:
sort([seq([evalhf(i),i],i=x)])[..,2];

                   1/2   1/2   1/2   1/2        1/2
                 [2   , 3   , 5   , 7   , Pi, 10   ]

time(seq(sort([seq([evalhf(i),i],i=x)])[..,2],j=1..100000));

                                4.414

time(seq(attributes~(sort([seq(setattribute(evalhf(i),i),i=x)])),
j=1..100000));
                                4.976

Alec

Sorting with attributes, invented by Joe Riel, was a brilliant idea!

Very useful in many cases.

Alec

Sorting with attributes, invented by Joe Riel, was a brilliant idea!

Very useful in many cases.

Alec

Halley's method also could be used - it's convergence rate is cubic (Newton's method - quadratic).

But - both methods use evaluations of exponents - so the asympt (also using exponents) seems to be more simple to use.

Frankly, I don't understand what is wrong with using LambertW "on paper" - the next step would be replasing all sines, cosines, square roots, logarithms and exponents with some partial sums of their series, too?

Alec

Halley's method also could be used - it's convergence rate is cubic (Newton's method - quadratic).

But - both methods use evaluations of exponents - so the asympt (also using exponents) seems to be more simple to use.

Frankly, I don't understand what is wrong with using LambertW "on paper" - the next step would be replasing all sines, cosines, square roots, logarithms and exponents with some partial sums of their series, too?

Alec

Mathematica (but not Wolfram Alpha) gives

In[1]:= Integrate[BesselK[1, t]*t^2, {t, 0, x}, 
    Assumptions -> x > 0]

Out[1]= 2 + 2 BesselI[0, x] - 2 x BesselI[1, x] + 
    x^2 BesselI[2, x] Log[x/2] + 
    4 Hypergeometric0F1Regularized(1,0)[-1, x^2/4]

Alec

In Mathematica, built-in functions start with a capital letter and function arguments or parameters are included in square brackets, so sin(x) should be Sin[x], and, say, cos(1) should be Cos[1].

Alec

First 24 25 26 27 28 29 30 Last Page 26 of 180