freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

探討如何解線性代數(shù)中線性方程式求解以及求eigenva(文件)

 

【正文】 Example 2: A is not full rank,但是pinv還是可以用 A = [ 1 2 3。 7 1 8]。Underdetermined : 低於所求型,方程式數(shù)目 變數(shù)個(gè)數(shù),m n,無解或無限多解。 1 2。Example 2: 求解低於所求型系統(tǒng) a = [ 1 2 3 4。※ 若需要解的所有分量都 179。 。167。※ Iterative Methods有兩種:(1) Jacobi Method (Simultaneous iteration): () 式中,等號(hào)左邊的xi值同時(shí)算出,再同時(shí)代入右邊求算新的xi。(1) Jacobi method: , % 上標(biāo)代表iteration的次數(shù) …. (2) GaussSeidel method: , …. 所以GaussSeidel method較快。167。) 222。(3) spy(A) : ,用圖示概略顯示A矩陣中非零元素的位置。Example 1: rowpos = [ 1 1 2 2 2 4 4 5 5 5 ]。1000 sparse及full triple diagonal matrix,比較二者在解Ax=b時(shí)的浮點(diǎn)運(yùn)算次數(shù),注意flops指令在第六版的MATLAB已經(jīng)沒有了,故此處改用tic, toc指令)()% generate a sparse triple diagonal matrixrowpos=2:1000。a=sparse(1:1000,1:1000,4*ones(1,1000),1000,1000)。tic。 x=b\rhs。, t1)。過程中的,最後a=。 a = sprandsym(n,d) 少一個(gè)參數(shù)因?qū)ΨQ矩陣必是square。※ 隨堂練習(xí):()使用函數(shù)sprandsym(500, , r) 180。何種矩陣所需計(jì)算時(shí)間較多?167。 | AlI | = 0 222。 The MATLAB Function eig※ Syntax (語法):d = eig(A) % 產(chǎn)生A的eigenvalues (d是vector) d = eig(A,B) % 解Ax = lBx (generalized eigenvalue problem), A,B : n180。 補(bǔ)充(1) Find the reduced row echelon form of A rref(A)ans = 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1(2) What is the rank of A? rank(A) ans = 4(3) What is the determinant of A? det(A) ans = 90(4) Is A a singular matrix? No. (因det(A)185。Example: () Find the eigenvalues and the eigenvectors using the MATLAB function eig for the matrix Sol. [V, D] = eig(A)V = + 0 + 0 D = 2+4i 0 0x3x2x1 0 24i 0 0 0 1※ 隨堂練習(xí):,矩陣需更正為 ,公式需更正為。 在MATLAB 可用 “poly” 產(chǎn)生特徵方程式係數(shù),再用 “roots” 求根Example: p = poly(A)p = 1 15 18 360 % 表示特徵方程式為 roots(p)ans = ※ 用 “eig” 可直接求eigenvalues: eig(A)ans = ※ 隨堂練習(xí):。n matrix, l : scalar, x : n180。用tic及toc求這矩陣做柯列斯基分解所需的計(jì)算時(shí)間。正定矩陣的特徵值皆為正數(shù),故若r的每一個(gè)元素都是正數(shù),則會(huì)產(chǎn)生正定矩陣。(5) sprandn:產(chǎn)生常態(tài)亂數(shù)sparse矩陣, sprandsym:產(chǎn)生常態(tài)亂數(shù)sparse對(duì)稱矩陣 a = sprandn(m,n,d) 其中參數(shù)表示矩陣為m180。Time for full matrix solve = %\n39。fprintf(39。 t1=toc。% generate full matrixb=full(a)。values=2*ones(1,999)。 val = [ 12 4 7 3 8 13 11 2 7 4]。 若只輸入 A = sparse(15,15) 表示要產(chǎn)生15180。 full,要注意。語法:(1) full → sparse: b = sparse(a) (2) sparse → full: c = full(b)※ 運(yùn)算時(shí),(1) 兩個(gè)sparse運(yùn)算 ( +180。 GaussSeidel method: , …. 發(fā)散而無法收斂?!?上述二法收斂的條件 (不論xi初值為何都可收斂的條件) 為: 故一開始的選擇很重要 (方程式的上下順序可調(diào)換,要盡量讓絕對(duì)值較大的係數(shù)出現(xiàn)在A的對(duì)角線上)。此處只是藉此問題介紹iterative method的概念,這是很重要的一種數(shù)值方法。 b = [ ]39。 0, i = 1, 2. a = [ 。 b = [1 2]39。 b = [ 1 ]39。Example 1: 求解高於所求型系統(tǒng),且矩陣之位階(rank)不足 a = [ 1 2。 Overdetermined and Underdetermined Systems ※ A : m180。 7 11 18。 rank (A)ans = 3 Across = inv(A39。Example 1: (m = 4, n = 3) A = [ 1 2 3。 x = AT(AAT)1b 222。n matrix,不可能 full rank (rank(A) 163。 若A是n180。 PseudoInverse (假反置) ※ 當(dāng)A是m180。 (2) [U,S,V] = svd(A) 產(chǎn)生三個(gè)矩陣。, sn是AHA的eigenvalue的非負(fù)平方根,而 U : eigenvectors of AAH, V : eigenvectors of AHA。m orthogonal matrix (若A是plex,則U是unitary) V : n180。在m n時(shí),分解不唯一。 已知 Q1 = QT 或 QH,所以y = Q1b(3) 解Rx = y,用back substitution即可解出x※ QR分解可用在A是m180。 Let y = Px,用forward substitution 解 PHy = b 222。1向量x使得Ax = lx,則稱 l 為A的eigenvalue,x為對(duì)應(yīng)的eigenvector)2. A Hermitian matrix A (which by definition has real diagonal elements aii) is positive definite if (1). aii 0 for all i, (2). aii ajj |aij|2 for i 185。 \ LY=B is given by , ., , 此例中L不是lowertriangular, 但仍可利用substitution得到 及 故 再解 UX=Y by back substitution,可得到 ※ MATLAB function “det” find det(A) by LU factorization.做法: A = LU 222。 Let U = U(3) = 因?yàn)?A = T(1) T(2) T(3) U, 所以L = T(1) T(2) T(3)= = ※ 用線代的符號(hào)將上例重新整理: L = T(1) T(2) T(3)T(3)32=1/2T(2) 中的列2,3對(duì)調(diào)T(1)21=2/3T(1)31=1T(i) 一開始等於I3T(1)31=1※ Note:在上例中,因?yàn)榉纸膺^程中有列互換,故L並不是lowertriangular (還是可以解Ax=b),但可以經(jīng)由列互換得到lowertriangular的形式。 Ly=b 222。 高斯消去法算出的其實(shí)是L1b (即是將 [A b] 轉(zhuǎn)成 [U L1b]), 故當(dāng)b改變了就需要重算?!?高斯消去法需要n3/3次乘法再加上n2次的乘法來處理後向代入法,高斯喬丹消去法大約需要n3/2次乘法,所以n較大時(shí),高斯喬丹消去法較高斯消去法所需的運(yùn)算次數(shù)約多50%。 透過基本列運(yùn)算得到的上三角矩陣為 222。(n+1) matrix is called the augmented matrix (擴(kuò)大矩陣).※ 擴(kuò)大矩陣的每一列都保有方程式的所有係數(shù),因此應(yīng)用以下三個(gè)基本列運(yùn)算(elementary row operation)時(shí),並不會(huì)改變聯(lián)立方程式的解:(i) Interchange the position of any two rows (., equations).(ii) Multiply a row (., equation) by a nonzero scalar.(iii) Replace a row by the sum of the row and a scalar multiple of another row.167。n矩陣的cond值大約等於1~3180。 fprintf(39。)for n= 4:15 a=hilb(n)。(2) rcond:值介於0跟1之間,較粗略,但計(jì)算較快, perfectlyconditioned的矩陣其rcond值=1, illconditioned的矩陣其rcond值很小, 通常cond跟rcond的值接近倒數(shù)關(guān)係。 Accuracy of solutions and illconditioning※ 此節(jié)研究解的精確度,及如何偵測(cè)出其不精確性Example 1: a\ b ans = Example 2: a(2,2) = ?!?以下列出幾個(gè)有關(guān)的名詞:(i) back substitution: (forward substitution剛好相反) 例:解 解法:j 將代回第二式,得到 k 將及代回第一式:, l Let , 故解為: (此題若用A\b的語法會(huì)得到
點(diǎn)擊復(fù)制文檔內(nèi)容
電大資料相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1