kuliah-minggu-2

33
Review Operasi Matriks Menghitung invers matrik s? Determinan? Matriks Singular?

Upload: ervanz-arlianz

Post on 20-Feb-2016

218 views

Category:

Documents


0 download

DESCRIPTION

matrix

TRANSCRIPT

Review Operasi Matriks

Menghitung invers matriks?Determinan?

Matriks Singular?

Menghitung invers matriks

1001

2221

1211

2221

1211

aaaa

cccc

1001

22221221

21221121

22121211

21121111

acacacac

acacacac

Determinan Hanya untuk square matrices

Jika determinan = 0 matriks singular, tidak punya invers

bcaddcba

dcba

det

123213312132231321

321

321

321

det

cbacbacbacbacbacba

cccbbbaaa

Cari invers nya…

5242

4221

Sistem Persamaan Linear

Simultaneous Linear Equations

Metode Penyelesaian

• Metode grafik• Eliminasi Gauss• Metode Gauss – Jourdan• Metode Gauss – Seidel• LU decomposition

Metode Grafik

2

-2

2

411

21

2

1

xx

Det{A} 0 A is nonsingular so invertible

Unique solution

Sistem persamaan yang tak terselesaikan

54

4221

2

1

xx

No solutionDet [A] = 0, but system is inconsistent

Then this system of equations

is not solvable

Sistem dengan solusi tak terbatas

Det{A} = 0 A is singularinfinite number of solutions

84

4221

2

1

xx

Consistent so solvable

Ill-conditioned system of equations

A linear system

of equations is

said to be “ill-

conditioned” if

the coefficient

matrix tends to

be singular

Ill-conditioned system of equations

• A small deviation in the entries of A matrix, causes a large deviation in the solution.

47.13

99.048.021

2

1

xx

47.13

99.049.021

2

1

xx

11

2

1

xx

03

2

1

xx

Gaussian Elimination

Merupakan salah satu teknik paling populer dalam menyelesaikan sistem persamaan linear dalam bentuk:

Terdiri dari dua step

1. Forward Elimination of Unknowns.

2. Back Substitution

CXA

Forward Elimination

Tujuan Forward Elimination adalah untuk membentuk matriks koefisien menjadi Upper Triangular Matrix

7.00056.18.40

1525

11214418641525

Forward Elimination

Persamaan linear n persamaan dengan n variabel yang tak diketahui

11313212111 ... bxaxaxaxa nn

22323222121 ... bxaxaxaxa nn

nnnnnnn bxaxaxaxa ...332211

. . . . . .

Contoh

83125123127135221232

83251232

73522232

4321

4321

4321

4321

xxxxxxxx

xxxxxxxx

matriks input

Forward Elimination

83125123127135221232

32162

19013140

9212012

11231

'14

'4

'13

'3

'12

'2

1'1

5

2

22

RRR

RRR

RRR

RR

32162

19013140

9212012

11231

415994

5001973002

912110

12112

31

'14

'4

'23

'3

2'2

1'1

2194

2

RRR

RRR

RR

RR

Forward Elimination

12572

12143000

319

37100

2912

110

12112

31

'34

'4

3'3

2'2

1'1

45

3RRR

RR

RR

RR

415994

5001973002

912110

12112

31

12572

12143000

319

37100

2912

110

12112

31

1435721000

319

37100

2912

110

12112

31

121434'

4

3'3

2'2

1'1

RR

RR

RR

RR

Back substitution

4143

5723

193

72

92

112

12

3

4

4

43

432

4321

x

x

xx

xxx

xxxx

Gauss - Jourdan

397432234215231

61508120

15231

'13

'3

'12

'2

1'1

3

2

RRR

RRR

RR

14270042110

152101

'23

'3

2'2

'21

'1

5

2

3

RRR

RR

RRR

61508120

15231

14270042110

152101

410020101001

273'

3

'32

'2

'31

'1

212

1

RR

RRR

RRR

Warning..

Dua kemungkinan kesalahan-Pembagian dengan nol mungkin terjadi pada langkah forward elimination. Misalkan:

655901.33099.26

7710

321

123

21

xxxxxx

xx

- Kemungkinan error karena round-off (kesalahan pembulatan)

ContohDari sistem persamaan linear

5156099.230710

3

2

1

xxx

6901.37

=

Akhir dari Forward Elimination

15005006001.000710

3

2

1

xxx

15004001.67

=

6901.3

7

5156099.230710

15004001.6

7

15005006001.000710

Kesalahan yang mungkin terjadi

Back Substitution

99993.01500515004

3 x

5.1 001.0

6001.6 32

xx

3500.010

077 321

xxx

15004001.67

15005006001.000710

3

2

1

xxx

Contoh kesalahanBandung-kan solusi exact dengan hasil perhitungan

99993.05.135.0

3

2

1

xxx

X calculated

11

0

3

2

1

xxx

X exact

Improvements

Menambah jumlah angka pentingMengurangi round-off error (kesalahan pembulatan)

Tidak menghindarkan pembagian dengan nol

Gaussian Elimination with Partial PivotingMenghindarkan pembagian dengan nol

Mengurangi round-off error

Pivoting

pka

Eliminasi Gauss dengan partial pivoting mengubah tata urutan baris untuk bisa mengaplikasikan Eliminasi Gauss secara Normal

How?

Di awal sebelum langkah ke-k pada forward elimination, temukan angka maksimum dari:

nkkkkk aaa .......,,........., ,1

Jika nilai maksimumnya Pada baris ke p, ,npk

Maka tukar baris p dan k.

Partial Pivoting

What does it Mean?Gaussian Elimination with Partial Pivoting ensures that each step of Forward Elimination is performed with the pivoting element |akk| having the largest absolute value.

Jadi,

Kita mengecek pada setiap langkah apakah angka paling atas (pivoting element) adalah selalu paling besar

Partial Pivoting: Example

Consider the system of equations

655901.36099.23

7710

321

321

21

xxxxxx

xx

In matrix form

5156099.230710

3

2

1

xxx

6901.37

=

Solve using Gaussian Elimination with Partial Pivoting using five significant digits with chopping

Partial Pivoting: Example

Forward Elimination: Step 1

Examining the values of the first column

|10|, |-3|, and |5| or 10, 3, and 5

The largest absolute value is 10, which means, to follow the rules of Partial Pivoting, we don’t need to switch the rows

6901.37

5156099.230710

3

2

1

xxx

5.2001.67

55.206001.000710

3

2

1

xxx

Performing Forward Elimination

Partial Pivoting: Example

Forward Elimination: Step 2

Examining the values of the first column

|-0.001| and |2.5| or 0.0001 and 2.5

The largest absolute value is 2.5, so row 2 is switched with row 3

5.2001.67

55.206001.000710

3

2

1

xxx

001.65.2

7

6001.0055.200710

3

2

1

xxx

Performing the row swap

Partial Pivoting: Example

Forward Elimination: Step 2

Performing the Forward Elimination results in:

002.65.2

7

002.60055.200710

3

2

1

xxx

Partial Pivoting: Example

Back Substitution

Solving the equations through back substitution

1002.6002.6

3 x

15.255.2 2

2

x

x

010

077 321

xxx

002.65.2

7

002.60055.200710

3

2

1

xxx

Partial Pivoting: Example

11

0

3

2

1

xxx

X exact

11

0

3

2

1

xxx

X calculated

Compare the calculated and exact solution

The fact that they are equal is coincidence, but it does illustrate the advantage of Partial Pivoting

Summary

-Forward Elimination

-Back Substitution

-Pitfalls

-Improvements

-Partial Pivoting