6-4 �p�߽u�ʤ�{��

½u©Ê¥N¼Æ¤¤³Ì­«­nªº°ÝÃD¡A§Y¬O¸Ñ¨M½u©ÊÁp¥ß¤èµ{¦¡¡C¤@²Õ½u©ÊÁp¥ß¤èµ{¦¡¥i¥Î¯x°}ªí¥Ü¦p¤U¡G

$$Ax = b$$

¨ä¤¤ $A$ ¬O¤wª¾¯x°}¡A$b$ ¬O¤wª¾¦æ¦V¶q¡A¦Ó $x$ «h¬O¥¼ª¾¦æ¦V¶q¡C¬°Â²¤Æ°_¨£¡A§Ú­Ì¥i¥H°²³] $A$¡B$x$¡B$b$ ªººû«×¤À§O¬O m¡Ñn¡Bn¡Ñ1¡Bm¡Ñ1¡A ¨ä¤¤ m ¥Nªí¤èµ{¦¡ªº¼Æ¥Ø¡An «h¬O¥¼ª¾¼Æªº¼Æ¥Ø¡A¥i¥H¤À¦¨¤TºØ±¡ªp¨Ó°Q½×¡G

  1. ­Y m = n¡A¥Nªí¤èµ{¦¡ªº­Ó¼Æ©M¥¼ª¾¼Æªº­Ó¼Æ¬Ûµ¥¡A¦¹®É³q±`·|¦³¤@²Õ¸Ñ $x$ º¡¨¬ $Ax=b$¡C
  2. ­Y m > n¡A¥Nªí¤èµ{¦¡ªº­Ó¼Æ¤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 < n¡A¥Nªí¤èµ{¦¡ªº­Ó¼Æ¤p©ó¥¼ª¾¼Æªº­Ó¼Æ¡A¦¹®É³q±`¦³µL­­¦h²Õ¸Ñ $x$ ¥iº¡¨¬ $Ax=b$¡A§Ú­Ì¥i´M¨D¤@°ò¥»¸Ñ¡]Basic Solution¡^$x$¡A¨Ï±o $x$ ³Ì¤Ö¥]§t m-n ­Ó¹s¤¸¯À¡C

MATLAB ´£¨Ñ¤@­Ó¤Ï±×½u¹Bºâ¡]Back Slash Operator¡A§Y¡u\¡v¡^¨Ï±o x=A\b ¯àº¡¨¬¤W­z¤TºØ±¡ªp¡A¦¹¤Ï±×½u¹Bºâ¤SºÙ¡u¥ª°£¡v¡]Left Division¡^¡C ¦P²z¡AMATLAB ¤]´£¨Ñ¤F±×½u¹Bºâ¡]Slash Operator¡A§Y¡u/¡v¡^©Î¡u¥k°£¡v¡]Right Division¡^¡A¥H¹ï¥I $xA=b$ ªº¤èµ{²Õ¡]$x$¡B$A$¡B$b$ ªººû«×¤À§O¬O 1¡Ñm¡Bm¡Ñn¡B1¡Ñn¡^¡C

¾ã²z¡GMATLAB ªº¥ª°£©M¥k°£
Áp¥ß¤èµ{¦¡§Î¦¡MATLAB ¸Ñªk
$Ax=b$¥ª°£¡Gx = A\b
$xA=b$¥k°£¡Gx = b/A

¦b¤Wªí¤¤¡A±ý¸Ñ $Ax=b$ ©Î $xA=b$¡A§Ú­Ì¥i¥H·Q¹³¦bµ¥¸¹¨âÃä¦U°£¥H $A$¡A¨Ã¨Ì $A$ ªº¦ì¸m¤À§O¨ú¥Î¡u¥ª°£¡v©Î¡u¥k°£¡v¡C

¥Ñ©ó $xA=b$ ©M $A^Tx^t=b^T$ ¬Oµ¥®Äªº¡A¦]¦¹ b/A = (A'\b')'¡A©Ò¥H¦b¤U­±ªº°Q½×¡A§Ú­Ì§¡¥H¡u¥ª°£¡v¨Ó¥Nªí MATLAB ¸Ñ½u©Ê¤èµ{¦¡ªº¤èªk¡C¥H¤U¬O´X­Ó¨Ï¥Î¡u¥ª°£¡vªº¨Ò¤l¡C

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

