Skip to main content
was missing a word; added a little parenthetical phrase for clarification; removed an unnnecessary phrase; corrected a typo in the code
Source Link
Rain
  • 768
  • 3
  • 15

I've run some more tests and have found the answer to questions 2 and 3. Mathematica does seem to be renormalising with each value of $x$ and $y$. Here's a graph of the norm of one of the eigenvectors:

Quiet[ Plot3D[ Sqrt[Abs[Eigenvectors[m][[2]][[1]]]^2+Abs[Eigenvectors[m][[2]][[2]]]^2]-1, {x,x1,x2},{y,y1,y2}, Exclusions->None, PlotLabel->Row[{"|",Subscript[v,2],"|"}], PlotRangePadding->0 ] ] 

enter image description here

I'll ascribe the variation in the norm (of the order of $10^{-16}$) to machine precision (i.e. the norm of this eigenvector is $1$ throughout the domain). This seems to imply that Mathematica is not only renormalising the eigenvectors at each point, but it is actually giving me the eigenvectors normalised to 1 (contrary to what the documentation says).

Of course, this assumes that the order of the eigenvalues and eigenvectors is preserved regardless of which eigenvalue has a larger absolute value at each point. If it isn't, my whole interpretation of the above graph automatically goes out the window.

Edit:

I've found the answer to question 1 by testing a little further. I built a matrix with eigenvalues whose ordering should change in a very obvious way:

M=DiagonalMatrix[{x-2,2-x}]; 

Graphing the eigenvalues themselvesexplicitly (which are obviouslyi.e. $x-2$ and $2-x$) yields the following (naturally):

Plot[{2-x,x-2},{x,0,4}] 

enter image description here

However, plottinggraphing the eigenvalues as eigenvalues yields the followinghas a different result:

Plot[{Eigenvalues[M][[1]],Eigenvalues[M][[2]]},{x,0,4}] 

enter image description here

It is as I feared: Eigenvalues are reordered at each point. Clearly, then, eigenvectors are also reordered at each point, since the eigenvalue and eigenvector ordering must be consistent at all times (at least according to Mathematica). (This also renders my analysis on the answers to questions 2 and 3 wrong, although the ultimate answers (i.e. Mathematica renormalises to $1$ at every point) is still right because of what J.M. said in the comments.)

Other than having explicit expressions for the eigenvector components (which I do not have, as explained at the beginning of my original post), is there a simple way around this reordering?

Another edit:

Finally, as mentioned in the comment section, I've found a way around the problem posed in question 4, but I imagine it's highly dependent on the type of problem one is trying to solve.

In my case, I can graph $f(x,y)$ and $g(x,y)$ and see in which direction(s) they change most strongly. The eigenvalues and eigenvectors of $M$ are related to the partial derivatives of $f$ and $g$ with respect to $x$ and $y$, so I can use the (qualitative) visual information obtained from the graphs of $f$ and $g$ to "guess" which order the eigenvectors and the corresponding eigenvalues should be in (at least in regions where there is a clear difference between the directions of maximum variation of $f$ and $g$).

This is not a very satisfactory answer to question 4, but it is the only one I have so far.

I've run some more tests and have found the answer to questions 2 and 3. Mathematica does seem to be renormalising with each value of $x$ and $y$. Here's a graph of the norm of one of the eigenvectors:

Quiet[ Plot3D[ Sqrt[Abs[Eigenvectors[m][[2]][[1]]]^2+Abs[Eigenvectors[m][[2]][[2]]]^2]-1, {x,x1,x2},{y,y1,y2}, Exclusions->None, PlotLabel->Row[{"|",Subscript[v,2],"|"}], PlotRangePadding->0 ] ] 

enter image description here

I'll ascribe the variation in the norm (of the order of $10^{-16}$) to machine precision (i.e. the norm of this eigenvector is $1$ throughout the domain). This seems to imply that Mathematica is not only renormalising the eigenvectors at each point, but it is actually giving me the eigenvectors normalised to 1 (contrary to what the documentation says).

Of course, this assumes that the order of the eigenvalues and eigenvectors is preserved regardless of which eigenvalue has a larger absolute value at each point. If it isn't, my whole interpretation of the above graph automatically goes out the window.

