Question about multiple port simulation on octave interface #176
-
|
Hi, it's me again. I'm trying to understand how to turn on and off ports in a simulation loop to simulate asymmetrical circuits. Is it enough to change the excitation status and run openEMS or should I do something else? I tried analyzing the directional coupler tutorial, but found it confusing. Thanks again :) |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 17 replies
-
|
Hello, maybe I can help. You essentially need to create a loop to activate the ports sequentially. Each port element has an 'excite' parameter, which is essentially a boolean to toggle the excitation on and off: for active_port_n = 1:N_ports
for port_n = 1:N_ports
% This loop creates your ports, where just one port is active
[CSX, port{port_n}] = AddLumpedPort(CSX, <<prio>>, port_n, <<R>>, <<start>>, <<stop>>, <<dir>>, port_n==active_port_n)
end
% For each iteration of the active_port_n loop you run the simulation
endThis method is utilized within the set of these two tutorial files: matlab/Tutorials/Patch_Antenna_Phased_Array.m, matlab/Tutorials/Patch_Antenna_Array.m. I hope you find this helpful :) |
Beta Was this translation helpful? Give feedback.
-
|
Hi @JTSvejda ! Thank you so much! |
Beta Was this translation helpful? Give feedback.
-
The basic structure of multi-port simulation in that example is to put the single excitation model into a function, and then call that function for each port, one after another. So essentially you build there entire model for each port excitation! Results for each excitation go into a separate result directory. What did not work at least for my Python models: It was not possible to re-configure the port excitations for an existing CSX, and re-run with that modified ports configuration. In my models I really had to re-build everything all over again for each different excitation, that is why I encapsulated model setup & simulation into a function, with port excitation as a variable. The coupler example for Matlab does the same thing. One detail in that model that you might find confusing: instead of evaluating S-parameters directly, the model calculates Y-parameters from from port voltage & current, and then converts the full Y-matrix to S-matrix. |
Beta Was this translation helpful? Give feedback.
-
|
Hi all, |
Beta Was this translation helpful? Give feedback.

Hello, maybe I can help. You essentially need to create a loop to activate the ports sequentially. Each port element has an 'excite' parameter, which is essentially a boolean to toggle the excitation on and off:
This method is utilized within the set of these two tutorial files: matlab/Tutorials/Patch_Antenna_Phased_Array.m, matlab/Tutorials/Patch_Antenna…