6-4 ??線性方程?

uʥNƤ̭nDAYOѨMupߤ{C@սupߤ{iίx}ܦpUG

$$Ax = b$$

䤤 $A$ Owx}A$b$ OwVqA $x$ hOVqC²ư_Aڭ̥iH] $A$B$x$B$b$ פOO mnBn1Bm1A 䤤 m N{ƥءAn hOƪƥءAiHTرpӰQסG

  1. Y m = nAN{ӼƩMƪӼƬ۵Aɳq`|@ո $x$ $Ax=b$C
  2. Y m > nAN{ӼƤj󥼪ƪӼơAɳq`L@ѥi $Ax=b$Aڭ̥iӨD̤pѡ]Least-Squares Solution^$\hat{x}$A $\hat{x}=\arg \min_x |Ax-b|^2$C
  3. Y m < nAN{ӼƤp󥼪ƪӼơAɳq`Lhո $x$ i $Ax=b$Aڭ̥iMD@򥻸ѡ]Basic Solution^$x$Aϱo $x$ ̤֥]t m-n ӹsC

MATLAB Ѥ@Ӥϱ׽uB]Back Slash OperatorAYu\v^ϱo x=A\b ມWzTرpAϱ׽uBS١uv]Left Division^C PzAMATLAB ]ѤF׽uB]Slash OperatorAYu/v^Ρukv]Right Division^AHI $xA=b$ {ա]$x$B$A$B$b$ פOO 1mBmnB1n^C

zGMATLAB Mk
pߤ{ΦMATLAB Ѫk
$Ax=b$Gx = A\b
$xA=b$kGx = b/A

bWA $Ax=b$ $xA=b$Aڭ̥iHQbUH $A$Aè $A$ mOΡuvΡukvC

ѩ $xA=b$ M $A^Tx^t=b^T$ OĪA] b/A = (A'\b')'AҥHbUQסAڭ̧HuvӥN MATLAB ѽuʤ{kCHUOXӨϥΡuvҤlC

Example 1: 06-uʥN/leftDiv01.mA = vander(1:3); b = [6; 11; 18]; x = A\b error = A*x-bx = 1.0000 2.0000 3.0000 error = 0 0 0

bWҤAA O@ 33 Uoگx}]Vandermende Matrix^A] x = A\b o@հߤ@ѡC ]Uoگx}@Φ $V= \begin{bmatrix} 1 & \alpha_1 & \alpha_1^2 & \dots & \alpha_1^{n-1} \\ 1 & \alpha_2 & \alpha_2^2 & \dots & \alpha_2^{n-1} \\ \vdots & \vdots & \vdots & \ddots & \vdots \\ 1 & \alpha_m & \alpha_m^2 & \dots & \alpha_m^{n-1} \\ \end{bmatrix}$A $m=n$ ɡACiHܦ $det(V)=\prod_{\substack{1 \le i < j \le n}} (\alpha_j - \alpha_i)$A]pG $\alpha_i \neq \alpha_j, \forall i \neq j$ACN|sC^

Hint
  • WҥNqL (1,6)B (2,11)B (3,18) TIGu $y=x^2+2x+3$C]H^
  • MATLAB uv`QΩuuXv]Curve Fitting^PujkRv]Regression Analysis^AiѨѡuuXPjkRv`C

m > n ɡAuviH̤pѡC|ҦpUG

Example 2: 06-uʥN/leftDiv02.mA = [2 -1; 1 -2; 1 1]; b = [2; -2; 1]; x = A\bx = 1.0000 1.0000

bWҤAڭ̦ 3 Ӥ{Aou 2 ӥơA 3 Ӥ{b X-Y å@IAGYaA{յLѡA MATLABuv쪺 $x$ ̤pѡAiHϱo $|Ax-b|^2$ ̤pȡC

Hint
bWҤA] $x$ Tu{ZO $l_1$B$l_2$ $l_3$Ah x=A\b $5l_1^2+5l_2^2+l_3^2$ Ȭ̬pC]H^

m < n ɡAuviH򥻸ѡA|ҦpUG

Example 3: 06-uʥN/leftDiv03.mA = [1 2 3; 4 5 6]; B = [7; 8]; X = A\BX = -3.0000 0 3.3333

MATLAB biuvɡAڤWΨFܦhx}BܧΡAҦpGLU DecompositionAQR FactorizationACholesky FactorizationA HΤ@몺hk]Gaussian Elimination^Cѩ󦹳oA`uʥNƤμƭȤkAb`JСC MATLAB O luBqr chol AŪ̥i MATLAB uW䴩ohTC


MATLAB{]pGig