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

For example,

<<X|Y>,<<($1..9)>|Vector(9,x->fsolve(x*y=2))>>;

                         [X         Y      ]
                         [                 ]
                         [1         2.     ]
                         [                 ]
                         [2         1.     ]
                         [                 ]
                         [3    0.6666666667]
                         [                 ]
                         [4    0.5000000000]
                         [                 ]
                         [5    0.4000000000]
                         [                 ]
                         [6    0.3333333333]
                         [                 ]
                         [7    0.2857142857]
                         [                 ]
                         [8    0.2500000000]
                         [                 ]
                         [9    0.2222222222]

Alec

alias(f(x)=exp(a*x));
                                 f(x)

diff(f(x),x);

                                a f(x)

Alec

For example,

min(select(x->has(A[x],sin),[$1..nops(A)]));

                                  77

or

select(x->has(A[x],sin),[$1..nops(A)])[1];

                                  77

or

ListTools:-Search(true,has~(A,sin));

                                  77

Alec

Try to put a multiplication sign between 2 and (1+t). Also, it should be y(t) instead of y, and I don't think you actually meant y(t)=t in the declare.

dsolve({diff(y(t),t)= 2*(1+t)*y(t)^(3), y(0)=2^(-1/2)});
 
                                      1
                      y(t) = -------------------
                                           2 1/2
                             (2 - 4 t - 2 t )

Alec

Unfortunately, the situation with Maple export to LaTeX is similar to the conversion from Mathematica to Maple - it works only on a small subset of Maple and when it works, the otput produced by LaTeX looks rather different than in either Classic or Standard worksheets. Even simple fractions are displayed wrongly,

1/2/a;
                                  1
                                 ---
                                 2 a

latex(%);
1/2\,{a}^{-1}

Alec

For example,

eq:=V1 = -R2/R1*Vin, 
    V2 = -Vo/(C1*R4*s)-V1/(C1*R3*s), 
    Vo = R6*V2/(R6+R5)+R6*Vin/(1/(C2*s)+R6);
sol:=solve({subs(eq[1..2]),eq[3]},{Vo,Vin});
sol1:=eval(Vo/Vin,sol);
form:=a*(s^2+b*s+c)/(s^2+d*s+e);
sol2:=solve(identity(sol1=form, s),{a,b,c,d,e});
Vo/Vin=eval(form,sol2);

               2        R6 R2 s                  R2
              s  + ------------------ + ---------------------
   Vo              C1 R1 R3 (R6 + R5)   C1 C2 (R6 + R5) R1 R3
   --- = ----------------------------------------------------------
   Vin              2
          2   (C2 R6  + R6 C1 R4 + R5 C1 R4) s           1
         s  + -------------------------------- + ------------------
                   C1 R4 R6 (R6 + R5) C2         R4 C1 C2 (R6 + R5)

Alec

That was discussed a month ago in another thread.

For presentations (and lectures), it is possible just to open a worksheet and execute it, or execute step by step during presentation. No need in the read command, or saving in the archive.

For distribution a package, the normal way is to distribute a library, with help files. To use it, one has to add its location to the libname. Not too complicated.

The older way of doing that is described in ?examples,binarytree. The newer way is similar, but with using LibraryTools procedures instead of march.

Alec

That follows from the positivity and additivity of probability.

If say, the distances of the two values to the mean are a and b with a<b, then the probability that another value is closer to the mean than b, is the sum of probabilities that it is closer than a and that the distance of it to the mean is between a and b (possibly equal to a).

The second term in the sum is nonnegative, so the sum is greater or equal than the first term in it.

Alec

Also, you could use FileTools:-Exists (it has try-catch hidden inside). If it is true - ImportMatrix, otherwise - either print whatever you want, or error ... (whatever) to exit from a procedure.

Alec

In this example, the sys can be defined as

sys:={seq(diff((f_||n)(t),t)=
    add(f_||i(t),i=n..1000),n=1..1000)};

Alec

parse(convert(readbytes("notgood.txt",infinity),bytes),statement):

Alec

1. It may be a bug. The simplest workarounds are either add few square brackets to the list - something like

B:=Matrix(3,4,[[1,2,3,4],[5,6]],fill=8);

                            [1    2    3    4]
                            [                ]
                       B := [5    6    8    8]
                            [                ]
                            [8    8    8    8]

B:=Matrix(3,4,[ListTools:-LengthSplit([1,2,3,4,5,6],4)],
    fill=8);

                            [1    2    3    4]
                            [                ]
                       B := [5    6    8    8]
                            [                ]
                            [8    8    8    8]

or add 8s directly to the list - something like

B:=Matrix(3,4,[1,2,3,4,5,6,8$6]);

                            [1    2    3    4]
                            [                ]
                       B := [5    6    8    8]
                            [                ]
                            [8    8    8    8]

2. There are several ways of doing that. For example,

[seq(i,i=A^%T)];

                 [1, 2, 3, 4, 5, 6, 0, 0, 0, 0, 0, 0]

Alec

You could try plotting vectors in Sage. Here is another link, with 3D-plots that can be rotated.

Alec

As the subject says.

Alec

Also, the answer can be written in 2 different forms,

1/2*(b-a)*Pi^(1/2)*WhittakerW(-1/2,-1/2,4/(b-a)^2)*exp(-2/(b-a)^2)

and

1/2*(b-a)*Pi^(1/2)*KummerU(1/2,0,4/(b-a)^2)*exp(-4/(b-a)^2)

Alec

First 16 17 18 19 20 21 22 Last Page 18 of 76