Edit:

I've found the answer to question 1 by testing a little further. I built a matrix with eigenvalues whose ordering should change in a very obvious way:

M=DiagonalMatrix[{x-2,2-x}]; 

Graphing the eigenvalues themselves (which are obviously $x-2$ and $2-x$) yields the following (naturally):

Plot[{2-x,x-2},{x,0,4}] 

enter image description here

However, plotting the eigenvalues as eigenvalues yields the following:

Plot[{Eigenvalues[M][[1]],Eigenvalues[M][[2]]},{x,0,4}] 

enter image description here

It is as I feared: Eigenvalues are reordered at each point. Clearly, then, eigenvectors are also reordered at each point, since the eigenvalue and eigenvector ordering must be consistent at all times (at least according to Mathematica).

Other than having explicit expressions for the eigenvector components (which I do not have, as explained at the beginning of my original post), is there a simple way around this reordering?

Another edit:

Finally, as mentioned in the comment section, I've found a way around the problem posed in question 4, but I imagine it's highly dependent on the type of problem one is trying to solve.

In my case, I can graph $f(x,y)$ and $g(x,y)$ and see in which direction(s) they change most strongly. The eigenvalues and eigenvectors of $M$ are related to the partial derivatives of $f$ and $g$ with respect to $x$ and $y$, so I can use the (qualitative) visual information obtained from the graphs of $f$ and $g$ to "guess" which order the eigenvectors and the corresponding eigenvalues should be in (at least in regions where there is a clear difference between the directions of maximum variation of $f$ and $g$).

This is not a very satisfactory answer to question 4, but it is the only one I have so far.

I've run some more tests and have found the answer to questions 2 and 3. Mathematica does seem to be renormalising with each value of $x$ and $y$. Here's a graph of the norm of one of the eigenvectors:

Quiet[ Plot3D[ Sqrt[Abs[Eigenvectors[m][[2]][[1]]]^2+Abs[Eigenvectors[m][[2]][[2]]]^2]-1, {x,x1,x2},{y,y1,y2}, Exclusions->None, PlotLabel->Row[{"|",Subscript[v,2],"|"}], PlotRangePadding->0 ] ] 

enter image description here

I'll ascribe the variation in the norm (of the order of $10^{-16}$) to machine precision (i.e. the norm of this eigenvector is $1$ throughout the domain). This seems to imply that Mathematica is not only renormalising the eigenvectors at each point, but it is actually giving me the eigenvectors normalised to 1 (contrary to what the documentation says).

Of course, this assumes that the order of the eigenvalues and eigenvectors is preserved regardless of which eigenvalue has a larger absolute value at each point. If it isn't, my whole interpretation of the above graph automatically goes out the window.

Edit:

I've found the answer to question 1 by testing a little further. I built a matrix with eigenvalues whose ordering should change in a very obvious way:

M=DiagonalMatrix[{x-2,2-x}]; 

Graphing the eigenvalues explicitly (i.e. $x-2$ and $2-x$) yields the following:

Plot[{2-x,x-2},{x,0,4}] 

enter image description here

However, graphing the eigenvalues as eigenvalues has a different result:

Plot[{Eigenvalues[M][[1]],Eigenvalues[M][[2]]},{x,0,4}] 

enter image description here

It is as I feared: Eigenvalues are reordered at each point. Clearly, then, eigenvectors are also reordered at each point, since the eigenvalue and eigenvector ordering must be consistent at all times (at least according to Mathematica). (This also renders my analysis on the answers to questions 2 and 3 wrong, although the ultimate answers (i.e. Mathematica renormalises to $1$ at every point) is still right because of what J.M. said in the comments.)

Other than having explicit expressions for the eigenvector components (which I do not have, as explained at the beginning of my original post), is there a simple way around this reordering?

Another edit:

Finally, as mentioned in the comment section, I've found a way around the problem posed in question 4, but I imagine it's highly dependent on the type of problem one is trying to solve.

