MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Eigenvalues, eigenvectors, matrix ranks, determinants, and all that stuff

  • To: mathgroup at smc.vnet.net
  • Subject: [mg125606] Re: Eigenvalues, eigenvectors, matrix ranks, determinants, and all that stuff
  • From: Peter Pein <petsie at dordos.net>
  • Date: Wed, 21 Mar 2012 05:46:09 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com

Am 19.03.2012 10:56, schrieb Konstantin:
> On Mar 16, 4:33 am, Bill Rowe<readn... at sbcglobal.net>  wrote:
>> On 3/15/12 at 12:31 AM, kparchev... at gmail.com (Konstantin) wrote:
>>
>> <snip>
>>
>>> Very often algebraic manipulations in Mathematica do not produce
>>> expected result just because we and the program have different
>>> defaul assumptions about type of variables. So I tried to specify
>>> EVERYTHING about my variables explicitly ( @ means "belongs to", !=
>>> means "not equal" )
>>> $Assumptions = u@Reals&&  u!=0&&  Bx@Reals&&  By@Reals&&  Bz@Reals
>>> &&  Bx!=0&&  By!=0&&  Bz!=0&&  rho>0&&  cs>0;
>>
>> Unless you have re-defined @ (an ill advised thing to do) you
>> are not repeat not free to use it to do something other than the
>> built-in definition. That is Mathematica interprets u@Reals as
>> the function u with argument Reals, i.e:
>>
>> In[9]:= u@Reals
>>
>> Out[9]= u(\[DoubleStruckCapitalR])
>>
>> If you want to declare u to be a real variable use the function
>> Element that performs exactly this function That is the statement
>>
>> {u, Bx, By, Bz} \[Element] Reals
>>
>> defines the list of variables all to be real.
>>
>> And note,
>>
>> In[10]:= Reduce[{Element[x, Reals]&&  x != 0}, x]
>>
>> Out[10]= x<0\[Or]x>0
>>
>> That is stating x != 0 is sufficient to declare x to be real
>> since the comparison of x to 0 is not valid unless x is real
>
> I do not use symbol @ in my code. I use standard symbol "belongs to"
> to specify, that u is real. There is no equivalent for this symbol in
> ASCII table. And I mentioned in brackets, that in my notation @ means
> "belongs to". So, syntax is fine. What can you say about the main
> point? Why does Mathematica calculates rank of matrix incorrectly and
> how can I calculate my eigenvectors other than do simplifications
> "manually"?
>

As you want Abs[Bxyz], put it into the matrix:

A1 =
  {{u, rho, 0, 0, 0, 0, 0, 0},
   {0, u, 0, 0, rho^(-1), 0, Abs[By]/(4*Pi*rho), Abs[Bz]/(4*Pi*rho)},
   {0, 0, u, 0, 0, 0, -Abs[Bx]/(4*Pi*rho), 0},
   {0, 0, 0, u, 0, 0, 0, -Abs[Bx]/(4*Pi*rho)},
   {0, cs^2*rho, 0, 0, u, 0, 0, 0},
   {0, 0, 0, 0, 0, u, 0, 0},
   {0, Abs[By], -Abs[Bx], 0, 0, 0, u, 0},
   {0, Abs[Bz], 0, -Abs[Bx], 0, 0, 0, u}};

or use oldA1 /.{pi->Pi,(b:Bx|By|Bz):>Abs[b]}

the fourth eigenvalue/vector seems to be what you want:

{val,vec}=Simplify[Eigensystem@A1][[All,4]]
gives:
{u+Abs[Bx]/(2 Sqrt[\[Pi]] Sqrt[rho]),
  {0,0,Abs[Bz]/(2 Sqrt[\[Pi]] Sqrt[rho] Abs[By]),
   -(1/(2 Sqrt[\[Pi]] Sqrt[rho])),0,0,-(Abs[Bz]/Abs[By]),1}
}

check:
  A1.vec-val vec//Simplify
  {0,0,0,0,0,0,0,0}

further I get:
In[9]:= MatrixRank[A1-val IdentityMatrix[8]]
Out[9]= 7

and
In[10]:= Solve[(A1-val IdentityMatrix[8]).Array[v,8]==0,Array[v,8]]
  Solve::vars: During evaluation of In[10]:= Solve::svars: Equations may 
not give solutions for all "solve" variables. >>
Out[10]= {{v[1]->0,v[2]->0,v[4]->-((Abs[By] 
v[3])/Abs[Bz]),v[5]->0,v[6]->0,v[7]->-2 Sqrt[\[Pi]] Sqrt[rho] 
v[3],v[8]->(2 Sqrt[\[Pi]] Sqrt[rho] Abs[By] v[3])/Abs[Bz]}}

to get the same vector as via Eigensystem, add v[8]==1 to the equations:

In[11]:= Solve[(A1-val IdentityMatrix[8]).Array[v,8]==0&&v[8]==1,Array[v,8]]
Out[11]= {{v[1]->0,v[2]->0,v[3]->Abs[Bz]/(2 Sqrt[\[Pi]] Sqrt[rho] 
Abs[By]),v[4]->-(1/(2 Sqrt[\[Pi]] 
Sqrt[rho])),v[5]->0,v[6]->0,v[7]->-(Abs[Bz]/Abs[By]),v[8]->1}}

hth,
Peter



  • Prev by Date: Re: Compiling Runge-kutta
  • Next by Date: Re: Different Color in ToString
  • Previous by thread: Re: Eigenvalues, eigenvectors, matrix ranks, determinants, and all that stuff
  • Next by thread: yg = \frac{{d(yv)}}{{dt}}, how to solve this differential equation.