You are on page 1of 63

9

9.1
9.1 x

0
x
0

0
1

Ayi=Ai*x
ag911xyi
x[0,1,1,0;0,0,1,1];
subplot(2,3,1), fill([x(1,:),0],[x(2,:),0],'r')
A1[1,0;0,1], y1A1*x
subplot(2,3,2), fill([y1(1,:),0],[y1(2,:),0],'g')


D1 det( A1 ) 1,

1 1

1 ,

1
p1
0

0
1

1
0
p2
0
1
1
0
D3 det( A3 ) 0.2, 3 0.2 1.0 , p3
0
1
1.0 1.0
D4 det( A4 ) 1, 4 1
1 , p4
0.
0.
0.7071
0.7071

D5 1, 5 0.866 + 0.5i 0.866 0.5i , p5

0 0.7071i 0 + 0.7071i
D2 det( A2 ) 1.5,

2 1.0

1.5 ,


A1
A2A3
A4
A5tpi/6

A1 ,A4A51
A2A3
1.50.2

9.2

A
1
1
p1 (:,1)
1 (1) 1

p1 (:, 2)
1
1

A1

eigshow

eigshowxAx

eigshow(A4) x
x
Ax

Axx

Eigshow(A4)

eigshow([1,2; 2,2])

eigshow([1,2; 2,2])

A
A
ATA22
A(1,2) A(2,1)A =[1,2;2,2]
eigshow(A)AxxAx

A
-0.5616 3.5616

9.2

0
x
0

0.50

0.50

6.42

6.00
0

6.00
8.00

5.50
8.00

5.50
1.58

0
8.00

N
1plot1
2

1
A
0

0.25
x
1


x0[0,0.5,0.5,6,6,5.5,5.5,0;0,0,6.42,0,8,8,1.58,8];
x[x0,x0(:,1)];
%

A[1,0.25;0,1]; yA*x;
subplot(1,2,1),plot(x(1,:),x(2,:))
subplot(1,2,2),plot(y(1,:),y(2,:))



A5
yxc
1yaxacybxbc
yyaybxaxb2cxc

2yaxack
ykyak(xac)kxakckxacxc

xy
yxc



xy

x
x1
x x2

1



1
M 0

c1
c2

0
1
0

x 1 +c1
yx

y= M* x

x 2 +c 2

33A5
A(3,3)1
cos t sin t c
A5 sin t

cos t
0

c2 ,

9.3
(1,1),(1,1),(0,2)
3023
A

1
2(1)
3

9.3

Yaw
u
Pitchv
Rollw
u,vw

quatdemo



u,v,w

u,v,w

9.4
N
3NGplot3
ag904a

Gw=[4,3,0;4,3,0;0,7,0;4,3,0]'; %
Gt=[0,3,0;0,3,3;0,2,0;0,3,0]'; %
G=[Gw,Gt]
%
plot3(Gw(1,:),Gw(2,:),Gw(3,:),'r'),hold
on0
4
0
4
0
0
0
4
plot3(Gt(1,:),Gt(2,:),Gt(3,:),'g'),
G 3
3
7 axis
3 equal
3
3
2
3
0


0
cos(u) sin(u)

0
Y sin(u) cos(u)

0
0
1

0
0
1

Y,PR R 0 cos(w) sin(w)

0 sin(w)
cos(w)
0 sin(v)
cos(v)

P
0
1
0

sin(v)
0
cos(v)


G1Y*G
G2P*GG3R*G
GfY*P*R*GQ*G
RP
Y

MATLABag904b
syms u w v
Y=[cos(u),sin(u),0;sin(u cos(u),0;0,0,1)]
R=[1,0,0;0,cos(w),sin(w);0,sin(w),cos(w)]
P=[cos(v),0,sin(v);0,1,0;sin(v),0,cos(v)]



4NG4
G

3
G4

ones (1, N )

44

Y4 ,(R4 , P4 )

Y3 ,(R3 , P3 )
0

c1
c2

c3

c1,c2,c3x1,x2,x3

9.4

x
(1,6)x[e1,e2]
xb12b23
(-2,3)


Rnu vn
nuv
nnRnwu
wun1v
wvn1
u* wuv* wv
u* wu v* wv 9.18
wv inv(v) * u* wu = v \ u*
wu
w
u w
v
inv(v)
9.19
Puv

9. 5
R4u,v
1
2
u
1

1
2
1
1
, v
0
0

1
1

uvP(uv)
0

1
:uv
P(u v)
0
u\v

1
wuwu,
vwv=P*wu

1
1
0
1

1
3

1
0
0

0
1

1 1

9.5 MATLAB
MATLAB

1f=poly(A)Af
2lamda=roots(f)flamda

3p=null([lamda*I-A])p,n
3 2 4
p
A 2 0 2

9.6

ag906
ag906
A=[3,2,4;2,0,2;4,2,3]; %
f=poly(A),
% (1)
r=roots(f),r=real(r), % (2),

