How do I make ports in RF toolbox with complex port impedances?

8 次查看(过去 30 天)
I am trying to make a circuit in RF toolbox with one port being a complex non-50 ohm port impedance. Say 10+5j.
As I understand it setports is defined like this however this is assuming all 50 ohm ports. How do I change the reference impedance of the port from node 1/2. and keep the 3/2 node still as 50 ohm.
ckt = circuit("cir")
setports(ckt, [1 2], [3 2])

回答(1 个)

Jack
Jack 2025-3-7
编辑:Rik 2025-3-12
Hey Tony,
Here’s how you can set one port to 10 + 5j ohms while keeping another at 50 ohms:
ckt = circuit("cir");
addport(ckt, [1 2], 'Z', 10 + 5j);
addport(ckt, [3 2], 'Z', 50);
This explicitly sets the port impedance when defining the ports, so you’re not stuck with 50 ohms everywhere.
Follow me so you can message me anytime with future MATLAB questions.
  5 个评论
Tony
Tony 2025-3-7
ckt = circuit("cir");
% Add a series impedance to create a complex port impedance
z_complex = 10 + 5j;
z_standard = 50;
z1 = rfckt.series('R', real(z_complex), 'L', imag(z_complex) / (2 * pi * 1e9)); % Example at 1 GHz
Error using rfckt.rfckt>setdata1 (line 236)
Series Connected Network: RFdata must be an RFDATA.DATA object.

Error in rfckt.rfckt/set.RFdata (line 121)
obj.RFdata = setdata1(obj,value,'RFdata');

Error in rfckt.series (line 107)
set(h,varargin{:});
add(ckt, z1, [1 2]);
% Define ports
setports(ckt, [1 2], [3 2], z_standard);
Rik
Rik 2025-3-12
@Jack Using tools (e.g. an LLM) to create answers/comments is allowed, however, it is up to the user to verify the correctness of such automatic content, and to apply edits as needed.
An easy way to verify your code works, is to format your code as code and run it. As you can see, your code tends to result in an error.
There is no shame in not knowing the answer to a question. There is shame in blindly posting something an LLM generated and presenting it as an answer without even bothering to test the code runs without error.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Circuits and Systems 的更多信息

产品


版本

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by