In my case, I can graph $f(x,y)$ and $g(x,y)$ and see in which direction(s) they change most strongly. The eigenvalues and eigenvectors of $M$ are related to the partial derivatives of $f$ and $g$ with respect to $x$ and $y$, so I can use the (qualitative) visual information obtained from the graphs of $f$ and $g$ to "guess" which order the eigenvectors and the corresponding eigenvalues should be in (at least in regions where there is a clear difference between the directions of maximum variation of $f$ and $g$).

This is not a very satisfactory answer to question 4, but it is the only one I have so far.

was missing a word; added a little parenthetical phrase for clarification; removed an unnnecessary phrase; corrected a typo in the code
Source Link
Rain
  • 768
  • 3
  • 15

I've run some more tests and have found the answer to questions 2 and 3. Mathematica does seem to be renormalising with each value of $x$ and $y$. Here's a graph of the norm of one of the eigenvectors:

Quiet[ Plot3D[ Sqrt[Abs[Eigenvectors[m][[2]][[1]]]^2+Abs[Eigenvectors[m][[2]][[2]]]^2]-1, {x,x1,x2},{y,y1,y2}, Exclusions->None, PlotLabel->Row[{"|",Subscript[v,2],"|"}], PlotRangePadding->0 ] ] 

enter image description here

Given that (as shown on my original post) the norm of one ofI'll ascribe the components of this vector is close to 1variation in a large region of the domain, I'll ascribenorm (of the order of $10^{-16}$) to machine precision (i.e. the norm of this eigenvector is 1$1$ throughout the domain). This seems to imply that Mathematica is not only renormalising the eigenvectors at each point, but it is actually giving me the eigenvectors normalised to 1 (contrary to what the documentation says).

Of course, this assumes that the order of the eigenvalues and eigenvectors is preserved regardless of which eigenvalue has a larger absolute value at each point. If it isn't, my whole interpretation of the above graph automatically goes out the window.

Edit:

I've found the answer to question 1 by testing a little further by building. I built a matrix with eigenvalues whose ordering should change in a very obvious way:

M=DiagonalMatrix[{x-2,2-x2x}]; 

Graphing the eigenvalues themselves (which are obviously $x-2$ and $2-x$) yields the following (naturally):

Plot[{2-x,x-2},{x,0,4}] 

enter image description here

However, plotting the eigenvalues as eigenvalues yields the following:

Plot[{Eigenvalues[M][[1]],Eigenvalues[M][[2]]},{x,0,4}] 

enter image description here

It is as I feared: Eigenvalues are reordered at each point. Clearly, then, eigenvectors are also reordered at each point, since the eigenvalue and eigenvector ordering must be consistent at all times (at least according to Mathematica).

Other than having explicit expressions for the eigenvector components (which I do not have, as explained at the beginning of my original post), is there a simple way around this reordering?

Another edit:

Finally, as mentioned in the comment section, I've found a way around the problem posed in question 4, but I imagine it's highly dependent on the type of problem one is trying to solve.

In my case, I can graph $f(x,y)$ and $g(x,y)$ and see in which direction(s) they change most strongly. The eigenvalues and eigenvectors of $M$ are related to the partial derivatives of $f$ and $g$ with respect to $x$ and $y$, so I can use the (qualitative) visual information obtained from the graphs of $f$ and $g$ to "guess" which order the eigenvectors and the corresponding eigenvalues should be in (at least in regions where there is a clear difference between the directions of maximum variation of $f$ and $g$).

This is not a very satisfactory answer to question 4, but it is the only one I have so far.

I've run some more tests and have found the answer to questions 2 and 3. Mathematica does seem to be renormalising with each value of $x$ and $y$. Here's a graph of the norm of one of the eigenvectors:

Quiet[ Plot3D[ Sqrt[Abs[Eigenvectors[m][[2]][[1]]]^2+Abs[Eigenvectors[m][[2]][[2]]]^2]-1, {x,x1,x2},{y,y1,y2}, Exclusions->None, PlotLabel->Row[{"|",Subscript[v,2],"|"}], PlotRangePadding->0 ] ] 

enter image description here

Given that (as shown on my original post) the norm of one of the components of this vector is close to 1 in a large region of the domain, I'll ascribe the to machine precision (i.e. the norm of this eigenvector is 1 throughout the domain). This seems to imply that Mathematica is not only renormalising the eigenvectors at each point, but it is actually giving me the eigenvectors normalised to 1 (contrary to what the documentation says).

