Dr. David Harrington

3252 Reputation

17 Badges

18 years, 31 days
University of Victoria
Professor or university staff
Victoria, British Columbia, Canada

Social Networks and Content at Maplesoft.com

Maple Application Center
I am a professor of chemistry at the University of Victoria, BC, Canada, where my research areas are electrochemistry and surface science. I have been a user of Maple since about 1990.

MaplePrimes Activity

These are replies submitted by dharr

This gives -1 in Maple 2015 but doesn't work in 2017. Don't have 2018...


shape=hermitian can be used if the matrices are going to be complex. This forces real eigenvalues for a floating point calculation.

You are worried that two zero eigenvalues not being exactly the same, and suggest that the one that is not exactly zero has the wrong symmetry for its eigenvector. But from a numerical point of view at Digits=15, these are both zero. I think the eigenvector algorithm is robust, and the symmetry issue is not related to the numerical roundoff in the eigenvalue, if that is what you are suggesting. You can take the Matrix with integer (or exact rational) entries and use NullSpace(M) to see an exact pair of eigenvectors for the zero eigenvalues. Your <0,-1,0,-1> and <1,0,-1,0> are an exact pair.

Probably you know this already, but the non-degenerate eigenvalues have unique eigenvectors up to a scalar multiplication, so the eigenvectors for E and -E will automatically have the required symmetry if E and -E are non-degenerate. Then you can just sort the eigenvectors to have them next to each other (and scale them) if that is what you want.

Once you have degeneracy, then mathematically there is no preferred form for the eigenvectors. So what you want to do is find a linear combination of the ones you get in some prescribed form. I don't see a simple way to do this. On the other hand, degeneracy usually arises from some sort of symmetry, so knowing more about the matrix structure might help you, e.g., if you can partition them into related blocks.

I'm still confused over whether you think the zero eigenvectors can alsways have the <u,v> <v,u> symmetry as I think you originally proposed, or now you think <u,u>, <v,v>?

@dharr - oops, I was careless here. The eigenvectors for zero don't have the [x,-x] symmetry here, entries 1,2,4 are negative of 5,6,8 but entry 3 is not negative of entry 7.

Leaving the entries as integers, so there are no numerical issues, NullSpace(M) gives

[0,0,1,0,0,0,1,0] and [49/5, -56/5, 21/5, -1, -49/5, 56/5, 0,1]

@Bland3 for the plot issue, you can use: seq(plotter[i],i=1..4*L)

To avoid us cutting and pasting, please upload the worksheet using the fat green up-arrow in in the Mapleprimes editor.

@jthress1 From a physical point of view, you have 4 equal eigenvalues and 4 eigenvectors, and for most purposes (say various expansion theorems) you could arbitrarily associate them in 1:1 fashion, and get the same answer. But you almost certainly can't just use one. The eigenvalues also aren't unique, so you could take linear combinations and find another (linearly independent) set of 4.

So I suspect you could take the 6 eigenvectors in a matrix and continue to calculate other quantities, but that depends on the physical context I guess.

@Carl Love The first two columns of acer's evecsA are zero, so even without chasing down special parameter values it looks like the matrix is defective. But the missing eigenvalues are associated with the simple eigenvalues?? JordanForm(A) is diagonal, so something is strange here.

Edit: I see now that @acer's evecsA is different in his two worksheets. So the second version with two zero columns has a problem, perhaps an artifact of the Normalizer used.

@Adam Ledger Do you have a file "F:/test.txt" already existing on your system?

Try FileTools[Status]("F:/test.txt");

If you get file or directory doens't exist, then it is a problem with finding the file. If it can find it, it will give you the permissions for that file.

displayprecision=4 on Maple 2015 gives 4 decimal places, and in Maple 2017.3 gives 4 significant places as you say. But the 2017.3 help page for interface (and the options menu setting) say that it should give 4 decimal places. So it seems as though the behaviour in 2017 is an anomaly compared with earlier and later versions and not as intended.

I don't have a fix, other than precede every output you want formatted by evalf[4](...).

@shimaa sadk 

I didn't attempt to understand the algorithm, so really don't understand what you want. You can leave the range 0..infinity and it will be slower. If you can make a narrower range estimate it might go faster.

[0,-1,x^3,0,sin(x), (1/2)*Pi,undefined,20,undefined,20,undefined,50,undefined,50,undefined]

0 for less than -1

x^3 between -1 and 0

sin(x) between 0 and Pi/2

undefined between Pi/2 and 20

undefined between 20 and 20, i.e., at 20: the undefined for x>Pi/2 apparently wins over the 5 at x=20 to resolve the conflict

undefined between 20 and 50 (from the x>Pi/2)

undefined between 50 and 50, i.e., at 50

undefined above 50

This does highlight that keeping 5 on your list may not be right if you want to remove all the undefined parts since Maple thinks it is undefined at x=20 and not 5. I guess the message is to be careful not to have two possible values at a point.

@Carl Love @tomleslie

 zip also works with different lengths, so zip(`+`,a,b,0) rather than a+~b

@sand15 See the Bits package for bitwise operations.

If you insert a table, for example 3x3, and put some math containers in the cells, then you (or the user) can select and drag to resize in a way in which the row heights automatically resize and there is some retention of the relative positions of the embedded components. Doesn't seem to resize column widths, though the user can move the cell boundaries to do this. I haven't played much with this, so there may be table/component options which help you with this. You can hide the table borders using table/properties/Interior (or Exterior) borders, so your user doesn't see them, but they still help with alignment.

Using a for loop to sum the terms backwards (smallest to largest) gives essentially the same error as 'add', i.e., an error of 1e-15.

In general, I expect Maple to have some algorithm, specified or not, that gives an answer within 1 or 2 in the last digit consistent with Digits. Since we know summing forward is problematic, I would trust that Maple has thought of that.


First 21 22 23 24 25 26 27 Last Page 23 of 31