2012-11-29 85 views
2

我試圖計算形式Matlab的符號向量

[ a, c, 0] 
[ c, b, e] 
[ 0, e, f] 
在Matlab

的矩陣的特徵值符號和載體(具有含有x,Y,Z的表達式的一些替換,B,C等)。當我有4對角線項目0,那麼程序是成功的。但是當矩陣只有兩個關閉的對角線元素爲零時(就像在這個例子中那樣),程序找不到特徵向量,但是可以找到特徵向量(這是預期的,因爲它是三次多項式)。特徵值的表達式現在非常忙碌。當我嘗試計算特徵向量時,它給出了錯誤

Warning: basis of eigenspace for eigenvalue - 1/2*((c^2*d^2*e^2 -... 
Error: Unable to find eigenvectors. [mleigenvectors] 
Error in ==> sym.eig at 74 
S = mupadfeval('mleigenvectors',A); 

我正在使用matlab R2009a。這是一個問題,可以通過例如R2009b或更好的服務器來解決,或者它只是爲了許多計算來嘗試?這對我來說似乎並不合理,因爲如果從上面的矩陣中減去LI(其中K代表特徵值I是id矩陣)並嘗試求解特徵向量方程,則甚至可以手動求解以獲得包含L的表達式, A,b,C,E,F,G。那麼你所要做的就是簡單地爲lambda表達式。然而,結果會很長,所以我想知道這是否是一些記憶問題?

謝謝

+1

不是一個答案,只是一個比較點。 Mathematica在幾分之一秒內解決了相同的特徵向量問題。 –

+0

nasser我嘗試使用你已經把確切的代碼行,但它不起作用給出了相同的錯誤。你是偶然使用64位操作系統? 井楓似乎也能夠計算。然而,這是我第一次使用楓,我發現符號計算是非常令人沮喪的。如果矩陣包含指數函數,它將否認找到特徵向量,因爲函數不是代數...我會看看我是否可以用matlab 2012b找到一臺計算機。 – Sina

+0

是的,它使用起來非常簡單方便。其他的對語法非常刺激並且沒有幫助。但如果它是無法使用,但我的32位,所以也許我會嘗試在64位機器 – Sina

回答

0

我在2012a和2010a 32位測試,都很好地工作。

有趣的是,2012a花了0.2s,而2010a花了0.3s。如果以下方法不起作用,我會懷疑有內部錯誤,因爲它們會嚴重更新符號處理。

tic; syms a c b e f; A=[a c 0;c b e;0 e f]; [V,D]=eig(A); toc; 

一個搜索證實,這是2008年的一個問題...

http://www.mathworks.com/matlabcentral/newsreader/view_thread/263921

Actuall Steven, in this case, the polynomials does simplify to cubics. Matlab symbolic does find the eigenvalues ok, but it fails on the eigenvectors (using my Matlab 2008b)

EDU>> values=eig(A); EDU>> simplify(values)

ans =

(too long to show) 

But vectors fail:

EDU>> [vectors,values]=eig(A); Warning: basis of eigenspace for eigenvalue 1/3*a + 1/3*b + 1/3*c + (4/9*a^2 - 1/9*a*b - 1/9*a*c + 1/9*b^2 + 2/9*b*c + 1/9*c^2)/(4/9*a*b^2 + 1/9*a^2*b - 1/18*a*c^2 + 1/9*a^2*c - 7/18*b*c^2 + 1/9*b^2*c - 8/27*a^3 + 1/27*b^3 + 1/27*c^3 + (- 1/3*a^4*b^2 - 10/27*a^4*b*c - 1/27*a^4*c^2 + 1/9*a^3*b^3 + 2/9*a^3*... [linalg::eigenvectors] ??? Error using ==> mupadfeval at 28 Error: Unable to find eigenvectors. [mleigenvectors]

Error in ==> sym.eig at 74 S = mupadfeval('mleigenvectors',A);

I tried the same on Mathematica, and it finds the eigenvectors, (which I assume they are correct ;), here is the result (too large to post here also)