第 6 章 線性代數方程式 linear algebraic equations

Post on 18-Mar-2016

109 Views

Category:

Documents

7 Downloads

Preview:

Click to see full reader

DESCRIPTION

第 6 章 線性代數方程式 Linear Algebraic Equations. linear. 5x-2y=13 7x+3y=24 Linear ~ dependent variable 不可以有一次以外的次方. 6.1 Elementary Solution Methods. Successive elimination of variables Gauss elimination. Gauss elimination. -x+y+2z=2(1) 3x-y+z=6(2) -x+3y+4z=4(3) -x+y+2z=2(1) - PowerPoint PPT Presentation

TRANSCRIPT

Puff! The magic dragon, live by the sea…

第 6章 線性代數方程式Linear Algebraic Equations

Puff! The magic dragon, live by the sea…

linear

5x-2y=137x+3y=24

• Linear ~ dependent variable 不可以有一次以外的次方

Puff! The magic dragon, live by the sea…

6.1 Elementary Solution Methods

• Successive elimination of variables• Gauss elimination

Puff! The magic dragon, live by the sea…

Gauss elimination

-x+y+2z=2 (1)3x-y+z=6 (2)-x+3y+4z=4 (3)

-x+y+2z=2 (1) 2y+7z=12 (4) 2y+2z=2 (5)

Puff! The magic dragon, live by the sea…

Gauss elimination

-x+y+2z=2 (1) 5z=10 (6) y=-1 (7)

x=1

Puff! The magic dragon, live by the sea…

Self test p.334

Puff! The magic dragon, live by the sea…

Singular & ill-conditioned problems

1. 3x-4y=5 6x-10y=2 Sol. (7,4)2. 3x-4y=5 6x-8y=10 Infinite solutions3. 3x-4y=5 6x-8y=3 empty set

Puff! The magic dragon, live by the sea…

Puff! The magic dragon, live by the sea…

Puff! The magic dragon, live by the sea…

Homogeneous equations

6x+ay=02x+4y=0(a-12)y=0If a~=12, x=0If a=12, infinite solutions

Puff! The magic dragon, live by the sea…

Ill-conditioned equations

