2009501436_���_hw#9

2009501436_ì� ê´�ì� _hw#9 - , 1 1 1. ii i i B has...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Home Work. #9 Problems 4-6, minimize 2 2 2 1 5 u u u = + + L with four constraints 1 1. i i u u + - = Thus 4 , 0, , (1,1,1,1) T A I b B B K d = = = = 8.2-4) (Large penalty) 1,10,100,1000. α = How many correct digits of u for those 4 ( ) ( 1,0,0,1) I K u + = - Sol) <Matlab code> alpha=1; while alpha < 10000 K=toeplitz([2 -1 0 zeros(1,1)]); I=eye(4,4); a=alpha*[-1,0,0,1]; K_new=I+alpha*K; u=K_new\a'; fprintf( 'alpha = %d ==> u=( %f %f %f %f )\n' ,alpha,u(1),u(2),u(3),u(4)) alpha=alpha*10; end Result alpha = 1 ==> u=( -0.363636 -0.090909 0.090909 0.363636 ) alpha = 10 ==> u=( -0.562613 -0.181488 0.181488 0.562613 ) alpha = 100 ==> u=( -0.596028 -0.198016 0.198016 0.596028 ) alpha = 1000 ==> u=( -0.599600 -0.199800 0.199800 0.599600 ) 2009-06-10
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Home Work. #9 8.2-5) (Large multiplier) Solve a saddle point problem in equation (8)
Background image of page 2
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: , 1 1 1. ii i i B has B and B + + = = -= Sol) &lt;Matlab code&gt; A=eye(4,4); B=[1 -1 0 0]; b=0; d=[1,1,1,1]; S=[A,B';B 0]; D=[A'*b;d]; U=S\D; fprintf( 'U1=%f, U2=%f, W=%f\n' ,U(1),U(2), U(5)); Result U1=0.500000, U2=-0.500000, W=-0.500000 2009-06-10 Home Work. #9 8.2-6) (Null space) Compute uopt. Sol) &lt;Matlab code&gt; B=[1 -1 0 0]; b=0; d=[1,1,1,1]; n=length(B); p=1; A=eye(n,n); [Q,R]=qr(B'); Qr=Q(:,1:p); Qn=Q(:,p+1:n); E=A*Qn; y=R(1:p,1:p)'\d; ur=Qr*y; z=(E'*E)\(E'*(b-A*ur)); uopt=ur+Qn*z Result 0.5000 0.5000 0.5000 0.5000-0.5000 -0.5000 -0.5000 -0.5000 0 0 0 0 0 0 Qn 0.7071 0 0.7071 0 0 1.0000 0 0 1.0000 Qr -0.7071 0.7071 2009-06-10...
View Full Document

Page1 / 3

2009501436_ì� ê´�ì� _hw#9 - , 1 1 1. ii i i B has...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online