¦b¤W¨Ò¤¤¡AA ¬O¤@­Ó 3¡Ñ3 ªº¸U±o¹Ú¯x°}¡]Vandermende Matrix¡^¡A¦]¦¹ x = A\b ±o¨ì¤@²Õ°ß¤@¸Ñ¡C ¡]¸U±o¹Ú¯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$ ®É¡A¨ä¦æ¦C¦¡¥i¥Hªí¥Ü¦¨ $det(V)=\prod_{\substack{1 \le i < j \le n}} (\alpha_j - \alpha_i)$¡A¦]¦¹¦pªG $\alpha_i \neq \alpha_j, \forall i \neq j$¡A¨ä¦æ¦C¦¡±N¤£·|µ¥©ó¹s¡C¡^

Hint
  • ¤W¨Ò¥Nªí³q¹L (1,6)¡B (2,11)¡B (3,18) ¤TÂIªº¤G¦¸¦±½u¬° $y=x^2+2x+3$¡C¡]¬°¤°»ò¡H¡^
  • MATLAB ªº¡u¥ª°£¡v±`³Q¥Î©ó¡u¦±½uÀÀ¦X¡v¡]Curve Fitting¡^»P¡u°jÂk¤ÀªR¡v¡]Regression Analysis¡^¡A¥i°Ñ¨£¥»®Ñ¡u¦±½uÀÀ¦X»P°jÂk¤ÀªR¡v¤§³¹¸`¡C

·í m > n ®É¡A¡u¥ª°£¡v¥i¥H§ä¨ì³Ì¤p¥­¤è¸Ñ¡CÁ|¨Ò¦p¤U¡G

Example 2: 06-½u©Ê¥N¼Æ/leftDiv02.mA = [2 -1; 1 -2; 1 1]; b = [2; -2; 1]; x = A\bx = 1.0000 1.0000

¦b¤W¨Ò¤¤¡A§Ú­Ì¦³ 3 ­Ó¤èµ{¦¡¡A¦ý«o¥u¦³ 2 ­Ó¥¼ª¾¼Æ¡A¦¹ 3 ­Ó¤èµ{¦¡¦b X-Y ¥­­±¨Ã¥¼¥æ©ó¤@ÂI¡A¬GÄY®æ¦a»¡¡A¦¹¤èµ{²ÕµL¸Ñ¡A¦Ó MATLABªº¡u¥ª°£¡v§ä¨ìªº $x$ ¬°³Ì¤p¥­¤è¸Ñ¡A¥i¥H¨Ï±o $|Ax-b|^2$ ¬°³Ì¤p­È¡C

Hint
¦b¤W¨Ò¤¤¡A°²³] $x$ ¨ì¤T±øª½½u¤èµ{¦¡ªº¶ZÂ÷¬O $l_1$¡B$l_2$ ¤Î $l_3$¡A«h x=A\b ¯à¨Ï $5l_1^2+5l_2^2+l_3^2$ ªº­È¬°³Ì¬°¤p¡C¡]¬°¤°»ò¡H¡^

·í m < n ®É¡A¡u¥ª°£¡v¥i¥H§ä¨ì°ò¥»¸Ñ¡AÁ|¨Ò¦p¤U¡G

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 ¦b¶i¦æ¡u¥ª°£¡v®É¡A¹ê»Ú¤W¥Î¨ì¤F«Ü¦h¯x°}ªº¹Bºâ¤ÎÅܧΡA¨Ò¦p¡GLU Decomposition¡AQR Factorization¡ACholesky Factorization¡A ¥H¤Î¤@¯ëªº°ª´µ®ø¥hªk¡]Gaussian Elimination¡^µ¥¡C¥Ñ©ó¦¹³¡¥÷²o¯A¸û²`ªº½u©Ê¥N¼Æ¤Î¼Æ­È¤èªk¡A¦b¦¹¤£²`¤J¤¶²Ð¡C ¬ÛÃöªº MATLAB «ü¥O¦³ lu¡Bqr ¤Î chol µ¥¡AŪªÌ¥i¥Ñ MATLAB ½u¤W¤ä´©±o¨ì§ó¦hªº¸ê°T¡C


MATLABµ{¦¡³]­p¡G¶i¶¥½g