?? ch6_1.htm
字號:
<! Made by Html Translation Ver 1.0>
<HTML>
<HEAD>
<TITLE> 利用矩陣解法 </TITLE>
</HEAD>
<BODY BACKGROUND="bg0000.gif" tppabs="http://166.111.167.223/computer/cai/matlabjc/img/bg0000.gif">
<FONT COLOR="#0000FF">
<H1>6.1 利用矩陣解法</H1>
</FONT>
<HR>
<P>
假設(shè)一組聯(lián)立線性方程式為
<P>
<IMG SRC="img00001-3.gif" tppabs="http://166.111.167.223/computer/cai/matlabjc/img6/img00001.gif">
<P>
我們習(xí)慣將上組方程式以矩陣方式表示如下
<P>
<I> </I><FONT FACE="Times New Roman">AX=B</FONT>
<P>
其中<FONT FACE="Times New Roman"> A </FONT>為等式左邊各方程式的系數(shù)項,<FONT FACE="Times New Roman">X
</FONT>為欲求解的未知項,<FONT FACE="Times New Roman">B </FONT>代表等式右邊之已知項
<P>
<A NAME="work"> <IMG SRC="img00002-3.gif" tppabs="http://166.111.167.223/computer/cai/matlabjc/img6/img00002.gif"></A>
<P>
要解上述的聯(lián)立方程式,我們可以利用在第六章介紹的矩陣左除<FONT FACE="Times New Roman">
</FONT><FONT COLOR=#FF0000>\</FONT><FONT FACE="Times New Roman">
</FONT>做運(yùn)算,即是<FONT FACE="Times New Roman"> </FONT><FONT COLOR=#FF0000 FACE="Times New Roman">X=A\B</FONT>。
<BR>
<P>
如果將原方程式改寫成<FONT FACE="Times New Roman"> XA=B</FONT>,且令<FONT FACE="Times New Roman">
X, A </FONT>和<FONT FACE="Times New Roman"> B </FONT>分別為
<P>
<IMG SRC="img00003-3.gif" tppabs="http://166.111.167.223/computer/cai/matlabjc/img6/img00003.gif">
<P>
注意上式的<FONT FACE="Times New Roman"> X, B </FONT>已改寫成列向量,<FONT FACE="Times New Roman">A</FONT>其實(shí)是前一個方程式中<FONT FACE="Times New Roman">
A </FONT>的轉(zhuǎn)置矩陣。上式的<FONT FACE="Times New Roman"> X </FONT>可以矩陣右除<FONT FACE="Times New Roman">
</FONT><FONT COLOR=#FF0000 FACE="Times New Roman">/</FONT><FONT FACE="Times New Roman">
</FONT>求解,即是<FONT FACE="Times New Roman"> </FONT><FONT COLOR=#FF0000 FACE="Times New Roman">X=B/A</FONT>。
<BR>
<P>
若以反矩陣運(yùn)算求解<FONT FACE="Times New Roman"> AX=B, X=<IMG SRC="img00004-3.gif" tppabs="http://166.111.167.223/computer/cai/matlabjc/img6/img00004.gif">B</FONT>,即是<FONT FACE="Times New Roman">
</FONT><FONT COLOR=#FF0000 FACE="Times New Roman">X=inv(A)*B</FONT>,或是改寫成<FONT FACE="Times New Roman">
XA=B, X=B<IMG SRC="img00005-3.gif" tppabs="http://166.111.167.223/computer/cai/matlabjc/img6/img00005.gif"></FONT>,即是<FONT FACE="Times New Roman">
</FONT><FONT COLOR=#FF0000 FACE="Times New Roman">X=B*inv(A)</FONT>。
<BR>
<P>
我們直接以下面的例子來說明這三個運(yùn)算的用法:
<P>
<FONT COLOR=#FF0000 FACE="Times New Roman">>> A=[3 2 -1;
-1 3 2; 1 -1 -1]; % </FONT><FONT COLOR=#FF0000>將等式的左邊系數(shù)鍵入</FONT>
<P>
<FONT COLOR=#FF0000 FACE="Times New Roman">>> B=[10 5 -1]';
% </FONT><FONT COLOR=#FF0000>將等式右邊之已知項鍵入,</FONT><FONT COLOR=#FF0000 FACE="Times New Roman">B</FONT><FONT COLOR=#FF0000>要做轉(zhuǎn)置</FONT>
<P>
<FONT COLOR=#FF0000 FACE="Times New Roman">>> X=A\B
% </FONT><FONT COLOR=#FF0000>先以左除運(yùn)算求解</FONT><FONT COLOR=#FF0000 FACE="Times New Roman">
</FONT>
<P>
<FONT COLOR=#FF0000 FACE="Times New Roman">X = % </FONT><FONT COLOR=#FF0000>注意</FONT><FONT COLOR=#FF0000 FACE="Times New Roman">X</FONT><FONT COLOR=#FF0000>為行向量</FONT>
<P>
<FONT COLOR=#FF0000 FACE="Times New Roman"> -2</FONT>
<P>
<FONT COLOR=#FF0000 FACE="Times New Roman"> 5</FONT>
<P>
<FONT COLOR=#FF0000 FACE="Times New Roman"> 6</FONT>
<P>
<FONT COLOR=#FF0000 FACE="Times New Roman">>> C=A*X
% </FONT><FONT COLOR=#FF0000>驗(yàn)算解是否正確</FONT>
<P>
<FONT COLOR=#FF0000 FACE="Times New Roman">C = % C=B</FONT>
<P>
<FONT COLOR=#FF0000 FACE="Times New Roman"> 10</FONT>
<P>
<FONT COLOR=#FF0000 FACE="Times New Roman"> 5</FONT>
<P>
<FONT COLOR=#FF0000 FACE="Times New Roman"> -1<BR>
</FONT>
<P>
<FONT COLOR=#FF0000 FACE="Times New Roman">>> A=A';
% </FONT><FONT COLOR=#FF0000>將</FONT><FONT COLOR=#FF0000 FACE="Times New Roman">A</FONT><FONT COLOR=#FF0000>先做轉(zhuǎn)置</FONT>
<P>
<FONT COLOR=#FF0000 FACE="Times New Roman">>> B=[10 5 -1];</FONT>
<P>
<FONT COLOR=#FF0000 FACE="Times New Roman">>> X=B/A
% </FONT><FONT COLOR=#FF0000>以右除運(yùn)算求解的結(jié)果亦同</FONT>
<P>
<FONT COLOR=#FF0000 FACE="Times New Roman">X = % </FONT><FONT COLOR=#FF0000>注意</FONT><FONT COLOR=#FF0000 FACE="Times New Roman">X</FONT><FONT COLOR=#FF0000>為列向量</FONT>
<P>
<FONT COLOR=#FF0000 FACE="Times New Roman"> 10 5 -1</FONT>
<P>
<FONT COLOR=#FF0000 FACE="Times New Roman">>> X=B*inv(A);
% </FONT><FONT COLOR=#FF0000>也可以反矩陣運(yùn)算求解<BR>
</FONT><HR>
<A HREF="ch6.htm" tppabs="http://166.111.167.223/computer/cai/matlabjc/ch6.htm"><IMG SRC="lastpage.gif" tppabs="http://166.111.167.223/computer/cai/matlabjc/img/lastpage.gif" BORDER=0></A>
<A HREF="ch6_2.htm" tppabs="http://166.111.167.223/computer/cai/matlabjc/ch6_2.htm"><IMG SRC="nextpage-1.gif" tppabs="http://166.111.167.223/computer/cai/matlabjc/img/nextpage.gif" BORDER=0 HSPACE=10></A>
<A HREF="index.html" tppabs="http://166.111.167.223/computer/cai/matlabjc/index.html"><IMG SRC="outline-1.gif" tppabs="http://166.111.167.223/computer/cai/matlabjc/img/outline.gif" BORDER=0 HSPACE=6></A><BR>
<FONT SIZE=2 COLOR=#AA55FF> 上一頁 下一頁 講義大綱 </FONT>
</BODY>
</HTML>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -