Alec Mihailovs

Dr. Aleksandrs Mihailovs

4455 Reputation

21 Badges

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

It is easier to use Arrays,

x:=Array([$1..1000]);

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

x[10];

                                  10

If you still want to use a loop, that can be done as

for i to 5 do cat(x_,i):=i od;

                               x_1 := 1
                               x_2 := 2
                               x_3 := 3
                               x_4 := 4
                               x_5 := 5

Alec

In Maple, it is more simple. For example,

plottools:-rotate(plots:-textplot([
    seq(seq([i-j,j,binomial(i,j)],j=0..i),i=0..12)],
    axes=none),-3*Pi/4);

135_Pascal.gif

Alec

You can either use

while Xmin>=0

in your loop, or break inside it,

if Xmin<0 then break fi;

or even better,

if Xmin<0 then return ...  fi;

Alec

That's exactly what I suggested.

B;

Alec

Click right mouse button on the matrix placeholder, and select Browse.

Or change rtablesize in the worksheet - something like

interface(rtablesize=infinity);

Alec

For example,

s:=proc(n::posint)
    if n=1 then 1 else s(n-1)+n fi
end;

It is useful also to add option remember,

s:=proc(n::posint)
    option remember;
    if n=1 then 1 else s(n-1)+n fi
end;

Alec

ExcelTools:-Export

Alec

See ?piecewise

Alec

C.E;
                         [4    -1    -7    6]
                         [                  ]
                         [5    -5     8    5]
                         [                  ]
                         [4    -4     7    7]

It is the correct answer for the given input, and the answer given by MatrixMatrixMultiply is the same.

My guess is that you made 2 typos entering C and E. Perhaps, the correct input is the following,

C:=<<1,1,2>|<-3,2,1>|<0,2,-1>>;

                              [1    -3     0]
                              [             ]
                         C := [1     2     2]
                              [             ]
                              [2     1    -1]

E:=<<1,-1,-3>|<-1,0,-2>|<2,3,0>|<3,-1,2>>;

                           [ 1    -1    2     3]
                           [                   ]
                      E := [-1     0    3    -1]
                           [                   ]
                           [-3    -2    0     2]

C.E;

                        [ 4    -1    -7    6]
                        [                   ]
                        [-7    -5     8    5]
                        [                   ]
                        [ 4     0     7    3]

Alec

The function should be defined differently. f(...):= ... is wrong.

It should be either f:=... (an expression), or f:=(... ) -> ... (a function).

In the first case, the plot procedure can look as plot3d(f, x=0..1, y=0..1), and in the second case, as

plot3d('f(x,y,ind[2,k],ind[3,k],ind[2,p],ind[2,p])',x=0..1,y=0..1,numpoints=1000):

using single quotes, such as '

Alec

I don't see how such things can be done in Maple. Even testing continuity is not possible, except trivial examples.

Maple can be used if you know how to do such things by hand, for doing the necessary calculations - such as finding derivatives, but that's it.

Alec

See that thread.

Such repeated questions, probably, should be in the FAQ?

Alec

Also, solve can be used in such situations, with adding a new variable for b/m, add solving for 2 variables in this example, with 2 equations - otherwise the solve won't produce an answer,

solve({eq,b/m=b_m},{b_m,b});
                              g m         g
                         {b = ---, b_m = ---}
                              v_t        v_t

eval(%[2],b_m=b/m);

                                     g
                              b/m = ---
                                    v_t

Alec

Here is the generating function,

series(1/2*Int(log(1-x^2)/(1+x^2),x),x,22);

          3         5         7          9    47   11    37   13
   - 1/6 x  + 1/20 x  - 5/84 x  + 7/216 x  - ---- x   + ---- x   -
                                             1320       1560

         319   15    533   17   1879   19    1627   21      23
        ----- x   + ----- x   - ----- x   + ------ x   + O(x  )
        12600       28560       95760       105840

The formula found by Robert Israel, can be written as

a:=n->(-1)^n*(harmonic(n)-harmonic(floor(n/2)))/(4*n+2);

                      n
                  (-1)  (harmonic(n) - harmonic(floor(1/2 n)))
        a := n -> --------------------------------------------
                                    4 n + 2

seq(a(n),n=1..10);

                -5         -47    37   -319    533   -1879   1627
    -1/6, 1/20, --, 7/216, ----, ----, -----, -----, -----, ------
                84         1320  1560  12600  28560  95760  105840

Alec

So the derivative is

Sum(a(n)/(2*n-1)!*t^(2*n-1),n=1..infinity)=-2*sin(2*t)/(1+cos(t)^2)

which can be written as

Sum(a(n)/(2*n-1)!*t^(2*n-1),n=1..infinity)=- sin(2*t)/(3/4+cos(4*t)/4)

Expanding sin and cos as Taylor series at 0, and multiplying by the denominator, we get the following recurrence,

a(n)=(-1)^n*2^(2*n-1)-Sum((-16)^k*binomial(2*n-1,2*k)*a(n-k),k=1..n-1)/4

which can be written as the following procedure,

a:=proc(n::posint)
option remember;
(-1)^n*2^(2*n-1)-
    add((-16)^k*binomial(2*n-1,2*k)*a(n-k),k=1..n-1)/4
end:

which gives

seq(a(n),n=1..10);

  -2, -16, -32, 18944, 1904128, 41160704, -41418432512,

        -13226611572736, -1026478445821952, 1419327244545818624

The signs seems to go in series of 3 - three minuses, then three pluses etc.

The asymptotic can be found using the command equivalent from the algolib package. It looks rather complicated, so I am not pasting it here.

Alec

First 33 34 35 36 37 38 39 Last Page 35 of 76