-
-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connecting large Network with multiple opens using circuits class #525
Comments
A Example: assuming conn = [
[(port, 0), (ntwk, 0)]
] it means that the port 1 of ntwk is left open. |
Yes, thanks. That is exactly what I was doing. Here is an simple example:
Matching port 2 using subnetwork():
array([[-0.33333333+0.j, 0.66666667+0.j], And leaving port 2 open using connect():
array([[7.50011164e-13+0.j, 1.00000000e+00+0.j], This seems correct to me. However using circuits, connecting a port to port 0 and 1 (thus leaving port 2 open):
array([[-0.33333333+0.j, 0.66666667+0.j], Is the same as using subnetwork() where port 2 is matched. |
Hum, you're right, I need to investigate why. A workaround to speed up your code could be to create open networks as you did (with different name properties) and connect them using Circuit, to build the resulting Network in a single step. Like: conn=[
[(tee, 0), (rf.Circuit.Port(f, name="port1"), 0)],
[(tee, 1), (rf.Circuit.Port(f, name="port2"), 0)],
[(tee, 2), (rf.Network(frequency=f, s=np.ones(len(f)), name='open1'), 0)],
]
resulting_circuit = rf.Circuit(conn)
resulting_network = resulting_circuit.network
print(resulting_network.s[0]) which gives:
|
Eventually, I can add a |
The workaround works well and is fast, thank you! I think additional circuit elements would be a good idea to make things more simple. |
OK, good. Just for info, how faster is it in comparison ?
Yes, in this case your N ports are all connected to the same Open via a (N+1)-junction, which is probably not what you want.
OK, it is an easy addition for the next version.
Indeed. Thanks for the notification, I will correct the documentation as well. |
With the current dataset the circuits approach takes 29 seconds. I don't want to run the connect approach again, as it was something like 30 minutes or even more. So I think it is 50-100 times faster. |
also solved with PR #529 |
Note: This comment doesn't pertain to the immediate action required, but is included as a solution to a similar example I tried something similar of a 24 Ports Nwk Obj after importing from .s24p Touchstone. Except mine is Connect to GND.
Initially I thought the subnetwork codes had issues because some of my Insertion Loss plots doesn't start with 0 dB @dc. |
Good idea, thanks for the input. Would be interesting to compare speed and accuracy. |
I need to create a smaller network from a large one (~500 ports) by leaving most of the ports open.
I have a arbitrary list of port indexes that need to be left open and the complementary list of port indexes that need to be a port in the new network.
What I have tried so far:
I tried to connect all needed ports of the network to a port network, and leave all others open:
However, the result is the same as using subnetwork.
Is there an issue with the circuits class or am I using it wrong?
The text was updated successfully, but these errors were encountered: