0% found this document useful (0 votes)
44 views

Lecture6 Linear Algebra

This document provides an overview of linear algebra concepts and matrix operations. It discusses representing systems of linear equations in matrix form as [A]{x} = {b} where [A] is the coefficient matrix, {x} is the vector of unknowns, and {b} is the vector of constants. It also discusses solving such systems by multiplying both sides by the inverse of [A] to obtain {x} = [A]^-1{b}, or directly in MATLAB using the backslash operator x = A\b. An example system of three equations with three unknowns is presented to demonstrate the solution process.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views

Lecture6 Linear Algebra

This document provides an overview of linear algebra concepts and matrix operations. It discusses representing systems of linear equations in matrix form as [A]{x} = {b} where [A] is the coefficient matrix, {x} is the vector of unknowns, and {b} is the vector of constants. It also discusses solving such systems by multiplying both sides by the inverse of [A] to obtain {x} = [A]^-1{b}, or directly in MATLAB using the backslash operator x = A\b. An example system of three equations with three unknowns is presented to demonstrate the solution process.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

THE UNIVERSITY OF TEXAS AT AUSTIN DEPARTMENT OF AEROSPACE ENGINEERING AND ENGINEERING MECHANICS

ASE 311 ENGINEERING COMPUTATION


FALL 2013

Instructor:

Danial Faghihi
The Institute for Computational Engineering and Science ACES 4.122, [email protected]

September 13, 2013

Lecture 6: Linear Algebraic Equations and Matrices Chapter 8

Hint for Problems 4 and 5, hw1:


Example 4.1 0 the book: using the Maclaurin series expansion of ex, how many terms 2 3 n required for es9ma9ng the value e0.5 ? x x x x e =1+x+ + + ... + Solu5on: 2 3! n! exact value: e0.5 = 1.648721 error criterion for three signicant gures "s = (0.5 102 3 )% = 0.05%

x Zero order (n=0): e ' 1 Percent total error: "t = | 1.648721 1 | = 39.3 1.648721 x=0.5 First order (n=1):

Percent total error:


Percent relaEve error:


The stopping criteria is not saEsed

Second order (n=2): ..


Hint for Problems 4 and 5, hw1:


Solu5on con5nue:
x

Use the Zero order M-le of Figure 4.2 of the book, IterMeth.m to conrm the results.
>> [approxval, ea, iter] = IterMeth(.5,0.05,100)! approxval =! 1.6487! ea =! 0.0158! iter =! 6! ! >> trueval=exp(.5)! trueval =! 1.6487! >> et=abs((trueval- approxval)/trueval)*100! et =! 0.0014 !

x2 x3 xn e =1+x+ + + ... + 2 3! n!

e0.5 =? and "s = 0.05

Chapter 8: Linear Algebraic EquaEons and Matrices

MATRIX ALGEBRA OVERVIEW


Knowledge of matrices is essenEal for understanding the soluEon of linear algebraic equaEons. aij = m by n dimension matrix row vectors column vectors

MATRIX ALGEBRA OVERVIEW


Deni4ons: square matrices: m=n
Symmetric matrix: aij=aji

Principle elements or main diagonal

diagonal matrix: a square matrix where all elements off the main diagonal are equal to zero

identity matrix: a diagonal matrix where all elements on the main diagonal are equal to 1

Property of [ I ]

MATRIX ALGEBRA OVERVIEW


Matrix Opera4on

AddiEon and SubtracEon: cij = aij bij MulEplicaEon of matrix [A] by a scalar g

MATRIX ALGEBRA OVERVIEW


Matrices Product

matrix multiplication is associative distributive commutative

MATRIX ALGEBRA OVERVIEW


Inverse of a matrix [A]-1
If a matrix [A] is square and nonsingular, there is another matrix [A]1, called the inverse of [A]:

Transpose of a matrix [A]T


Transpose of matrix [A] involves transforming its rows into columns and its columns into rows

MATRIX ALGEBRA OVERVIEW


augmenta5on.
Amatrix is augmented by the addiEon of a column (or columns) to

the original matrix. For example, suppose we have a 3*3 matrix of coecients. We might wish to augment this matrix [A] with a 3*3 idenEty matrix to yield a 3*6 dimensional matrix:


Performing a set of idenEcal operaEons on the rows of two matrices.

MATLAB MATRIX M anipula4on 2 3


create [A]

6 A=4 7 3

6 7 4 25 6 7

create {x}, {y}, and {z} vectors:

i h i 5 8 1 x= 8 6 9 ; y= h i z= 4 8 2


transpose of [A]:

combine {x}, {y}, and 2 {z} to form 3

[B]

6 B=4 5 4

9 8 17 5 8 2

MATLAB MATRIX Manipula4on


6 A=4 7 3 2 1 3 5 6 7 4 25 6 7

[C] = [A] + [B] =?


>> C = A + B! C =! 9 11 2 12 1 14 15! 3! 9!

[C1] = [A] [B] =?


26! 71! -7!

6 B=4 5 4

3 6 9 8 17 5 8 2

[C1]-1 =?
-0.0890 -0.0193 0.0937 -0.1334! -0.0199! 0.1079!

>> C1 = A*B! C1 =! 7 94 44 90 -26 86

>> inv(C1)! ans =!


0.2073 0.0473 -0.1884

[A] = [C] - [B] =?


>> A = C - B! A =! 1 5 7 4 -3 6 6! 2! 7!

[C1]T =?
>> C1! ans =! 7 94 26 44 90 71 -26! 86! -7!

[C1]-T =?
>> inv(C1')! >> inv(C1)! ans =!
0.2073 -0.0890 -0.1334 0.0473 -0.0193 -0.0199 -0.1884! 0.0937! 0.1079!

MATLAB MATRIX Manipula4on


6 A=4 7 3 2 1 3 5 6 7 4 25 6 7

D=

"

1 4 5 8

3 1

[A][D] =?
>> A*D! Error using

[AI] = [A]-1 =?
>> -0.2154 0.6154! -0.4769!

[AI]-1 =?
inv(AI)! ans =! 1.0000 5.0000 7.0000 4.0000 -3.0000 6.0000 6.0000! 2.0000! 7.0000!

* !

>> AI = inv(A)! AI =!
0.2462 0.0154 -0.8462 0.3846 0.8308 -0.3231

Inner matrix dimensions must agree.!

[D][A] =?
>> D*A! ans =! 20 58 39 63 35! 53!

[A] [AI] =?
>> A*AI! ans =!
1.0000 0.0000 0.0000 -0.0000 1.0000 -0.0000 -0.0000! -0.0000! 1.0000!

( [AI] [B] )-T=?


>> inv(AI*B)! ans =! -1.2520 -0.0660 1.2680! 0.2320 0.6560 -0.0880! 0.5880 0.6540 -0.2920!

Represen4ng Linear Algebraic Equa4ons in Matrix Form


Systems of linear equa4ons:

can be expressed as

6 4a21 a31

a11

a12 a22 a32

2 3 x1 b1 a13 76 7 6 7 a23 5 4x2 5 = 4b2 5 a33 x3 b3 32

matrix of coefficients

[A]{x} = {b}
vector of unknowns

vector of constants

Represen4ng Linear Algebraic Equa4ons in Matrix Form


Systems of linear equa4ons:

Solving the system of equation: determining (solving) the vector {x} for given [A] and {b} in the following relation

[A]{x} = {b}

multiply each side of the equation by [A]-1

[ A]
[ A]
1

[A]{x} = [A]

{b}

[ A] = [ I ]

{ x } = [ A]

{b }

[I ]{x} = {x}

Represen4ng Linear Algebraic Equa4ons in Matrix Form


Systems of linear equa4ons:

Solving the system of equation: determining (solving) the vector {x} for given [A] and {b} in the following relation

{ x } = [ A]
matrix inversion: >> x = inv(A)*b!

{b }

MATLAB provides two direct ways to solve systems of linear algebraic equations.

The most efficient way is to employ the backslash >> x = A\b!

8 m1 = 60 (kg) > < ( k 1 + k 2 ) x 1 k 2 x 2 = m1 g k2 x1 + (k2 + k3 )x2 k3 x3 = m2 g m2 = 70 (kg) > : m3 = 80 (kg) k3 x2 + k3 x3 = m3 g


Solving the system of equation using MATLAB:

Example 8.2 of the book

k1 = 50 (N/m) k2 = 100 (N/m) k3 = 50 (N/m)

enter the coefficient matrix and the right-hand-side vector

You might also like