⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vicalculation_losslesstl.m

📁 该matlab函数用来计算理想无耗传输线上电压电流的分布
💻 M
字号:
% Usage
%   Calculate complex V and I along lossless TL from load to certain position indicated by ElectroLen.
%   Load:Zl is at z=0 (and Gamal is the corresponding complex reflection index).+z is directed to source.
%   Thus z is distance from Zl and r_z_lambda is the ratio of z and lambda(z/lambda).lambda is phase wavelength.
%   This function is based on j system and i is reserved for the imaginary sign.
%
% Format: [r_z_lambda,Gama,V,I]=VICalculation_losslessTl(Vi0, Gamal, ElectroLen, Z0, Fig)
%
% Input arguments:
%   Vi0: incident voltage wave at z=0, in Volt.
%   Gamal: reflection index at z=0.
%   ElectroLen: the electrical length from load (in deg) of TL within which V and I are calculated.
%   Z0: characteristic impedance of the TL in ohm.
%   Fig: boolean type, set it as true if you want to plot calculation result.
%
% Output arguments:
%   r_z_lambda: ratio of z and lambda(z/lambda).lambda is phase wavelength.
%   Gama: complex reflection index along lossless TL.
%   V,I: complex V and I along lossless TL.

function [r_z_lambda,Gama,V,I]=VICalculation_losslessTl(Vi0, Gamal, ElectroLen, Z0, Fig)

display('V along lossless TL')
display('Load:Zl at z=0 (and Gamal is the corresponding reflection index).+z is directed to source,')
display('thus z is distance from Zl and r_z_lambda is the ratio of z and lambda (z/lambda).lambda is phase wavelength.')
display('V(z)=Vi0*exp(i*2*pi*z/lambda)*(1+Gamal*exp(-i*4*pi*z/lambda))')

for j=1:(ElectroLen/360)/0.01+1
    r_z_lambda(j)=0.01*(j-1);
    Gama(j)=Gamal*exp(-i*4*pi*r_z_lambda(j));

    midv(j)=(1+Gama(j));
    V(j)=Vi0*exp(i*2*pi*r_z_lambda(j)).*midv(j);

    midi(j)=(1-Gama(j));
    I(j)=Vi0*exp(i*2*pi*r_z_lambda(j)).*midi(j)/Z0;
end

if Fig
    figure(101)
    plot(real(Gama),imag(Gama),'r',real(midv),imag(midv),'b',real(V),imag(V),'g');
    xlabel('real');ylabel('imag');
    legend('Gama(z)','1+Gama(z)','V(z)');
    title(strcat(num2str(ElectroLen/360),'phase wavelength from load')),
    grid on

    figure(102), subplot(211),
    plot(r_z_lambda,abs(V)),
    xlabel('z/lambda');ylabel('magnitude of V(z) in V'); grid on
    figure(102), subplot(212),
    plot(r_z_lambda,180*angle(V)/pi),
    xlabel('z/lambda');ylabel('phase of V(z) in deg'); grid on

    figure(103)
    plot(real(Gama),imag(Gama),'r',real(midi),imag(midi),'b',real(I),imag(I),'g')
    xlabel('real');ylabel('imag');
    legend('Gama(z)','1-Gama(z)','I(z)'),
    title(strcat(num2str(ElectroLen/360),'phase wavelength from load')),
    grid on

    figure(104), subplot(211),
    plot(r_z_lambda,abs(I)),
    xlabel('z/lambda');ylabel('magnitude of I(z) in A'); grid on
    figure(104), subplot(212),
    plot(r_z_lambda,180*angle(I)/pi),
    xlabel('z/lambda');ylabel('phase of I(z) in deg'); grid on
    
    display('press "enter" to continue...');
    pause
    close all
end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -