acer

32757 Reputation

29 Badges

20 years, 115 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

One of the things that makes textbooks on Maple tricky is that the system keeps evolving. The linalg package gets replaced with LinearAlgebra, the stats package with Statistics, the networks package with GraphTheory, Maplets with embedded components, etc. And some parts get enhanced, for example the newer DAE solvers. So, given a mathematical or programming task, it's quite conceivable that the nicer ways to do it in Maple may change with the advent of a new release. And Maple has been getting new releases most every year, for some time.

So, a text written in 2002 (like the one you cited) may be partially out of date. I find it hard to tell whether the more general Maple books or the ones focussed on some discipline fall behind current maple functionality more quickly. The title of the book that you cited mentions probability and stochastic DEs. The newer Statistics package postdates the book, I believe (as does the Financial Modelling Toolbox, which does Wiener process stuff, etc).

So, depending on the hints you get (here, say) about changes in the product and the books age, you may wish to be extra careful in judging a particular book.

acer

I would like to thank all who posted to this thread. The points raised are very interesting. Hopefully, having several major contributors to this site offer their suggestions/needs will induce those ideas to be weighed and judged carefully.

ps. I'm still editing my list...

acer

LinearSolve uses a general (full rectangular dense) solver on tridiagonal linear floating-point systems. For real data, that means LAPACK dgetrf and dgetrs (NAG f07adf and f07aef). But LinearSolve could be taught to instead use dgttrf and dgttrs which are specialized.

> infolevel[LinearAlgebra]:=1:
> with(LinearAlgebra):

> f := n->Matrix(n,n,shape=band[1,1],scan=band[1,1],
>    [[1$(n-1)],[seq(i,i=1..n)],[1$(n-1)]],
>    storage=rectangular,datatype=float[8]):

> rtable_indfns(f(5)); # it's tridiagonal in structure...
                                  band[1, 1]
 
> rtable_options(f(5),storage); # ...and full storage, as dgttrf expects
                                  rectangular

> LinearSolve(evalf(f(5)),evalf(Vector(5,i->i)));
LinearSolve:   "using method"   LU
LinearSolve:   "calling external function"
LinearSolve:   "NAG"   hw_f07adf
LinearSolve:   "NAG"   hw_f07aef
                            [0.696969696969697017]
                            [                    ]
                            [0.303030303030302983]
                            [                    ]
                            [0.696969696969697017]
                            [                    ]
                            [0.606060606060606077]
                            [                    ]
                            [0.878787878787878896]

Moreover, if the (real) Matrix is symmetric positive-definite then dpttrf and dpttrs could be used.

> type(f(5),'Matrix'(symmetric));
                                     true

> IsDefinite(evalf(f(5)),query=positive_definite);
                                     true

acer

LinearSolve uses a general (full rectangular dense) solver on tridiagonal linear floating-point systems. For real data, that means LAPACK dgetrf and dgetrs (NAG f07adf and f07aef). But LinearSolve could be taught to instead use dgttrf and dgttrs which are specialized.

> infolevel[LinearAlgebra]:=1:
> with(LinearAlgebra):

> f := n->Matrix(n,n,shape=band[1,1],scan=band[1,1],
>    [[1$(n-1)],[seq(i,i=1..n)],[1$(n-1)]],
>    storage=rectangular,datatype=float[8]):

> rtable_indfns(f(5)); # it's tridiagonal in structure...
                                  band[1, 1]
 
> rtable_options(f(5),storage); # ...and full storage, as dgttrf expects
                                  rectangular

> LinearSolve(evalf(f(5)),evalf(Vector(5,i->i)));
LinearSolve:   "using method"   LU
LinearSolve:   "calling external function"
LinearSolve:   "NAG"   hw_f07adf
LinearSolve:   "NAG"   hw_f07aef
                            [0.696969696969697017]
                            [                    ]
                            [0.303030303030302983]
                            [                    ]
                            [0.696969696969697017]
                            [                    ]
                            [0.606060606060606077]
                            [                    ]
                            [0.878787878787878896]

Moreover, if the (real) Matrix is symmetric positive-definite then dpttrf and dpttrs could be used.

> type(f(5),'Matrix'(symmetric));
                                     true

> IsDefinite(evalf(f(5)),query=positive_definite);
                                     true

acer

> h := n-> Matrix(n,n,scan=band[1,1],[[seq(x[i]^2,i=2..n)],
>            [seq(x[i],i=1..n)],[seq(2*x[i],i=1..n-1)]]):

> h(5);
                [x[1]     2 x[1]      0         0         0   ]
                [                                             ]
                [    2                                        ]
                [x[2]      x[2]     2 x[2]      0         0   ]
                [                                             ]
                [             2                               ]
                [  0      x[3]       x[3]     2 x[3]      0   ]
                [                                             ]
                [                       2                     ]
                [  0        0       x[4]       x[4]     2 x[4]]
                [                                             ]
                [                                 2           ]
                [  0        0         0       x[5]       x[5] ]

acer

