这是我的程序的其中一部分,若频率f为单频时,可以求出Ai是个6*6的矩阵,但若频率变化,假设是1E9,1E10,1E11,1E12,该如何求呢?也就是想每一个频率求出一个Ai矩阵。实际中频率是变化区间1E8:1E9:1E11,所以不可能手动改一次频率求一次。请大家给看看,帮帮忙!非常感谢!
clear
Ncond=3; % Number of conductors;
Lc=0.1; % Length of condutors(m);
C=1E-12*[53.232 -3.6051 -23.423;
-3.6051 45.246 -10.996;
-23.423 -10.996 55.679]; % Capacitance coeffiecient matrix(F);
L=1.0e-006 *[0.7808 0.2049 0.4120;
0.2049 0.7862 0.2735;
0.4120 0.2735 0.7800]; % Inductance coeffiecient matrix (H);
f=1E9; % Frequency;
% Part 2: Calculate propagation constsnt [Γ]and velocity;
[T,D]=eig(C*L)
for i=1:Ncond
Lamuda(i)=D(i,i);
end;
w=2*pi*f;
for x=1:2
for k=1:Ncond
Gama(k,k)=j*w*sqrt(Lamuda(k));
end;
end;
for i=1:3
v(i)=w/imag(Gama(i,i))
end;
% Part 3: Calculating crosstalk voltage at start and end points of No.1,3 ;
Y=j*w*C;
E1p=exp(Lc*Gama);
E2p=exp(-Lc*Gama);
for k=1:Ncond
E1(k,k)=E1p(k,k);
E2(k,k)=E2p(k,k);
end;
Ai11=0.5*inv(Y)*T*(E1+E2)*inv(T)*Y;
Ai12=-0.5*inv(Y)*T*Gama*(E1-E2)*inv(T);
Ai21=-0.5*T*(E1-E2)*inv(Gama)*inv(T)*Y;
Ai22=0.5*T*(E1+E2)*inv(T);
Ai=[Ai11 Ai12;
Ai21 Ai22]
[求助][求助]我编了一个程序,矩阵匹配有问题!谢谢