Solving a symbolic complex determinant by putting real and imaginary parts equal to zero??
3 ビュー (過去 30 日間)
古いコメントを表示
I have a 4x4 Matrix problem, in a system that only has one non-zero eigenvalue. putting both real and imaginary parts of the determinant equal to zero and solving for the two variables 'a1' and 'a2', only leads to one answer as MATLAB has used the complex conjugate formula to find the real and imaginary parts. Is there any way around this? (t1 - t16 complex)
%%1 Find an eigenvalue for the system
syms Kt1 Kt2 a1 a2 N1 N2 real
syms a1 real
syms a2 real
syms lambda
syms E real
syms wc real
syms T1 T2
er1 = 1 - exp(-i*wc*T1);
er2 = 1 - exp(-i*wc*T2);
Er = [er1, er1, er2, er2; er1, er1, er2, er2; er1, er1, er2, er2; er1, er1, er2, er2]; % Error Matrix
syms t1 t2 t3 t4 t4 t5 t6 t7 t8 t9 t10 t11 t12 t12 t13 t14 t15 t16 % Oriented Transfer function Matrix
OTF = [t1, t2, t3, t4; t5, t6, t7, t8; t9, t10, t11, t12; t13, t14, t15, t16];
H = Er*OTF; % Error Matrix x Oriented Transfer Matrix
H1 = a1*H(1,:); % Split matrix multiplication up to multiply by scalor product
H2 = a1*H(2,:);
H3 = a2*H(3,:);
H4 = a2*H(4,:);
I = [H1; H2; H3; H4]; % Put back together again
rref(I)
z = null(I)
4 - size(z,2) % n - k(nullity) = no. of non-zero eigenvalues
e = eig(I); % Find all eigenvalues of the system
Eig = e(1,:); % Pick out non zero eigenvalue,% Change to nonzeros(e) with numeric values
Solve det(...) = 0 for 'a1', 'a2' by putting real and imaginary parts
= 0
M = simple(lambda*eye(4) - I);
my_det = simple(det(M)); % det(I - [Er]*[Tr])
a = real(my_det)
b = imag(my_det)
subs(a ,'exp(i*wc*T1)', 'cos(wc*T1) + i*sin(wc*T1)')
subs(ans, 'exp(i*wc*T2)', 'cos(wc*T2) + i*sin(wc*T2)')
subs( ans, 'exp(-i*wc*T1)', 'cos(wc*T1) - i*sin(wc*T1)')
a_ = subs( ans, 'exp(-i*wc*T2)', 'cos(wc*T2) - i*sin(wc*T2)')
subs(b, 'exp(i*wc*T1)', 'cos(wc*T1) + i*sin(wc*T1)')
subs(ans, 'exp(i*wc*T2)', 'cos(wc*T2) + i*sin(wc*T2)')
subs( ans, 'exp(-i*wc*T1)', 'cos(wc*T1) - i*sin(wc*T1)')
b_ = subs( ans, 'exp(-i*wc*T2)', 'cos(wc*T2) - i*sin(wc*T2)')
[y1,y2] = solve(a_, b_, 'a1', 'a2')
0 件のコメント
回答 (1 件)
Alexander
2012 年 7 月 25 日
Why do you split into real and imaginary part and solve both? I would expect this to work:
S=solve(my_det, a1, a2)
If I try this, I do get a solution that's parametrized by x over the real numbers.
2 件のコメント
Alexander
2012 年 7 月 25 日
編集済み: Alexander
2012 年 7 月 25 日
I do not get a solution for a1 and a2 in terms of each other. I get one solution in terms of the other variables, plus an extra 'x'. Here is a trivial example:
>> syms a1 a2 z
>> S = solve(a1-2*a2+3*z, a1, a2)
This gives the following result:
S.a1 = 2*x - 3*z
S.a2 = x
As you see, you get a result in 'z' plus the additional 'x'. I'm not sure what you are seeing. What version of MATLAB are you using?
参考
カテゴリ
Help Center および File Exchange で Linear Algebra についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!