matlab 如何绘制复分数的三维图形:电抗增加时的电压反射系数

k4ymrczo  于 2022-11-15  发布在  Matlab
关注(0)|答案(2)|浏览(148)

我正在为这个问题而苦苦挣扎。我需要在3D中显示固定Z_0但随着Z_L的变化,即负载阻抗的变化,电压反射系数的大小是如何变化的。
它根本不起作用,也不知道如何继续下去。似乎MatLab不允许对3D绘图进行和或差运算。

clear,clc,cla,clf;

figure;

resistance = 0:10:400;
reactance = -400:10:400;

R = 50;     % Fixed resistance of Transmission Line
X = 0;      % Fixed reactance of Transmission Line

R_matrix = zeros(length(resistance),length(resistance));
R_matrix(:) = R;

X_matrix = zeros(length(reactance),length(reactance));
X_matrix(:) = X;

[RESISTANCE,REACTANCE] = meshgrid(resistance,reactance);

VRC = ((resistance - R_matrix).^2  + (reactance - X_matrix).^2) ./ ((resistance + R_matrix).^2 + (reactance - X_matrix).^2);

surf(RESISTANCE,REACTANCE,VRC);

xlabel('Resistance (\Omega)',"FontSize",14);
ylabel('Reactance X','FontSize',14);
zlabel('Voltage Reflection Coefficient','FontSize',14);
yptwkmov

yptwkmov1#

这是一个新的答案,以回答OP在评论中提出的问题:

resistance = linspace(0,99);
reactance = linspace(-100,100);
R = 50;     % Fixed resistance of Transmission Line
X = 0;      % Fixed reactance of Transmission Line

% 2D plot:
VRC = ((resistance - R).^2 + (reactance - X).^2) ./ ...
      ((resistance + R).^2 + (reactance + X).^2);
plot(resistance,VRC,reactance,VRC)
xlabel('Resistance (\Omega), Reactance X',"FontSize",12);
ylabel('Voltage Reflection Coefficient','FontSize',12);

% 3D plot:
[RESISTANCE,REACTANCE] = meshgrid(resistance,reactance);
VRC = ((RESISTANCE - R).^2 + (REACTANCE - X).^2) ./ ...
      ((RESISTANCE + R).^2 + (REACTANCE + X).^2);
figure
surf(RESISTANCE,REACTANCE,VRC);
xlabel('Resistance (\Omega)',"FontSize",12);
ylabel('Reactance X','FontSize',12);
zlabel('Voltage Reflection Coefficient','FontSize',12);

92dk7w1h

92dk7w1h2#

电阻和电抗不能有不同的长度。例如,使用linspace(0,400)linspace(-400,400)确保两者都有100个值。

clear, clc, close

resistance = linspace(0,400);
reactance = linspace(-400,400);

R = 50;     % Fixed resistance of Transmission Line
X = 0;      % Fixed reactance of Transmission Line

R_matrix(1:length(resistance),1:length(resistance)) = R;
X_matrix(1:length(reactance),1:length(reactance)) = X;

VRC = ((resistance - R_matrix).^2 + (reactance - X_matrix).^2) ./ ...
      ((resistance + R_matrix).^2 + (reactance + X_matrix).^2);

[RESISTANCE,REACTANCE] = meshgrid(resistance,reactance);
surf(RESISTANCE,REACTANCE,VRC);

xlabel('Resistance (\Omega)',"FontSize",14);
ylabel('Reactance X','FontSize',14);
zlabel('Voltage Reflection Coefficient','FontSize',14);

**编辑:**只有当ZL=Z0时反射系数才能接近零,因为Γ=(ZL−Z0)/(ZL+Z0)。如果更改resistance = 0:100,您将在resistance=50处获得Γ=0,因为在resistance=50处,reactance为零。

只需更改此行:

resistance = linspace(0,100);

要获得以下数字:

相关问题