Of course, this assumes that the order of the eigenvalues and eigenvectors is preserved regardless of which eigenvalue has a larger absolute value at each point. If it isn't, my whole interpretation of the above graph automatically goes out the window.

Edit:

I've found the answer to question 1 by testing a little further by building a matrix with eigenvalues whose ordering should change in a very obvious way:

M=DiagonalMatrix[{x-2,2-x2}]; 

Graphing the eigenvalues themselves (which are obviously $x-2$ and $2-x$) yields the following (naturally):

Plot[{2-x,x-2},{x,0,4}] 

enter image description here

However, plotting the eigenvalues as eigenvalues yields the following:

Plot[{Eigenvalues[M][[1]],Eigenvalues[M][[2]]},{x,0,4}] 

enter image description here

It is as I feared: Eigenvalues are reordered at each point. Clearly, then, eigenvectors are also reordered at each point, since the eigenvalue and eigenvector ordering must be consistent at all times (at least according to Mathematica).

Other than having explicit expressions for the eigenvector components (which I do not have, as explained at the beginning of my original post), is there a simple way around this reordering?

Another edit:

Finally, as mentioned in the comment section, I've found a way around the problem posed in question 4, but I imagine it's highly dependent on the type of problem one is trying to solve.

In my case, I can graph $f(x,y)$ and $g(x,y)$ and see in which direction(s) they change most strongly. The eigenvalues and eigenvectors of $M$ are related to the partial derivatives of $f$ and $g$ with respect to $x$ and $y$, so I can use the (qualitative) visual information obtained from the graphs of $f$ and $g$ to "guess" which order the eigenvectors and the corresponding eigenvalues should be in (at least in regions where there is a clear difference between the directions of maximum variation of $f$ and $g$).

This is not a very satisfactory answer to question 4, but it is the only one I have so far.

I've run some more tests and have found the answer to questions 2 and 3. Mathematica does seem to be renormalising with each value of $x$ and $y$. Here's a graph of the norm of one of the eigenvectors:

Quiet[ Plot3D[ Sqrt[Abs[Eigenvectors[m][[2]][[1]]]^2+Abs[Eigenvectors[m][[2]][[2]]]^2]-1, {x,x1,x2},{y,y1,y2}, Exclusions->None, PlotLabel->Row[{"|",Subscript[v,2],"|"}], PlotRangePadding->0 ] ] 

enter image description here

I'll ascribe the variation in the norm (of the order of $10^{-16}$) to machine precision (i.e. the norm of this eigenvector is $1$ throughout the domain). This seems to imply that Mathematica is not only renormalising the eigenvectors at each point, but it is actually giving me the eigenvectors normalised to 1 (contrary to what the documentation says).

Of course, this assumes that the order of the eigenvalues and eigenvectors is preserved regardless of which eigenvalue has a larger absolute value at each point. If it isn't, my whole interpretation of the above graph automatically goes out the window.

Edit:

I've found the answer to question 1 by testing a little further. I built a matrix with eigenvalues whose ordering should change in a very obvious way:

M=DiagonalMatrix[{x-2,2-x}]; 

Graphing the eigenvalues themselves (which are obviously $x-2$ and $2-x$) yields the following (naturally):

Plot[{2-x,x-2},{x,0,4}] 

enter image description here

However, plotting the eigenvalues as eigenvalues yields the following:

Plot[{Eigenvalues[M][[1]],Eigenvalues[M][[2]]},{x,0,4}] 

enter image description here

It is as I feared: Eigenvalues are reordered at each point. Clearly, then, eigenvectors are also reordered at each point, since the eigenvalue and eigenvector ordering must be consistent at all times (at least according to Mathematica).

Other than having explicit expressions for the eigenvector components (which I do not have, as explained at the beginning of my original post), is there a simple way around this reordering?

Another edit:

Finally, as mentioned in the comment section, I've found a way around the problem posed in question 4, but I imagine it's highly dependent on the type of problem one is trying to solve.

