>> X=lyap(A,B,C) X =
-2.3192 -0.4678 0.1505 -3.6284 0.1579 0.0629 5.4246 -1.0516 -0.5090 -0.5718 2.5848 -0.3649 3.0417 -0.6265 0.1580 >> norm(A*X+X*B+C)
ans =
3.8830e-014 解析方法 >> edit
function X=lyap(A,B,C) if nargin==2,C=B;B=A';end
[nr,nc]=size(C);A0=kron(A,eye(nc))+kron(eye(nr),B'); try
C1=C';x0=-inv(A0)*C1(:);X=reshape(x0,nc,nr)'; catch,error('singular matrix found.'),end
>> A=[3,-6,-4,0,5;1,4,2,-2,4;-6,3,-6,7,3;-13,10,0,-11,0;0,4,0,3,4]; >> B=[3,-2,1;-2,-9,2;-2,-1,9];
>> C=[-2,1,-1;4,1,2;5,-6,1;6,-4,-4;-6,6,-3];X=lyap(sym(A),B,C) X =
[ -434641749950/107136516451, -4664546747350/321409549353, 503105815912/321409549353] [ 3809507498/107136516451, 8059112319373/321409549353, -880921527508/321409549353]
[ 1016580400173/107136516451, 8334897743767/321409549353, -1419901706449/321409549353] [ 288938859984/107136516451, 6956912657222/321409549353, -927293592476/321409549353]
[ 827401644798/107136516451, 10256166034813/321409549353, -1209595497577/321409549353]
>> A*X+X*B+C ans =
[ 0, 0, 0] [ 0, 0, 0] [ 0, 0, 0] [ 0, 0, 0]
[ 0, 0, 0]
47. 假设已知矩阵A如下,试求出e,sinAt,eAtsin(A2eAtt)。(提示:用函数)
At0.5?1.5???4.50??0.5?40.5?0.5?? A???1.51?2.51.5????1?1?3??0
>> A=[-4.5,0,0.5,-1.5;-0.5,-4,0.5,-0.5;1.5,1,-2.5,1.5;0,-1,-1,-3];
>> A=sym(A);syms t; >> expm(A*t) ans = [ 1/2*exp(-3*t)-1/2*t*exp(-3*t)+1/2*exp(-5*t)+1/2*t^2*exp(-3*t), 1/2*exp(-5*t)-1/2*exp(-3*t)+t*exp(-3*t),
1/2*t*exp(-3*t)+1/2*t^2*exp(-3*t), 1/2*exp(-5*t)-1/2*exp(-3*t)-1/2*t*exp(-3*t)+1/2*t^2*exp(-3*t)]
[ 1/2*t*exp(-3*t)+1/2*exp(-5*t)-1/2*exp(-3*t), 1/2*exp(-3*t)+1/2*exp(-5*t), 1/2*t*exp(-3*t), 1/2*t*exp(-3*t)+1/2*exp(-5*t)-1/2*exp(-3*t)]
[ 1/2*t*exp(-3*t)-1/2*exp(-5*t)+1/2*exp(-3*t), -1/2*exp(-5*t)+1/2*exp(-3*t), exp(-3*t)+1/2*t*exp(-3*t), 1/2*t*exp(-3*t)-1/2*exp(-5*t)+1/2*exp(-3*t)]
[ -1/2*t^2*exp(-3*t), -t*exp(-3*t), -1/2*t^2*exp(-3*t)-t*exp(-3*t), exp(-3*t)-1/2*t^2*exp(-3*t)] (2)
>> A=[-4.5,0,0.5,-1.5;-0.5,-4,0.5,-0.5;1.5,1,-2.5,1.5;0,-1,-1,-3]; >> A=sym(A);syms t; >> sin(A*t) ans =
[ -sin(9/2*t), 0, sin(1/2*t), -sin(3/2*t)] [ -sin(1/2*t), -sin(4*t), sin(1/2*t), -sin(1/2*t)] [ sin(3/2*t), sin(t), -sin(5/2*t), sin(3/2*t)] [ 0, -sin(t), -sin(t), -sin(3*t)] (3)