Alec Mihailovs

Dr. Aleksandrs Mihailovs

4455 Reputation

21 Badges

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

convert("ComplexExpand[(1 + I)^n + (1 - I)^n]",FromMma);

                                   n          n
                      evalc((1 + I)  + (1 - I) )

simplify(%);

                          (1 + n/2)     n Pi
                         2          cos(----)
                                         4

Alec

There is also Kalman code generator.

Alec

Also, you don't need both eval and subs. Any one of them is good enough,

sol1:= solve(eq1, nstart);

                   2            1/2
          ((-nfinal  + R L) R L)    nfinal
  sol1 := --------------------------------,
                          2
                   -nfinal  + R L

                   2            1/2
          ((-nfinal  + R L) R L)    nfinal
        - --------------------------------
                          2
                   -nfinal  + R L

subs(L = 6.561123702*10^(-7), nfinal = 2, R = 0.1097373e8, [sol1]);

                     [3.000000001, -3.000000001]

eval([sol1],[L = 6.561123702*10^(-7), nfinal = 2, R = 0.1097373e8]);

                     [3.000000000, -3.000000000]

Alec

It's not even clear how to make a UI in Maple - similar, say, to the Silverlight Go game.

In a Maplet, perhaps, but the Image maps (with actions associated to clicking on some region in the image) seems to be not implemented.

Sage allows including any HTML (and Javascript) in the notebook - so it would be, certainly, much easier to do in Sage than in Maple or Mathematica.

Alec

For example,

MmaTranslator:-Mma:-RealDigits(a)[1];

                    [7, 4, 3, 6, 7, 8, 5, 3, 9, 4]

That is quite buggy and doesn't work for positive numbers less than 1. The following is better,

ListTools:-Reverse(convert(op(1,a),base,10));

                       [7, 4, 3, 6, 7, 8, 5, 4]

Using strings, that can be done as

convert(sprintf("%d",op(1,a)),bytes)-~48;

                       [7, 4, 3, 6, 7, 8, 5, 4]

Alec

Simple manipulations with generating functions give

c(k)=add(d(m)*bernoulli(m-k+1)/(m-k+1)!,m=k-1..j-1)

for k from 1 to j.

In more details, the equations for d(m) are equivalent to

Sum(d(m)*t^(-m),m=0..j-1)=(exp(t)-1)*Sum(c(k)*t^(-k),k=1..j) + O(t);

      j - 1                           /  j             \
      -----                           |-----           |
       \          (-m)                | \          (-k)|
        )   d(m) t     = (exp(t) - 1) |  )   c(k) t    | + O(t)
       /                              | /              |
      -----                           |-----           |
      m = 0                           \k = 1           /

From here,

Sum(c(k)*t^(-k),k=1..j)=1/(exp(t)-1)*Sum(d(m)*t^(-m),m=0..j-1)+O(1);

                                 j - 1
                                 -----
                                  \          (-m)
                                   )   d(m) t
                j                 /
              -----              -----
               \          (-k)   m = 0
                )   c(k) t     = ---------------- + O(1)
               /                    exp(t) - 1
              -----
              k = 1

Which written coefficientwise give the formulas at the beginning of this post.

Alec

That can be done using seq,

add(a[i],i=seq(1..4,2));

                             a[1] + a[3]

In your example with plotCounter, just add 5 or another step as the last parameter in seq, after plotCounter = 1 .. nops(drivingForceList)

Alec

In this example,

s:="=====

1

00:00:20,000 --> 00:00:24,400

In connection with a dramatic increase

in crime in certain neighbourhoods,

 

2

00:00:24,600 --> 00:00:27,800

the government is implementing a new policy...

=====
";
 
use StringTools in 
    Join(select(HasAlpha,Split(s,"\n")),"\n") 
end;

  "In connection with a dramatic increase
        in crime in certain neighbourhoods,
        the government is implementing a new policy..."

Alec

The asymptotic gives some evidence for that,

asympt(b,n);

                           exp(1)          exp(1)      1
           exp(1) + 1/6480 ------ - 1/3240 ------ + O(----)
                              4               5         6
                             n               n         n

It is not the proof though.

Alec

Or you could do

<<a>|<b>>;
                           [ 1        1.  ]
                           [              ]
                           [1/2     0.5000]
                           [              ]
                           [1/3     0.3333]
                           [              ]
                           [1/4     0.2500]
                           [              ]
                           [1/5     0.2000]
                           [              ]
                           [1/6     0.1667]
                           [              ]
                           [1/7     0.1429]
                           [              ]
                           [1/8     0.1250]
                           [              ]
                           [1/9     0.1111]
                           [              ]
                           [1/10    0.1000]

Alec

The error term can be estimated as

series((1+1/n)^(n+1/2),n=infinity);
                    exp(1)        exp(1)   113  exp(1)      1
      exp(1) + 1/12 ------ - 1/12 ------ + ---- ------ + O(----)
                       2             3     1440    4         5
                      n             n             n         n

series((1+1/n)^n,n=infinity);

               exp(1)   11 exp(1)        exp(1)   2447 exp(1)
  exp(1) - 1/2 ------ + -- ------ - 7/16 ------ + ---- ------
                 n      24    2             3     5760    4
                             n             n             n

              1
         + O(----)
               5
              n

In the first case the absolute error is O(1/n^2) which is significantly better than O(1/n) in the second case.

Alec

f:=(x+1+I*(y-3))/(5+3*I) = 1+I:

solve(evalc({Re,Im}(f)));

                           {x = 1, y = 11}

Alec

To see a particular element, say (1,1,1), one can do

Cf1[compts][1,1,1];

                                  0

All of them can be seen as

eval(Cf1[compts]);

or

Array(eval(Cf1[compts]));

                   [ 1..4 x 1..4 x 1..4 3-D Array ]
                   [ Data Type: anything          ]
                   [ Storage: rectangular         ]
                   [ Order: Fortran_order         ]

then click right mouse button on the Array placeholder and select Browse, or as

MTM:-disp(eval(Cf1[compts]));

The tensor package is deprecated and you should be using DifferentialGeometry:-Tensor instead, which doesn't have this display problem.

Alec

That also could be done as

eval(ans,[X=1,Y=2,Z=3,Bra=(x->x),Ket=(x->x),
    Bracket=((i,a,j)->Matrix(3,{(i,j)=a}))]);

                      [a[11]    a[12]    a[13]]
                      [                       ]
                      [a[21]    a[22]    a[23]]
                      [                       ]
                      [a[31]    a[32]    a[33]]

Alec

I don't download mw files for security reasons. Could you just post the important parts in plain text here (so that the commands could be easily copied and pasted in Maple, and not only using Firefox)?

Alec

First 19 20 21 22 23 24 25 Last Page 21 of 76