In my case, I can graph $f(x,y)$ and $g(x,y)$ and see in which direction(s) they change most strongly. The eigenvalues and eigenvectors of $M$ are related to the partial derivatives of $f$ and $g$ with respect to $x$ and $y$, so I can use the (qualitative) visual information obtained from the graphs of $f$ and $g$ to "guess" which order the eigenvectors and the corresponding eigenvalues should be in (at least in regions where there is a clear difference between the directions of maximum variation of $f$ and $g$).

This is not a very satisfactory answer to question 4, but it is the only one I have so far.

added answer of sorts to question 4
Source Link
Rain
  • 768
  • 3
  • 15

I've run some more tests and have found the answer to questions 2 and 3. Mathematica does seem to be renormalising with each value of $x$ and $y$. Here's a graph of the norm of one of the eigenvectors:

Quiet[ Plot3D[ Sqrt[Abs[Eigenvectors[m][[2]][[1]]]^2+Abs[Eigenvectors[m][[2]][[2]]]^2]-1, {x,x1,x2},{y,y1,y2}, Exclusions->None, PlotLabel->Row[{"|",Subscript[v,2],"|"}], PlotRangePadding->0 ] ] 

enter image description here

Given that (as shown on my original post) the norm of one of the components of this vector is close to 1 in a large region of the domain, I'll ascribe the to machine precision (i.e. the norm of this eigenvector is 1 throughout the domain). This seems to imply that Mathematica is not only renormalising the eigenvectors at each point, but it is actually giving me the eigenvectors normalised to 1 (contrary to what the documentation says).

Of course, this assumes that the order of the eigenvalues and eigenvectors is preserved regardless of which eigenvalue has a larger absolute value at each point. If it isn't, my whole interpretation of the above graph automatically goes out the window.

Edit:

I've found the answer to question 1 by testing a little further by building a matrix with eigenvalues whose ordering should change in a very obvious way:

M=DiagonalMatrix[{x-2,2-x2}]; 

Graphing the eigenvalues themselves (which are obviously $x-2$ and $2-x$) yields the following (naturally):

Plot[{2-x,x-2},{x,0,4}] 

enter image description here

However, plotting the eigenvalues as eigenvalues yields the following:

Plot[{Eigenvalues[M][[1]],Eigenvalues[M][[2]]},{x,0,4}] 

enter image description here

It is as I feared: Eigenvalues are reordered at each point. Clearly, then, eigenvectors are also reordered at each point, since the eigenvalue and eigenvector ordering must be consistent at all times (at least according to Mathematica).

Other than having explicit expressions for the eigenvector components (which I do not have, as explained at the beginning of my original post), is there a simple way around this reordering?

Another edit:

Finally, as mentioned in the comment section, I've found a way around the problem posed in question 4, but I imagine it's highly dependent on the type of problem one is trying to solve.

In my case, I can graph $f(x,y)$ and $g(x,y)$ and see in which direction(s) they change most strongly. The eigenvalues and eigenvectors of $M$ are related to the partial derivatives of $f$ and $g$ with respect to $x$ and $y$, so I can use the (qualitative) visual information obtained from the graphs of $f$ and $g$ to "guess" which order the eigenvectors and the corresponding eigenvalues should be in (at least in regions where there is a clear difference between the directions of maximum variation of $f$ and $g$).

This is not a very satisfactory answer to question 4, but it is the only one I have so far.

I've run some more tests and have found the answer to questions 2 and 3. Mathematica does seem to be renormalising with each value of $x$ and $y$. Here's a graph of the norm of one of the eigenvectors:

Quiet[ Plot3D[ Sqrt[Abs[Eigenvectors[m][[2]][[1]]]^2+Abs[Eigenvectors[m][[2]][[2]]]^2]-1, {x,x1,x2},{y,y1,y2}, Exclusions->None, PlotLabel->Row[{"|",Subscript[v,2],"|"}], PlotRangePadding->0 ] ] 

enter image description here

Given that (as shown on my original post) the norm of one of the components of this vector is close to 1 in a large region of the domain, I'll ascribe the to machine precision (i.e. the norm of this eigenvector is 1 throughout the domain). This seems to imply that Mathematica is not only renormalising the eigenvectors at each point, but it is actually giving me the eigenvectors normalised to 1 (contrary to what the documentation says).