B1= r(1)*eye(3)-A; %
% B1=rref(B1,1e-12), % B1

p1=null(B1,r)
%

B2=r(2)*eye(3)-A;

f = 1 -6 -15 -8
r = 8.0000
,
-1.0000 + 0.0000ir=real(r)
-1.0000 - 0.0000i
8
p1 = Empty matrix: 3-by-0
-1
p2 = -0.5000 -1.0000
1.0000
0
0
1.0000

det(B1)-8.7130e-013B *x=0


B1rref
110-12
B1=rref(B1,1e-12),B1

B1p1

p1 =[1,0.5,1]T
0
0
2.0000 -1.0000 -1.0000
8.0000

p = [p1, p2] 1.0000


2.0000
0
lamda
0 -1.0000
0

2.0000

1.0000

-1.0000

eig
MATLAB

eig(
[p, lamda]=eig(A)
lamdap9.6
0
0
-0.4941 -0.5580 0.6667
-1.0000
A

-0.4720
0.7301

0.8161
0.1500

0.3333 , lamda

0.6667

0 -1.0000
0

0
0 8.0000

9.7

1
A 0

1
2
0

2
1

2 A3 + A - 5Ic)I + A1

aAb
ag907

A=[1,-1,2;0,2,1;0,0,-1];
B=2*A^3+A-5*eye(3);C=inv(A)+eye(3)
fa=poly(A),ra=roots(fa)
fb=poly(B),rb=roots(fb)
fc=poly(C),rc=roots(fc)

ag907

1
A= 0

-1
2
0

2
2
-2 -15
2.0
1 , B= 0 13
7 , C= 0

0
0
-1
0 -8

fa=[1 -2 -1 2], fb =[ 1 -3 -114 -208], fc =[ 1.00 -3.50

0.5
1.5
0

2.5
0.5
0

3.00

0]

f a ( ) 3 2 2 2, f b ( ) 3 3 2 114 208, f c ( ) 3 3.5 2 3 ,

0
-1.0000
13.0000

ra= 2.0000 , rb= -8.0000 , rc= 2.0000

1.0000
-2.0000
1.5000

9.6

AA
AxAx
Ax
AxxAx x
AxxAxx
22

22

9.8
A=[5,-2;-2,5]AxT*A*x
5 2 x1
2
2
x T Ax x1 x 2

5
x

4
x
x

5
x
48
1
1
2
2

5 x2
2

(a)
45
y1,y2
(b)
y1x1cosx2sin
y1 cos

y2x1sinx2cos
y2 sin

sin x1

cos x2

y = Px

cos
R inv ( P )
sin

sin
cos


5 2
x T Ax yT RT ARy y1 y 2 R 1
2

y1
R
yT Dy 48

5 y2

3
R AR
0
T

,=45PR,
yT Dy y , y

3
0

0
D

0 y1
2
2

3
y

7
y
1
2 48
7 y2

A(c)(d)

1 4
A

4 5

A=[1,-4;-4,-5]
[lamda,e]=eig(A)
R=orth(A)
0
0.4472 0.8944
7
lamda
,
e

0.8944

0
3
0.4472

e,
7 0 y1
T
T
Ax = y R ARy y1 y 2
7 y12 3 y 22 48

lamdaD
0 3 y2

9.9
f ( x1 , x2 , x3 ) x12 2 x22 5 x32 2 x1 x2 6 x1 x3 2 x2 x3

Aag909n
A[1,1,3;1,2,1;3,1,5], Rorth(A), Dinv(R)*A*R
f ( x1.x2 , x3 ) 6.9754y12 + 1.6994y 22 0.6749y 32

y1
0.4677
y y 2 R -1 * x = RT * x 0.0253

y 3
0.8835

0.2636
0.9501
0.1667

0.8437 x1
0.3108 x 2

0.4377 x3

9.10

ye

-2
A 4

4
-2
-1

A2
A3
I A

2!
3!

1
-1
-3

An

n!

A
a
0

ea

0
1

an

e an

e0 1 0


AA=pDp-1y
y e A pIp 1 pDp 1 pD 2 p 1 pD 3 p 1 pD n p 1 pe D p 1
2!

3!

n!

DpMATLABag910
A = [ -2, 4, 1; 4, -2, -1; 1, -1, -3 ],
[p,D] = eig(A)

p = -0.6572 -0.2610 0.7071


0.6572 0.2610 0.7071
0.3690 -0.9294 0.0000
D = -6.5616
0
0

-2
4
1
e

4
-2
-1

1
-1
-3

0
0
-6.5616
0 -2.4384
0

0
0 2.0000
pe

p 1

e -6.5616
0
0

p
0 e -2.4384
0 p -1

0
0 e 2.0000

3.7011 3.6880 0.0208


y=p*[exp(D(1,1)),0,0;0,exp(D(2,2)),0;0,0,exp(D(3,3))]*inv(p)
y 3.6880 3.7011 -0.0208