> h := n-> Matrix(n,n,scan=band[1,1],[[seq(x[i]^2,i=2..n)],
>            [seq(x[i],i=1..n)],[seq(2*x[i],i=1..n-1)]]):

> h(5);
                [x[1]     2 x[1]      0         0         0   ]
                [                                             ]
                [    2                                        ]
                [x[2]      x[2]     2 x[2]      0         0   ]
                [                                             ]
                [             2                               ]
                [  0      x[3]       x[3]     2 x[3]      0   ]
                [                                             ]
                [                       2                     ]
                [  0        0       x[4]       x[4]     2 x[4]]
                [                                             ]
                [                                 2           ]
                [  0        0         0       x[5]       x[5] ]

acer

g:=n->LinearAlgebra:-ToeplitzMatrix([0$(n-1),c,b,a,0$(n-1)]);

g(7);

acer

g:=n->LinearAlgebra:-ToeplitzMatrix([0$(n-1),c,b,a,0$(n-1)]);

g(7);

acer

Apparently there's neat stuff known about this (here, here) and the condition might be simply that numbcomb(3*i,i) is odd.

> G:=n->map(x->[op(x),seq(0,i=1..n-nops(x))],
>           {seq(`if`(type(binomial(3*i,i),odd),convert(i,base,2),
>                     NULL),i=0..(2^n-1))}):


> G(6);
{[0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 1, 0],
 
    [0, 0, 0, 1, 0, 0], [0, 0, 0, 1, 0, 1], [0, 0, 1, 0, 0, 0],
 
    [0, 0, 1, 0, 0, 1], [0, 0, 1, 0, 1, 0], [0, 1, 0, 0, 0, 0],
 
    [0, 1, 0, 0, 0, 1], [0, 1, 0, 0, 1, 0], [0, 1, 0, 1, 0, 0],
 
    [0, 1, 0, 1, 0, 1], [1, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 1],
 
    [1, 0, 0, 0, 1, 0], [1, 0, 0, 1, 0, 0], [1, 0, 0, 1, 0, 1],
 
    [1, 0, 1, 0, 0, 0], [1, 0, 1, 0, 0, 1], [1, 0, 1, 0, 1, 0]}

What I wonder about now is the OP's handle. Did the OP know of the connection to fibonacci numbers?

acer

Apparently there's neat stuff known about this (here, here) and the condition might be simply that numbcomb(3*i,i) is odd.

> G:=n->map(x->[op(x),seq(0,i=1..n-nops(x))],
>           {seq(`if`(type(binomial(3*i,i),odd),convert(i,base,2),
>                     NULL),i=0..(2^n-1))}):


> G(6);
{[0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 1, 0],
 
    [0, 0, 0, 1, 0, 0], [0, 0, 0, 1, 0, 1], [0, 0, 1, 0, 0, 0],
 
    [0, 0, 1, 0, 0, 1], [0, 0, 1, 0, 1, 0], [0, 1, 0, 0, 0, 0],
 
    [0, 1, 0, 0, 0, 1], [0, 1, 0, 0, 1, 0], [0, 1, 0, 1, 0, 0],
 
    [0, 1, 0, 1, 0, 1], [1, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 1],
 
    [1, 0, 0, 0, 1, 0], [1, 0, 0, 1, 0, 0], [1, 0, 0, 1, 0, 1],
 
    [1, 0, 1, 0, 0, 0], [1, 0, 1, 0, 0, 1], [1, 0, 1, 0, 1, 0]}

What I wonder about now is the OP's handle. Did the OP know of the connection to fibonacci numbers?

acer

I believe that it refers to Madam d'Urfe's use of a polyalphabetic (or Vignere) cipher, used to encrypt her document which explained the secret of transmuting base metals into gold.

Supposedly, the key was NABUCODONOSOR. That is Italian for Nebuchadnezzar, a name that I did not expect to write on mapleprimes.

acer

I believe that it refers to Madam d'Urfe's use of a polyalphabetic (or Vignere) cipher, used to encrypt her document which explained the secret of transmuting base metals into gold.

Supposedly, the key was NABUCODONOSOR. That is Italian for Nebuchadnezzar, a name that I did not expect to write on mapleprimes.

acer

It's difficult, without an example, to know what might be happening here. The problem could be how Maple's handling the example, or something to do with the fact that it's getting passed in from Matlab.

Could you post the example, or upload it here as a file?

acer

It's difficult, without an example, to know what might be happening here. The problem could be how Maple's handling the example, or something to do with the fact that it's getting passed in from Matlab.

Could you post the example, or upload it here as a file?

acer

I see, you were using the fact that sets "uniquify" their members and get rids of duplicates. You might use the {} as you had before, to eliminate duplicates. Then, before sorting, convert T to a list, ie. T:=convert(T,list);

Not to throw you off track, as you've been making progress, but I might have chosen a Maple table rather than a list of lists as structure to represent a roll. It's not a big deal -- you should be able to succeed with your own way.

acer

First 521 522 523 524 525 526 527 Last Page 523 of 600