Student Support Forum: 'Eigenvectors' topicStudent Support Forum > General > Archives > "Eigenvectors"

 Next Comment > Help | Reply To Topic
 Author Comment/Response Nusc 07/21/08 2:45pm Hello. Below is a do loop: Do[ If[1 + 2 \[Alpha] > 0 && 2 \[Alpha] < 1 + 4 \[Beta] && \[Beta] >= 0, Print[ "alpha=", \[Alpha], ",", "beta=", \[Beta], ",", "x=", x = PowerExpand[(\[Pi] \[HBar] (1 + 2 \[Alpha]))/(\[Pi] / 2 Sqrt[-((\[HBar]^2 (-1 + 2 \[Alpha] - 4 \[Beta]) (3 + 2 \[Alpha] + 4 \[Beta]))/\[Tau]^2)] \[Tau])], ",", "t=", t = PowerExpand[\[Pi] / 2 Sqrt[-((\[HBar]^2 (-1 + 2 \[Alpha] - 4 \[Beta]) (3 + 2 \[Alpha] + 4 \[Beta]))/\[Tau]^2)]], ",", "Eigenvalues=", PowerExpand[{1/2 (-x \[Tau] - Sqrt[4 + (x)^2] \[Tau]), 1/2 (x \[Tau] - Sqrt[4 + (x)^2] \[Tau]), 1/2 (-x \[Tau] + Sqrt[4 + (x)^2] \[Tau]), 1/2 (x \[Tau] + Sqrt[4 + (x)^2] \[Tau])}], ",", "New Hamiltonian=", new = MatrixForm[{{0, -\[Tau], 0, 0}, {-\[Tau], 0, -PowerExpand[x] \[Tau], 0}, {0, -PowerExpand[x] \[Tau], 0, -\[Tau]}, {0, 0, -\[Tau], 0}} + PowerExpand[{{1/2 (-x \[Tau] - Sqrt[4 + (x)^2] \[Tau]), 0, 0, 0}, {0, 1/2 (x \[Tau] - Sqrt[4 + (x)^2] \[Tau]), 0, 0}, {0, 0, 1/2 (-x \[Tau] + Sqrt[4 + (x)^2] \[Tau]), 0}, {0, 0, 0, 1/2 (x \[Tau] + Sqrt[4 + (x)^2] \[Tau])}}]], ",", "\!\(\*SubscriptBox[\"\[Phi]\", \"1\"]\)=", f41 = Normalize[{1, 1/2 (x + Sqrt[4 + x^2]), 1/2 (x + Sqrt[4 + x^2]), 1}], ",", "\!\(\*SubscriptBox[\"\[Phi]\", \"2\"]\)=", ff41 = Normalize[{-1, 1/2 (x - Sqrt[4 + x^2]), 1/2 (-x + Sqrt[4 + x^2]), 1}], ",", "\!\(\*SubscriptBox[\"\[Phi]\", \"3\"]\)=", fff41 = Normalize[{1, 1/2 (x - Sqrt[4 + x^2]), 1/2 (x - Sqrt[4 + x^2]), 1}], ",", "\!\(\*SubscriptBox[\"\[Phi]\", \"4\"]\)=", ffff41 = Normalize[{-1, 1/2 (x + Sqrt[4 + x^2]), 1/2 ( -x - Sqrt[4 + x^2]), 1}], ",", Eigenvectors[new] ] ], {\[Alpha], -20, 20}, {\[Beta], -20, 20}] I'm trying to find the eigenvectors of the matrix but it gives me null. So I took the commands out of it and put them below - see file. How do I assign variables within a loop without screwing things up? Attachment: script.nb, URL: ,

 Subject (listing for 'Eigenvectors') Author Date Posted Eigenvectors Nusc 07/21/08 2:45pm Re: Eigenvectors Nusc 07/22/08 11:28am Re: Eigenvectors yehuda ben-s... 07/23/08 10:35am
 Next Comment > Help | Reply To Topic