0.0208 -0.0208 0.0756

MATLABexpm(A)

9.7
(Singular Value Decomposition)

Amn


num
Au v
, Av u
v
9.7.1
Auv
T
T
2
A
Au
=

A
v
=

AAT v = Au= 2v
9.7.1
9.7.2


2ATA(nn)AAT(mm)
ATAAAT
2
k min n, m
, , ,
ATAAAT
i (i 1, 2, , k)
A
ATA
,

A

Amn1,2,, n
0

S
T
r r>diag
,

,
.

)
A
12
r+1=(
==

=0A=USV
0
1
2
r
0
r+2
n
UmVn

T
T
T
T
A = U SV 1u1v1 + 2 u2 v2 +
n unvn


(9.7.4)
2
1

2
k

(1)
m>nR(A)=r v1, v2,, vnATA
12,22,,
n2
12r > r+1 =r+2 == n= 0
1
1
1
u
v Ai=1,2,,n
Av
v v
v v 0
uu i=A*v
/
i
i

1
1

u u
v A Av
v v v v 1

T
i

T
i

T
i

2
i

T
i

T
i

2
i

2
j

2
j

T
i

2
i

T
i

T
i

u1, u2,,urr<m,
u1, u2,,uru1, u2, ,ur,,um
RmAV=USS
1, 2,, r,0,,0mn
UVV=[v1, v2,, vn]U=[ u1, u2,,ur,,um]

(2)
AV = A[v1 ,v2 ,
[ 1u1 ,
1

,vn ] [ Av1 , Av2 ,

, r ur , 0 ,

, 0] US

r
O
r

, Avn ]

O
n-r

r O
O O

m r

Smnmn
rrSrSrdet(Sr)=1
2r0det(Sr1) =12r1=0r1
r

r+1=r+2==n=0i
Ai
ArSrr
1, 2,,rr+1
(Numerical
Rank)

b a eps
MATLABIEEE
(eps)2.2410 -16eps
11+eps=1


Ann
T
Ar 1 = Ar r 1ur+1vr+1
1u1v1T +

T
r ur vrT r 1ur+1vr+1

uiviTnn1
ii+1

Arn

rA

(Condition
Number)

9.11

-5

-9

-9

-2
-4

5
9

-1
0

-3
9

4
-2

-4

A=[2,7,9,-5,4;-9,-9,5,3,-2;
-2,5,-1,-3,5;-4,9,0,9,-4]
[U,S,V]=svd(A),
condA= S(1,1)/S(4,4)

0.6084 -0.1647
-0.7146 -0.0499
0.3385 -0.0071
0.0679

0.9851

0.7126 -0.3081
0.6750 0.1767

0.1132 0.9341

0.1541 -0.0358

0
0
0
0
16.5933

0 13.9809
0
0
0

S
0
0
11.2638
0
0

0
0
0
5.9432
0

0.4037 -0.2723 -0.4876 -0.6615


0.7831 0.5813 0.0769 0.1011

V 0.0943 -0.1233 0.8590 -0.4750

-0.3369 0.6838 -0.0436 -0.1774


0.3184 -0.3243 0.1287 0.5432

0.2957
-0.1810

0.1115

0.6209
0.6941


U,V
T
T
U U = I, V V = I,

A[16.5933 13.9809
11.2638
5.9432]
AcondA = 16.5933/5.9432 = 2.7920

9.8.1

6%2%
30%
70%10
3050

xc1 (10.06) xc00.02xs0xs1



x c1
x1

x
s1

0.94 0.02 0.3


0.2960
0.06 0.98 0.7 Ax0 0.7040

x k = Ax k -1 = A x k -2 =
= A x0
k

ag981n
2

A[0.94,0.02;0.06,0.98],
x0[0.3;0.7]
0.2960
0.2717

0.2541
0.2508
x1
,
x

,
x

,
x

10
30
50

0.7283
0.7459
0.7492 ,
0.7040
x10A^10*x0,

x30A^30*x0,

x50A^50*x0

x1A*x0,


k
0.25/0.75

A
0
0.9200
-0.7071 -0.3162
A
lamda
, e

0 1.0000

1
1
u1 , u2
1
3

0.7071 -0.9487

k
x k Ak x0 0.25
u

0.05(0.92)
u1
2

9.8.2

9.19.2

0.30
0.15
0.10

M 0.30
0.40
0.25 ,

0.10 0.20 0.15


M 4000 4500 4500 4000
P 2000
2800
2400
2200

P5800 6200 6000 6000


MPQQ

1870
2220
2070
1960
Q(1,1)0.140000.320000.15580018
Q 703450
4020
3810
3580

1670

1940

1830

1740

9.6.3
n
m
mnA76x

A67
1
yATx
n1y
y

gauss, rref, lu, rank, inv, det, cond

()()

()

1. x
2. xT*y

norm(v),qr(A)
3.b

eig(A),orth(A)

()