Transcript Welcome to

Chapter 3
Solution of Simultaneous Linear
Algebraic Equations: Lecture (I)
Dr. Jie Zou PHY 3320
1
Outline

Introduction


Scientific and engineering applications



Simultaneous linear algebraic equations?
Statics: Force analysis
Circuit analysis: Currents and voltages
Introduction to (1) matrix algebra and
(2) MATLAB built-in functions*
*Reference: Applied Numerical Methods with
MATLAB for Engineers and Scientists, S. Chapra,
Ch. 8
Dr. Jie Zou PHY 3320
2
Introduction

What are simultaneous linear algebraic
equations?
The general form:
a11x1 + a12x2 +
+ a1nxn = b1
a21x1 + a22x2 +
+ a2nxn = b2

an1x1 + an2x2 +
Dr. Jie Zou PHY 3320
+ annxn = bn
3
Scientific and engineering
applications: Statics

Example 3.1: A
scaffolding system,
consisting of three rigid
bars and six wire ropes,
is used to support the
loads P1, P2, and P3 as
shown in Fig. (a).

Free-body
diagram
Dr. Jie Zou PHY 3320
Find the tensions
developed in the ropes A,
B, C, D, E, and F where P1
= 2000 lb, P2 = 1000 lb,
and P3 = 500 lb.
4
Scientific and engineering
applications: Circuit analysis

Dr. Jie Zou PHY 3320
Example 3.2: An electrical
network consists of six
resistors as shown. If the
voltages at nodes 1 and 6
are specified as 200 and
0 volts, respectively,
determine the voltages at
the nodes 2, 3, 4, and 5.
5
Introduction to matrix algebra

A matrix


Row vectors: 1  n matrices
Column vectors: m  1 matrices
Dr. Jie Zou PHY 3320
6
Types of matrices
(1) A square matrix:
 a11 a12
A  a21 a22
a31 a32
a13 
a23 
a33 
(2) A symmetric matrix:
Principal or
main diagonal
(3) A diagonal matrix:
a11
A  
a22

5 1 2
A  1 3 7

2 7 8


a33 
(4) An identity matrix [I]: A diagonal matrix where all
the diagonal elements are equal to 1.
a11 a12 a13 
(5) An upper triangular matrix:
A  
a
a 
(6) A banded matrix:
Dr. Jie Zou PHY 3320
 a11 a12
a
a
A   21 22

a32




a23
a33
a43
22

a33 
23



a34 
 Bandwidth of 3
a44 
7
Matrix operating rules

Addition of two matrices [C] = [A]+[B]:


Multiplication of a matrix by a scalar [D] =
g[A]:


cij = aij + bij
dij = gaij
Product of two matrices [C] = [A][B]:
n
cij   aik bkj
k 1


[A]: m  n; [B]: n  l; [C]: m  l
[A][B]  [B][A]
Dr. Jie Zou PHY 3320
8
Matrix operating rules (cont.)

Inverse of a matrix [A]-1:


Definition: [A][A]-1 = [A]-1[A] = [I]
The inverse of a 2  2 matrix:
A
1


 a22  a12 
1

a11a22  a12a21  a21 a11 
For higher-dimensional matrices, the
computation is much more complicated.
Transpose of a matrix [A]T:
Dr. Jie Zou PHY 3320
 a11 a12
A  a21 a22
a31 a32
a13 
a23 
a33 
 a11
AT  a12
a13
a21 a31 
a22 a32 
a23 a33 
9
MATLAB matrix manipulations

Hands-on exercise-Type the following in the
MATLAB command window:
(1) A=[1 5 6;7 4 2;-3 6 7]
(3) x=[8 6 9];
y=[-5 8 1];
z=[4 8 2];
B=[x; y; z]
(4) C=A+B
(6) A*B
(8) AI=inv(A)
(10) I=eye(3)
Dr. Jie Zou PHY 3320
(2) A’
(5) D=C-B
(7) A.*B
(9) A*AI
10
Represent linear algebraic
equations in the matrix form

Linear algebraic equations:
a11x1 + a12x2 + a13x3 = b1
a21x1 + a22x2 + a23x3 = b2
a31x1 + a32x2 + a33x3 = b3
Matrix form: [A]x = b

A formal way to solve [A]x = b:

 a11 a12
A  a21 a22
a31 a32

a13 
 x1 
 b1 
a23  , x   x2  , b  b2 
 x3 
b3 
a33 
x=[A]-1b; Note: Involving the calculation for [A]-1; very inefficient.
Dr. Jie Zou PHY 3320
11
Solve linear algebra equations
with MATLAB

MATLAB provides two direct ways:
(1) Use the backslash or “left-division”:
x=A\b
(2) Use matrix inversion: x=inv(A)*b


Method (1) is 2 or 3 times as fast.
Exercise: Write an M-file and use the
“left-division” and matrix inversion to
solve Example 3.2 (Rao).
Dr. Jie Zou PHY 3320
12