Date post: | 14-Apr-2018 |
Category: |
Documents |
Upload: | sirish-kamarajugadda |
View: | 231 times |
Download: | 0 times |
of 17
7/27/2019 Lecture6 Linear Algebra
1/17
THE UNIVERSITY OF TEXAS AT AUSTIN
DEPARTMENT OF AEROSPACE ENGINEERING AND ENGINEERING
MECHANICS
ASE 311 ENGINEERING COMPUTATIONFALL 2013
Instructor:
Danial FaghihiThe Institute for Computational Engineering and Science
ACES 4.122, [email protected]
September 13, 2013
Lecture 6:
Linear Algebraic Equations and Matrices
Chapter 8
7/27/2019 Lecture6 Linear Algebra
2/17
HintforProblems4and5,hw1:
Example4.10thebook:usingtheMaclaurinseriesexpansionofex,howmanyterms
requiredfores9ma9ngthevaluee0.5?
Solu5on:
exactvalue: errorcriterionforthreesignificantfigures
Zeroorder(n=0):Percenttotalerror:
Firstorder(n=1):
Percenttotalerror:
PercentrelaEveerror:
Secondorder(n=2):..
x=0.5
Thestoppingcriteria
isnotsaEsfied
ex
= 1 + x +x2
2+
x3
3!+ . . . +
xn
n!e0.5
= 1.648721
"s = (0.5 1023)% = 0.05%
e
x
' 1
"t = |1.648721 1
1.648721| = 39.3
7/27/2019 Lecture6 Linear Algebra
3/17
HintforProblems4and5,hw1:
Solu5oncon5nue:
UsetheZeroorderM-fileofFigure4.2ofthebook,IterMeth.mtoconfirmtheresults.
>> [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 !
ex
= 1 + x +x2
2+
x3
3!+ . . . +
xn
n!
e0.5
=? and "s = 0.05
7/27/2019 Lecture6 Linear Algebra
4/17
Chapter8:
LinearAlgebraicquaEons
andMatrices
7/27/2019 Lecture6 Linear Algebra
5/17
MATRIXALGEBRAOVERVIEW
KnowledgeofmatricesisessenEalforunderstandingthesoluEonof
linearalgebraicequaEons.
rowvectors columnvectors
aij =
m by n dimension
matrix
7/27/2019 Lecture6 Linear Algebra
6/17
MATRIXALGEBRAOVERVIEW
Defini4ons: square matrices: m=n
Principle elementsor main diagonal
Symmetric matrix: aij=aji
diagonal matrix: a square matrix
where all elements off the maindiagonal are equal to zero
identity matrix: a diagonal matrix where
all elements on the main diagonal are
equal to 1
Property of [ I]
7/27/2019 Lecture6 Linear Algebra
7/17
MATRIXALGEBRAOVERVIEW
MatrixOpera4on
AddiEonandSubtracEon:
MulEplicaEonofmatrix[A]byascalarg
cij = aij bij
7/27/2019 Lecture6 Linear Algebra
8/17
MATRIXALGEBRAOVERVIEW
Matrices Product
matrix multiplication is
associative distributive commutative
7/27/2019 Lecture6 Linear Algebra
9/17
MATRIXALGEBRAOVERVIEW
Inverseofamatrix[A]
-1
Ifamatrix[A]issquareandnonsingular,thereisanothermatrix[A]1,
calledtheinverseof[A]:
Transposeofamatrix[A]T
Transposeofmatrix[A]involvestransformingitsrowsintocolumns
anditscolumnsintorows
7/27/2019 Lecture6 Linear Algebra
10/17
MATRIXALGEBRAOVERVIEW
augmenta5on. AmatrixisaugmentedbytheaddiEonofacolumn(orcolumns)to
theoriginalmatrix.
Forexample,supposewehavea3*3matrixofcoefficients.Wemightwishtoaugmentthismatrix[A]witha3*3idenEtymatrixtoyielda
3*6dimensionalmatrix:
PerformingasetofidenEcaloperaEonsontherowsoftwomatrices.
7/27/2019 Lecture6 Linear Algebra
11/17
MATLABMATRIXManipula4on
create[A]
transposeof[A]:
A =
264
1 5 6
7 4 2
3 6 7
375
create{x},{y},and{z}vectors:
combine{x},{y},and{z}toform[B]
x =
h8 6 9
i; y =
h5 8 1
i
z =
h4 8 2
i
B =
2
64
8 6 9
5 8 1
4 8 2
3
75
7/27/2019 Lecture6 Linear Algebra
12/17
MATLABMATRIXManipula4on
[C]=[A]+[B]=?
A =264
1 5 6
7 4 2
3 6 7
375 B = 2648 6 9
5 8 1
4 8 2
375
>> C = A + B!
C =!9 11 15!2 12 3!1 14 9!
>> A = C - B!A =!
1 5 6!7 4 2!-3 6 7!
[A]=[C]-[B]=?
[C1]=[A][B]=?
>> C1 = A*B!
C1 =!7 94 26!44 90 71!
-26 86 -7!
[C1]T
=?>> C1!ans =!
7 44 -26!94 90 86!26 71 -7!
[C1]-1=?
>> inv(C1)!
ans =!0.2073 -0.0890 -0.1334!0.0473 -0.0193 -0.0199!-0.1884 0.0937 0.1079!
[C1]-T
=?>> inv(C1')!>> inv(C1)!ans =!
0.2073 0.0473 -0.1884!-0.0890 -0.0193 0.0937!-0.1334 -0.0199 0.1079!
7/27/2019 Lecture6 Linear Algebra
13/17
MATLABMATRIXManipula4on
[A][D]=?
A =264
1 5 6
7 4 2
3 6 7
375
>> A*D!
Error using * !Inner matrix dimensions
must agree.!
>> D*A!ans =!
20 39 35!58 63 53!
[D][A]=?
[AI]=[A]-1=?
>> AI = inv(A)!
AI =!0.2462 0.0154 -0.2154
-0.8462 0.3846 0.6154!0.8308 -0.3231 -0.4769!
[A][AI]=?>> A*AI!ans =!1.0000 -0.0000 -0.0000!0.0000 1.0000 -0.0000!0.0000 -0.0000 1.0000!
[AI]-1=?
>> inv(AI)!
ans =!1.0000 5.0000 6.0000!7.0000 4.0000 2.0000!-3.0000 6.0000 7.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!
="1 4 3
5 8 1#
7/27/2019 Lecture6 Linear Algebra
14/17
Represen4ngLinearAlgebraicEqua4onsinMatrixForm
Systemsoflinearequa4ons:
[A]{x} = {b}
264a11 a12 a13
a21 a22 a23
a31 a32 a33
375264x1
x2
x3
375 =
264b1
b2
b3
375
can be expressed as
matrix of coefficients vector of constantsvector of unknowns
7/27/2019 Lecture6 Linear Algebra
15/17
Represen4ngLinearAlgebraicEqua4onsinMatrixForm
Systemsoflinearequa4ons:
[A]{x} = {b}Solving the system of equation: determining (solving) the vector {x} for given[A] and {b} in the following relation
multiply each side of the equation by [A]-1
[A]1[A]{x} = [A]1{b}
[A]1[A] = [I]
[I]{x} = {x}
{x} = [A]1{b}
7/27/2019 Lecture6 Linear Algebra
16/17
Represen4ngLinearAlgebraicEqua4onsinMatrixForm
Systemsoflinearequa4ons:
Solving the system of equation: determining (solving) the vector {x} for given[A] and {b} in the following relation
MATLAB provides two direct ways to solve systems of linear algebraic
equations.
matrix inversion:>> x = inv(A)*b!
The most efficient way is to employ the backslash>> x = A\b!
{x} = [A]1{b}
7/27/2019 Lecture6 Linear Algebra
17/17
Example8.2ofthebook
Solving the system of equation using MATLAB:
enter the coefficient matrix and the right-hand-side vector
8>>:
(k1 + k2)x1 k2x2 = m1g
k2x1 + (k2 + k3)x2 k3x3 = m2g
k3x2 + k3x3 = m3g
m1 = 60 (kg) k1 = 50 (N/m)
m2 = 70 (kg) k2 = 100 (N/m)
m3 = 80 (kg) k3 = 50 (N/m)