⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ch6_1.htm

📁 一个不错的matlab工程实际问题的解决方法
💻 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>

假设一组联立线性方程式为

<P>

 <IMG SRC="img00001-3.gif" tppabs="http://166.111.167.223/computer/cai/matlabjc/img6/img00001.gif">

<P>

我们习惯将上组方程式以矩阵方式表示如下

<P>

<I> </I><FONT FACE="Times New Roman">AX=B</FONT>

<P>

其中<FONT FACE="Times New Roman"> A </FONT>为等式左边各方程式的系数项,<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>

要解上述的联立方程式,我们可以利用在第六章介绍的矩阵左除<FONT FACE="Times New Roman">

</FONT><FONT COLOR=#FF0000>\</FONT><FONT FACE="Times New Roman">

</FONT>做运算,即是<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>其实是前一个方程式中<FONT FACE="Times New Roman">

A </FONT>的转置矩阵。上式的<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>

若以反矩阵运算求解<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>

我们直接以下面的例子来说明这三个运算的用法:

<P>

<FONT COLOR=#FF0000 FACE="Times New Roman">&gt;&gt; A=[3 2 -1;

-1 3 2; 1 -1 -1]; % </FONT><FONT COLOR=#FF0000>将等式的左边系数键入</FONT>

<P>

<FONT COLOR=#FF0000 FACE="Times New Roman">&gt;&gt; B=[10 5 -1]';

     % </FONT><FONT COLOR=#FF0000>将等式右边之已知项键入,</FONT><FONT COLOR=#FF0000 FACE="Times New Roman">B</FONT><FONT COLOR=#FF0000>要做转置</FONT>

<P>

<FONT COLOR=#FF0000 FACE="Times New Roman">&gt;&gt; X=A\B    

   % </FONT><FONT COLOR=#FF0000>先以左除运算求解</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">&gt;&gt; C=A*X    

   % </FONT><FONT COLOR=#FF0000>验算解是否正确</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">&gt;&gt; A=A';    

    % </FONT><FONT COLOR=#FF0000>将</FONT><FONT COLOR=#FF0000 FACE="Times New Roman">A</FONT><FONT COLOR=#FF0000>先做转置</FONT>

<P>

<FONT COLOR=#FF0000 FACE="Times New Roman">&gt;&gt; B=[10 5 -1];</FONT>

<P>

<FONT COLOR=#FF0000 FACE="Times New Roman">&gt;&gt; X=B/A    

   % </FONT><FONT COLOR=#FF0000>以右除运算求解的结果亦同</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">&gt;&gt; X=B*inv(A);

      % </FONT><FONT COLOR=#FF0000>也可以反矩阵运算求解<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>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -