33
1 Linear Algebraic Equations 4장 선형방정식 시스템

Linear Algebraic Equations - KOCWcontents.kocw.net/KOCW/document/2014/hanyang/yoojuyeon/8.pdf · 2016. 9. 9. · linear equations: –Graphical method –Cramer’s rule –Method

  • Upload
    others

  • View
    6

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Linear Algebraic Equations - KOCWcontents.kocw.net/KOCW/document/2014/hanyang/yoojuyeon/8.pdf · 2016. 9. 9. · linear equations: –Graphical method –Cramer’s rule –Method

1

Linear Algebraic Equations4장선형방정식시스템

Page 2: Linear Algebraic Equations - KOCWcontents.kocw.net/KOCW/document/2014/hanyang/yoojuyeon/8.pdf · 2016. 9. 9. · linear equations: –Graphical method –Cramer’s rule –Method

예 4.3

831

730

653

421BA

224

311

863513

743201BA

2493

2190

8*33*31*3

7*33*30*33B

1482

1151

863513

743201BA

64

52

31TA

Page 3: Linear Algebraic Equations - KOCWcontents.kocw.net/KOCW/document/2014/hanyang/yoojuyeon/8.pdf · 2016. 9. 9. · linear equations: –Graphical method –Cramer’s rule –Method

예 4.3

03

23

12

224

102

131

BA

280

042

213

2*21*21*42*20*23*44*22*21*4

2*11*01*22*10*03*24*12*01*2

2*11*31*12*10*33*14*12*31*12 AAAAA

84

21

710

0*22*21*43*23*22*4

0*22*01*23*13*02*2

0*12*31*13*13*32*1

ABAB

200

630

121

U

상삼각행렬

261

032

001

U

하삼각행렬

200

030

001

U

대각행렬

100

010

001

U

단위행렬

Page 4: Linear Algebraic Equations - KOCWcontents.kocw.net/KOCW/document/2014/hanyang/yoojuyeon/8.pdf · 2016. 9. 9. · linear equations: –Graphical method –Cramer’s rule –Method

Matlab

>> ones(2)>> zeros(2,4)>>rand(2,4)>>eyes(3)>>v=[3 2 5]>>D=diag(v)>>C=[2 -4 7; 3 1 8; -1 5 6]>>u=diag(C)>>v=inv(C )>>C’

Page 5: Linear Algebraic Equations - KOCWcontents.kocw.net/KOCW/document/2014/hanyang/yoojuyeon/8.pdf · 2016. 9. 9. · linear equations: –Graphical method –Cramer’s rule –Method

Matlab

>>A =[2 5; 0 6]>>B = [1 3; 4 2]>>A*B>>A^2>>A/B>>A.*B

Page 6: Linear Algebraic Equations - KOCWcontents.kocw.net/KOCW/document/2014/hanyang/yoojuyeon/8.pdf · 2016. 9. 9. · linear equations: –Graphical method –Cramer’s rule –Method

6

Noncomputer Methods for Solving

Systems of Equations

• 방정식의 갯수 (n ≤ 3) 선형 방정식들은 “소거의 방법." 같은 간단한 방법으로 쉽게 해결할 수 있다.

• 선형 대수학은 선형 방정식의 이러한 시스템을 해결하는도구를 제공하고있다.

• 요즘 컴퓨터에 쉽게 접근할 수 선형 대수 방정식이 가능하고 실용적인 대규모 세트의 해결책을 제공한다.

Page 7: Linear Algebraic Equations - KOCWcontents.kocw.net/KOCW/document/2014/hanyang/yoojuyeon/8.pdf · 2016. 9. 9. · linear equations: –Graphical method –Cramer’s rule –Method

7

Gauss Elimination

가우스소거법

Solving Small Numbers of Equations

• There are many ways to solve a system of

linear equations:

– Graphical method

– Cramer’s rule

– Method of elimination

– Computer methods

For n ≤ 3

Page 8: Linear Algebraic Equations - KOCWcontents.kocw.net/KOCW/document/2014/hanyang/yoojuyeon/8.pdf · 2016. 9. 9. · linear equations: –Graphical method –Cramer’s rule –Method

8

Graphical Method

• For two equations:

• Solve both equations for x2:

2222121

1212111

bxaxa

bxaxa

22

21

22

212

12

12

11

12

112 intercept(slope)

a

bx

a

ax

xxa

bx

a

ax

Page 9: Linear Algebraic Equations - KOCWcontents.kocw.net/KOCW/document/2014/hanyang/yoojuyeon/8.pdf · 2016. 9. 9. · linear equations: –Graphical method –Cramer’s rule –Method

9

Page 10: Linear Algebraic Equations - KOCWcontents.kocw.net/KOCW/document/2014/hanyang/yoojuyeon/8.pdf · 2016. 9. 9. · linear equations: –Graphical method –Cramer’s rule –Method

10

특이(Singular) 불량조건 (ill-conditioned)

Page 11: Linear Algebraic Equations - KOCWcontents.kocw.net/KOCW/document/2014/hanyang/yoojuyeon/8.pdf · 2016. 9. 9. · linear equations: –Graphical method –Cramer’s rule –Method

Part 3 11

Page 12: Linear Algebraic Equations - KOCWcontents.kocw.net/KOCW/document/2014/hanyang/yoojuyeon/8.pdf · 2016. 9. 9. · linear equations: –Graphical method –Cramer’s rule –Method

12

Determinants and Cramer’s Rule

• Determinant can be illustrated for a set of three

equations:

• Where [A] is the coefficient matrix:

BxA

333231

232221

131211

aaa

aaa

aaa

A

Page 13: Linear Algebraic Equations - KOCWcontents.kocw.net/KOCW/document/2014/hanyang/yoojuyeon/8.pdf · 2016. 9. 9. · linear equations: –Graphical method –Cramer’s rule –Method

Part 3 13

• 모든 행렬이 정사각형 행렬이라는 가정하에, 정사각형 행렬 [A]와 관련된오더(order)로 결정되는 [A]의행렬식(determinant). D

만약 [A]의 order가 1라고하며, [A] 는하나의요소를갖는다. [A]=[a11] D=a11

• 정사각형오더가 3이라면요소의소행렬식(minor)는행렬 [A] 행 i 및열 j을삭제하여 order 2의행렬식를결정하면된다.

22313221

3231

2221

13

23313321

3331

2321

12

23323322

3332

2322

11

333231

232221

131211

aaaaaa

aaD

aaaaaa

aaD

aaaaaa

aaD

aaa

aaa

aaa

D

Page 14: Linear Algebraic Equations - KOCWcontents.kocw.net/KOCW/document/2014/hanyang/yoojuyeon/8.pdf · 2016. 9. 9. · linear equations: –Graphical method –Cramer’s rule –Method

Part 3 14

Page 15: Linear Algebraic Equations - KOCWcontents.kocw.net/KOCW/document/2014/hanyang/yoojuyeon/8.pdf · 2016. 9. 9. · linear equations: –Graphical method –Cramer’s rule –Method

15

• Cramer’s rule 은방정식의 계수들의 배열의 determinants의 비율 측면에서 선형방정식의 시스템의 해를 표현하는 방법이다.

• 예를들어 x1 은아래와같이계산가능:

D

aab

aab

aab

x33323

23222

13121

1

Page 16: Linear Algebraic Equations - KOCWcontents.kocw.net/KOCW/document/2014/hanyang/yoojuyeon/8.pdf · 2016. 9. 9. · linear equations: –Graphical method –Cramer’s rule –Method

16

Page 17: Linear Algebraic Equations - KOCWcontents.kocw.net/KOCW/document/2014/hanyang/yoojuyeon/8.pdf · 2016. 9. 9. · linear equations: –Graphical method –Cramer’s rule –Method

17

4.2 Method of Elimination

• 기본 전략은 연속적으로 미지수의 집합의 방정식 중 하나를 해결하기 위해 대체방법을 이용하여 나머지 방정식에서 해당 변수를 제거하는 것임.

• 미지수의제거는 2, 3개 방정식인 시스템을 확장할 수 있지만, 이 방법은 수동으로 할 경우 매우 지루하다.

Page 18: Linear Algebraic Equations - KOCWcontents.kocw.net/KOCW/document/2014/hanyang/yoojuyeon/8.pdf · 2016. 9. 9. · linear equations: –Graphical method –Cramer’s rule –Method

18

Naive Gauss Elimination

• 미지수를 소거한다거나 후진대입을 하는 체계적 도식이나 알고리즘을 개발하므로 일련의 대형형태의 방정식에적용할 수 있음

• 2개의 방정식의 해를 구하는 형식대로, n의 방정식은 두가지 관점에서 기술을 적용할 수 있다.– Forward elimination of unknowns

– Back substitution

Page 19: Linear Algebraic Equations - KOCWcontents.kocw.net/KOCW/document/2014/hanyang/yoojuyeon/8.pdf · 2016. 9. 9. · linear equations: –Graphical method –Cramer’s rule –Method

Part 3 19

x1 = c1”/a11

x2 = (c’2 – a’21x1)/a’22

x3 = (c3 –a23x2-a31x3)/a33

Backward elimination

FrontSubstitution

Pivot equation

Pivot coefficient

Page 20: Linear Algebraic Equations - KOCWcontents.kocw.net/KOCW/document/2014/hanyang/yoojuyeon/8.pdf · 2016. 9. 9. · linear equations: –Graphical method –Cramer’s rule –Method

Part 3 20

Normalization

a11가 0인 경우에는 어떻게? overflow error

Page 21: Linear Algebraic Equations - KOCWcontents.kocw.net/KOCW/document/2014/hanyang/yoojuyeon/8.pdf · 2016. 9. 9. · linear equations: –Graphical method –Cramer’s rule –Method

21

Page 22: Linear Algebraic Equations - KOCWcontents.kocw.net/KOCW/document/2014/hanyang/yoojuyeon/8.pdf · 2016. 9. 9. · linear equations: –Graphical method –Cramer’s rule –Method

삼각행렬만드는 것

후진대입법

Page 23: Linear Algebraic Equations - KOCWcontents.kocw.net/KOCW/document/2014/hanyang/yoojuyeon/8.pdf · 2016. 9. 9. · linear equations: –Graphical method –Cramer’s rule –Method
Page 24: Linear Algebraic Equations - KOCWcontents.kocw.net/KOCW/document/2014/hanyang/yoojuyeon/8.pdf · 2016. 9. 9. · linear equations: –Graphical method –Cramer’s rule –Method

Part 3 24

Page 25: Linear Algebraic Equations - KOCWcontents.kocw.net/KOCW/document/2014/hanyang/yoojuyeon/8.pdf · 2016. 9. 9. · linear equations: –Graphical method –Cramer’s rule –Method

Part 3 25

Pitfalls of Elimination Methods• Division by zero.

– 소거와후진대입시 0으로나누어질가능성이있다.

• Round-off errors.

a11가 0인 경우에는 어떻게? overflow error Pivot method

상대오차 -0.00043%

유효자리수 증가

Page 26: Linear Algebraic Equations - KOCWcontents.kocw.net/KOCW/document/2014/hanyang/yoojuyeon/8.pdf · 2016. 9. 9. · linear equations: –Graphical method –Cramer’s rule –Method

Part 3 26

Pitfalls of Elimination Methods

• Ill-conditioned systems. – 계수차이가 적은 변화일 경우 해에 큰 변화를 줄 수 있다.

– 2개 또는 여러 개의 방정식이 거의 같을때, 방정식을거의 만족시키는 넓은 범위의 해를 구할 수 있다.

– 라운드 오프오차가 계수에있어 작은 변화를 일으킬 수있으므로 이러한 변화는 큰오차를 초래할 경우가 있다.

Page 27: Linear Algebraic Equations - KOCWcontents.kocw.net/KOCW/document/2014/hanyang/yoojuyeon/8.pdf · 2016. 9. 9. · linear equations: –Graphical method –Cramer’s rule –Method

27

Page 28: Linear Algebraic Equations - KOCWcontents.kocw.net/KOCW/document/2014/hanyang/yoojuyeon/8.pdf · 2016. 9. 9. · linear equations: –Graphical method –Cramer’s rule –Method

Scaling Effect

28

Page 29: Linear Algebraic Equations - KOCWcontents.kocw.net/KOCW/document/2014/hanyang/yoojuyeon/8.pdf · 2016. 9. 9. · linear equations: –Graphical method –Cramer’s rule –Method

29

4.3 Techniques for Improving Solutions

• Use of more significant figures.

• Pivoting. – 피봇계수가 0이라면 정규화단계는 0으로나누어진다.

– 피봇계수가 0에가까운경우동일한문제가발생될수있다. 이러한문제는피해야한다.

– Partial pivoting.가장큰요소가첫번째행으로오더러바꾸는방법

– Complete pivoting.

모든행중에서가장큰요소가첫번째행으로바꾸는방법

Page 30: Linear Algebraic Equations - KOCWcontents.kocw.net/KOCW/document/2014/hanyang/yoojuyeon/8.pdf · 2016. 9. 9. · linear equations: –Graphical method –Cramer’s rule –Method

Partial pivoting

Part 3 30

Page 31: Linear Algebraic Equations - KOCWcontents.kocw.net/KOCW/document/2014/hanyang/yoojuyeon/8.pdf · 2016. 9. 9. · linear equations: –Graphical method –Cramer’s rule –Method

15

9

6

11

4

3

2

1

2613

2471

1332

4231

x

x

x

x

6734c

ijac max

3/2max6

3,7

1,3

2,4

1

r

43,1.2d

순서를 변경

Partial 알고리즘

Page 32: Linear Algebraic Equations - KOCWcontents.kocw.net/KOCW/document/2014/hanyang/yoojuyeon/8.pdf · 2016. 9. 9. · linear equations: –Graphical method –Cramer’s rule –Method

ijac max

6734c

3/2max6

3,7

1,3

2,4

1

r

43,1.2d

Page 33: Linear Algebraic Equations - KOCWcontents.kocw.net/KOCW/document/2014/hanyang/yoojuyeon/8.pdf · 2016. 9. 9. · linear equations: –Graphical method –Cramer’s rule –Method