如何在 Simulink Matlab 中测量导纳?

How to measure admittance in Simulink Matlab?

我需要测量 RLC 中的导纳。有什么聪明的方法吗?我知道有专门的阻抗测量模块,我可以使用吗?

First of all I would like to reaffirm what Ander Biguri has suggested in his comment. Before posting on Stack Overflow you should try working things out by your own means (use the documentation), and if you don't succeed, then post a question providing more details. This way more users will be able to help you and you will get better answers.

这是一种不使用阻抗测量模块的方法:

首先,我使用 Simscape Power Systems 专业技术基础模块 库 (powerlib) 中的以下模块创建了 RLC 电路的 simulink 模型:

  • 交流电压源
  • 电流测量
  • RLC系列分支
  • Powergui

除了 AC 电压源块和串联 RLC 分支块之外,电流测量块和 Powergui 块是模型工作所必需的。

由于您没有为电路组件提供任何特定值,我使用默认值。

然后我将模型命名为 my_rlc 并将其保存在我的工作目录中。

最后,我创建了以下脚本(受 this example) which makes use of the power_analyze function to obtain the state-space model of the circuit (my_rlc) from which the admittance can be obtained. Since the behaviour of an RLC circuit varies depending on the frequency, I used the bode 函数的启发,以获得从 10 Hz 到 10 kHz 的频率值范围内的导纳幅度和相位。

% Analyze electric circuit.
% Obtain the matrices (A,B,C,D) of the state-space model of the circuit.
[A, B, C, D] = power_analyze('my_rlc');

% Generate logarithmically spaced vector of frequency values.
% 500 points between decades 10^1 and 10^4.
freq = logspace(1, 4, 500);

% Vector of angular frequency values.
w = 2*pi*freq;

% Magnitude and phase of frequency response.
% Ymag: Admittance magnitude.
% Yphase: Admittance phase.
[Ymag, Yphase] = bode(A, B, C, D, 1, w);

% Plot Admittance magnitude.
subplot(2, 1, 1);
loglog(freq, Ymag);
grid on;
title('RLC Circuit');
xlabel('Frequency [Hz]');
ylabel('Admittance [S]');

% Plot Admittance phase.
subplot(2, 1, 2);
semilogx(freq, Yphase);
xlabel('Frequency [Hz]');
ylabel('Phase [deg]');
grid on;

这是结果:

如果您想了解更多关于在 MATLAB 中使用 state-space 模型的信息,我鼓励您阅读:What Are State-Space Models?