acer

32358 Reputation

29 Badges

19 years, 331 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

@markweitzman I am submitting a bug report, and citing this example.

@vv Thanks. I was adding that example while you were typing your comment. I stand by the suggestion that the casual user may get more joy with seq than have to remember (or understand) such subtleties.

@markweitzman Did you see the bit where I said that I recommend evaluating the Matrix entries up front instead of forcing a valuie for Normalizer? I really meant it.

This is not a bug in LinearAlgebra. It is a bug in the Matrix palette (or typesetting, or some combination of that and the palettes). Working around the palette bug by introducing blind over-evaluation into Library routines would be irresponsibly bad. It should be fixed in the palette, and worked around by the user by evaluating (once) upfront.

 

I see no such problem in at least Maple 12.02, 17.02, 2015.0 and 2015.2 .

 

restart;

M:=Matrix([[5/2, sqrt(3/2), sqrt(3/4)],
           [sqrt(3/2), 7/3, sqrt(1/18)],
           [sqrt(3/4), sqrt(1/18), 13/6]]);

M := Matrix(3, 3, {(1, 1) = 5/2, (1, 2) = (1/2)*6^(1/2), (1, 3) = (1/2)*3^(1/2), (2, 1) = (1/2)*6^(1/2), (2, 2) = 7/3, (2, 3) = (1/6)*2^(1/2), (3, 1) = (1/2)*3^(1/2), (3, 2) = (1/6)*2^(1/2), (3, 3) = 13/6})

with(LinearAlgebra):

Eigenvalues(M);

Vector[column]([[1], [2], [4]])

evals,evecs:=Eigenvectors(M);

evals, evecs := Vector(3, {(1) = 2, (2) = 1, (3) = 4}), Matrix(3, 3, {(1, 1) = 0, (1, 2) = -3^(1/2), (1, 3) = 3^(1/2), (2, 1) = -(1/2)*2^(1/2), (2, 2) = 2^(1/2), (2, 3) = 2^(1/2), (3, 1) = 1, (3, 2) = 1, (3, 3) = 1})

map(radnormal, M.evecs - evecs.DiagonalMatrix(evals));

Matrix([[0, 0, 0], [0, 0, 0], [0, 0, 0]])

kernelopts(version);

`Maple 2015.2, X86 64 WINDOWS, Nov 13 2015, Build ID 1087698`

 

Download lae.mw

Could it be that you have some other package loaded, or something in your initialization file that interferes?

Right before you call Eigenvectors, what do each of the commands eval(Normalizer) and eval(Testzero) produce? One way to get that all-zero result for the eigenvectors Matrix is to have Normalizer set to something other than identically normal and weaker than radnormal or simplify. It's important for the nullspace computation that the radicals are dealt with, including adequate zero-recognition while choosing pivots.

acer

Step 5 involves obtaining roots of a polynomial of degree n, and I don't see how the restrictions on the unknown elements (from step 1) are enough to provide an explicit symbolic solution to that.

What would you eventually do with these n functions? If at some point (no matter how far down the road) you are going to want to evaluate these functions at numeric values of the unknowns then why would not a "black box" apporach work? For that I mean that your Matrix in step 1 has n^2-n unknowns. You could construct a procedure which accepted values for the unknowns and returned the final n eigenvalues. You could then call this procedure (on the fly) and so simulate the n functions at any numeric value set. Would that suffice? You could also try calling that procedure with symbolic values and -- if there were some strong pattern of commonality to the symbols used for the n^2-n parameters -- possibly arrive at special cases of somewhat nice explicit n formula. Do this sound like it might do?

acer

I'd like to add one note to Carl's excellent post.

The ideas demonstrated by Carl are central to the reasons why Maple computes the characteristic polynomial of a Matrix with floating-point values by first computing the eigenvalues and then computing the polynomial as an unexpanded product of factors using those values. In other words, for a Matrix of floating-point values the CharacteristicPolynomial command computes the charcteristic polynomial by first computing the eigenvalues, and it does not compute the polynomial by taking the determinant of the characteristic Matrix.

Now, fsolve can immediately pick off the roots of said unexpanded characteristic polynomial. And that is why the green symbols in the plot below, taken from LA:-CharacteristicPolynomial(Af, x) are also on target. Of course there is not much point in using this to obtain the roots, as using the Eigenvalues command is more direct and skips two unnecessary steps (of forming an unexpanded polynomial from roots, and then picking the roots off). It's simpler and direct to simply use Eigenvalues command, as Carl demonstrates.

So I add this note just to illustrate what LA:-CharacteristicPolynomial(Af, x) provides.


restart:

macro(LA= LinearAlgebra):

RootPlot := (R::list(complexcons))->

     plot([Re,Im]~(R), style= point, symbol= cross, symbolsize= 24,

          axes= box, color= red, labels= [Re,Im], args[2..]):

Digits := 15:

n := 2^4:

A := LA:-RandomMatrix(n):

Af := Matrix(A, datatype= float[8]):

plots:-display([ RootPlot(convert(LA:-Eigenvalues(Af), list),
                          color= blue,symbol=circle),
                 RootPlot([fsolve(LA:-CharacteristicPolynomial(A, x), complex)],
                          color=red,symbol=cross),
                 RootPlot([fsolve(LA:-CharacteristicPolynomial(Af, x), complex)],
                          color=green,symbol=diagonalcross),
                 RootPlot([fsolve(LA:-Determinant(Af - LA:-DiagonalMatrix([x$n])), complex)],
                          color=cyan,symbol=solidcircle,symbolsize=10)
               ],
               gridlines=false );

M := LA:-RandomMatrix(3, datatype=float[8]):
LA:-CharacteristicPolynomial(M, x);
LA:-Eigenvalues(M);

(x+145.423947544059-0.*I)*(x+21.8830710756831-0.*I)*(x-65.3070186197422-0.*I)

Vector[column]([[-145.423947544059+0.*I], [-21.8830710756831+0.*I], [65.3070186197422+0.*I]])

 


Download EV.mw

acer

What do you see if you set Digits:=80 at the start? 

acer

@Markiyan Hirnyk That's why I mentioned the material of mathematician Clayton Shonkwiler.

@Markiyan Hirnyk 

I recently saw links on community.wolfram.com to the following collections of animations: here, here and here. The last of those contains work by Clayton Shonkwiler, who has posted source to some of his work on that Wolfram community site.

@perr7 I am looking at trying to improve your example. It is slow because I am very busy right now with other things, sorry.

@Axel Vogt Thank's Axel.

I should be more polite and tell the questioner this:

.tar.gz is a Unix/Linux/OSX thing. It means that the file or files were bundled together with the `tar` untility and then compressed with the `gzip` utility (well, `tar` can do both nowadays).

It just means that the files were bundled and compressed, producing something similar to a .zip archive.

It's not a Maple thing. It's just an general operating system question. You just need a utility for Windows that understands .tar.gz compressed archives. There are several such things on the internet, most of which can handle .tar.gz as well as zip archives, etc. Axel has named one. Another is Winzip. Some are free.

@Carl Love I suspect what he wants (in 2D Math parlance), is more like (1)=~0 where (1) is probably an equation label reference.

Of course he could also assign it to some name, first...

@Markiyan Hirnyk How does your example "p:=(x-1)*(x-2), q:=(x-2)*(x-3), and r:= (x-1)*(x-3)" relate to what was given by you originally?

The text in your post is garbled. (Did you try to paste it in from 2D Input or something?)

Also, what do you mean by xe, x2, and y2?

Anyway, this works for me in Maple 2015,

plots:-densityplot(x*exp(1)-x^2-y^2,x=-2..2,y=-2..2,
                   colorscheme=["Blue","Green","Orange"],style=surface);

acer

First 312 313 314 315 316 317 318 Last Page 314 of 592