3x-4y=5 (1)6x-8.002y=3 (2)(11 y=(3x-5)/4(11 y=(3x-1.5)/4.001

(x,y)=(4668, 3500)Very sensitive !

Puff! The magic dragon, live by the sea…

Matrix methods for linear equations

75

4392

75

4392

743592

2

1

2

1

21

21

bxA

bAx

xx

xx

xxxx

Puff! The magic dragon, live by the sea…

mn

mnmm

n

n

mn

mnmm

n

n

mnmnmm

nn

nn

b

bb

x

xx

aaa

aaaaaa

b

bb

x

xx

aaa

aaaaaa

bxaxaxa

bxaxaxabxaxaxa

2

12

1

21

22221

11211

2

12

1

21

22221

11211

2211

22222121

11212111

bxA

bAx

Puff! The magic dragon, live by the sea…

Determinants 行列式

3792106143

A

A=[3,-4,1;6,10,2;9,-7,3];det(A)ans = 0

Puff! The magic dragon, live by the sea…

Determinants and singular problems

• If determinant of A=0, then a singular problem.

• If determinant of A ~= 0• If determinant of A = 0

Puff! The magic dragon, live by the sea…

Left-division methodA=[3,2,-9;-9,-5,2;6,7,3];det(A)b=[-65;16;5];A\b

ans = 288ans = 2.0000 -4.0000 7.0000

Puff! The magic dragon, live by the sea…

Right-division method

]193[5326

][ 21

xx

d/CxdxC

Puff! The magic dragon, live by the sea…

Ex.6.2-2 p.342

• Kirchhoff’s law

• Current conservation at a node

532

421

iiiiii

00

0

23355

552244

44111

viRiRiRiRiR

iRiRv

Puff! The magic dragon, live by the sea… 0

00

23355

552244

44111

viRiRiRiRiR

iRiRv

532

421

iiiiii

Puff! The magic dragon, live by the sea…

% resist.m% solve the current i_1,i_2,i_3R=[5,100,200,150,250]*1000;v1=100; v2=50;A1=[R(1)+R(4),-R(4),0];A2=[-R(4),R(2)+R(4)+R(5),-R(5)];A3=[0,R(5),-(R(3)+R(5))];A=[A1;A2;A3];b=[v1;0;v2];current=A\b;disp('The currents are:')disp(current)The currents are: 1.0e-003 *

0.9544 0.3195 0.0664

235325

35254214

124141

)(0)(

)(

viRRiRiRiRRRiR

viRiRR

Puff! The magic dragon, live by the sea…

Exercise p.343-345

Puff! The magic dragon, live by the sea…

Matrix inverse

bAxxIbAAxAIAAAA

bAx

1

11

11

Puff! The magic dragon, live by the sea…

An example of Statics

• Derivation of equilibrium equations.• Solve the linear equations by matlab.• P.346-348

Puff! The magic dragon, live by the sea…

Ex. 6.2-5• Check by matlab as well as by hand for an inversion of 2 by 2

matrix.

2x+9y=53x-4y=7

A=[2,9;3,-4];b=[5;7];x=inv(A)*bx = 2.3714 0.0286

Puff! The magic dragon, live by the sea…

Puff! The magic dragon, live by the sea…

Cramer’s method

• Self test …

Puff! The magic dragon, live by the sea…

6.4 Underdetermined systems

A=[1,3];b=6;x=A\b

x = 0 2

solutionsinfinite36

631

63

yxyxyx

Puff! The magic dragon, live by the sea…

Underdetermined systems

0A

Puff! The magic dragon, live by the sea…

Matrix rank 矩陣的秩

2rank

157943

4437210

03792106143

A=[3,-4,1;6,10,2;9,-7,3];rank(A)

ans =

2

Puff! The magic dragon, live by the sea…

Existence and uniqueness of solutions

• Augmented matrix

108627935

][

107

,862935

][

bA

bA

bA

Puff! The magic dragon, live by the sea…

Existence and uniqueness of solutions

• Augmented matrix

][rank][rankifonlyandifunknowns) eqns., (11

bAAbxA

nmmnnm

Puff! The magic dragon, live by the sea…

Singular matrix0A

Puff! The magic dragon, live by the sea…

Ex 6.4-1

3x-2y+8z=48-6x+5y+z=-129x+4y+2z=24

A=[3,-2,8;-6,5,1;9,4,2];b=[48;-12;24];rank(A)rank([A b])x=A\b

ans =3ans = 3x = 2.0000 -1.0000 5.0000

Puff! The magic dragon, live by the sea…

Ex 6.4-22x-4y+5z=-4-4x-2y+3z=42x+6y-8z=0

• A=[2,-4,5;-4,-2,3;2,6,-8];• b=[-4;4;0];• rank(A)• rank([A b])• x=A\b

• ans =• 2• ans =• 2• Warning: Matrix is singu

lar to working precision.• x =• Inf• Inf• Inf

Puff! The magic dragon, live by the sea…

pinv command & Euclidean norm

• x=pinv(A)*b

x = -1.2148 0.2074 -0.1481

Puff! The magic dragon, live by the sea…

Ex 6.4-3

• Statically indeterminate problem

Puff! The magic dragon, live by the sea…

1600400

0510111

][

1600400

,0510111

1600400

0510111

0510)4(400,0400,

3

2

1

3

2

1

21

321

Ab

x

bA

0M0F

TTT

TTT

TTTTT

Puff! The magic dragon, live by the sea…

32

31

12

248080

2320

TTTT

TT

Puff! The magic dragon, live by the sea…

A=[1,1,1;10,5,0];b=[400;1600];rank(A)rank([A b])A\bans = 2ans = 2ans = 160.0000 0 240.0000

pinv(A)*bans = 93.3333 133.3333 173.3333

Puff! The magic dragon, live by the sea…

Ex 6.4-4, pp.3622x-4y+5z=-4-4x-2y+3z=42x+6y-8z=0

• x+0y-0.1z=-1.2• 0x+y-1.3z=0.4• 0x+0y+0z=0

A=[2,-4,5;-4,-2,3;2,6,-8];b=[-4;4;0];x=pinv(A)*brref([A b])x = -1.2148 0.2074 -0.1481ans = 1.0000 0 -0.1000 -1.2000 0 1.0000 -1.3000 0.4000 0 0 0 0

Puff! The magic dragon, live by the sea…

Underdetermined systems• P.363-364 ex.6.4-55x+3y+3z=403x+3y+4z=30

• x-0.5z=5• y+1.8333z=5

zyx

xBA3040

433335

A=[5,3,3;3,3,4];b=[40;30];rref([A b])

ans = 1.0000 0 -0.5000 5.0000 0 1.0000 1.8333 5.0000

Puff! The magic dragon, live by the sea…

Ex 6.4-6 p.364

100+200=f1+f4f1+f2=300+200600+400=f2+f3f3+f4=300+500

4

3

2

1

8001000500300

1100011000111001

ffff

xbA

bAx

800200300

0800200300

000011001-0101001

b])rref([A

43

42

41

ffffff

Puff! The magic dragon, live by the sea…

Puff! The magic dragon, live by the sea…

Puff! The magic dragon, live by the sea…

Puff! The magic dragon, live by the sea…

Puff! The magic dragon, live by the sea…

Puff! The magic dragon, live by the sea…

Puff! The magic dragon, live by the sea…

Puff! The magic dragon, live by the sea…

Puff! The magic dragon, live by the sea…

Puff! The magic dragon, live by the sea…

Puff! The magic dragon, live by the sea…

Puff! The magic dragon, live by the sea…

Puff! The magic dragon, live by the sea…

Puff! The magic dragon, live by the sea…

top related