Of course, this assumes that the order of the eigenvalues and eigenvectors is preserved regardless of which eigenvalue has a larger absolute value at each point. If it isn't, my whole interpretation of the above graph automatically goes out the window.

Edit:

I've found the answer to question 1 by testing a little further by building a matrix with eigenvalues whose ordering should change in a very obvious way:

M=DiagonalMatrix[{x-2,2-x2}]; 

Graphing the eigenvalues themselves (which are obviously $x-2$ and $2-x$) yields the following (naturally):

Plot[{2-x,x-2},{x,0,4}] 

enter image description here

However, plotting the eigenvalues as eigenvalues yields the following:

Plot[{Eigenvalues[M][[1]],Eigenvalues[M][[2]]},{x,0,4}] 

enter image description here

It is as I feared: Eigenvalues are reordered at each point. Clearly, then, eigenvectors are also reordered at each point, since the eigenvalue and eigenvector ordering must be consistent at all times (at least according to Mathematica).

Other than having explicit expressions for the eigenvector components (which I do not have, as explained at the beginning of my original post), is there a simple way around this reordering?

I've run some more tests and have found the answer to questions 2 and 3. Mathematica does seem to be renormalising with each value of $x$ and $y$. Here's a graph of the norm of one of the eigenvectors:

Quiet[ Plot3D[ Sqrt[Abs[Eigenvectors[m][[2]][[1]]]^2+Abs[Eigenvectors[m][[2]][[2]]]^2]-1, {x,x1,x2},{y,y1,y2}, Exclusions->None, PlotLabel->Row[{"|",Subscript[v,2],"|"}], PlotRangePadding->0 ] ] 

enter image description here

Given that (as shown on my original post) the norm of one of the components of this vector is close to 1 in a large region of the domain, I'll ascribe the to machine precision (i.e. the norm of this eigenvector is 1 throughout the domain). This seems to imply that Mathematica is not only renormalising the eigenvectors at each point, but it is actually giving me the eigenvectors normalised to 1 (contrary to what the documentation says).

Of course, this assumes that the order of the eigenvalues and eigenvectors is preserved regardless of which eigenvalue has a larger absolute value at each point. If it isn't, my whole interpretation of the above graph automatically goes out the window.

Edit:

I've found the answer to question 1 by testing a little further by building a matrix with eigenvalues whose ordering should change in a very obvious way:

M=DiagonalMatrix[{x-2,2-x2}]; 

Graphing the eigenvalues themselves (which are obviously $x-2$ and $2-x$) yields the following (naturally):

Plot[{2-x,x-2},{x,0,4}] 

enter image description here

However, plotting the eigenvalues as eigenvalues yields the following:

Plot[{Eigenvalues[M][[1]],Eigenvalues[M][[2]]},{x,0,4}] 

enter image description here

It is as I feared: Eigenvalues are reordered at each point. Clearly, then, eigenvectors are also reordered at each point, since the eigenvalue and eigenvector ordering must be consistent at all times (at least according to Mathematica).

Other than having explicit expressions for the eigenvector components (which I do not have, as explained at the beginning of my original post), is there a simple way around this reordering?

Another edit:

Finally, as mentioned in the comment section, I've found a way around the problem posed in question 4, but I imagine it's highly dependent on the type of problem one is trying to solve.

In my case, I can graph $f(x,y)$ and $g(x,y)$ and see in which direction(s) they change most strongly. The eigenvalues and eigenvectors of $M$ are related to the partial derivatives of $f$ and $g$ with respect to $x$ and $y$, so I can use the (qualitative) visual information obtained from the graphs of $f$ and $g$ to "guess" which order the eigenvectors and the corresponding eigenvalues should be in (at least in regions where there is a clear difference between the directions of maximum variation of $f$ and $g$).

This is not a very satisfactory answer to question 4, but it is the only one I have so far.

added answer to question 1
Source Link
Rain
  • 768
  • 3
  • 15
Loading
Source Link
Rain
  • 768
  • 3
  • 15
Loading