Repository navigation
Using interconnect/interconnected system #516
Description
Activity
This is not something that currently works (as you saw), but would be easy to implement via a keyword (
connect-by-name=True?). Basically we could go through and anytime the name of a signal in one system matches the name of a signal in another, we can connect things together. If an output signal name appears multiple times, then you implicitly sum all outputs and attach to the inputs using that signal name.One small issue is how to know the "sign" of the connection.
MATLAB has a capability like this. I'll need to look up how they handle the sign.
- That must be it, I must have been thinking of Matlab. Suggested kwarg makes sense! Not sure how they do negations but maybe one option is to include that in signal name ‘-y’. Alternatively, just negate the system when defining it.
Conceptually I like the idea of using -y, but not sure how that work work since sometimes you want the output (or input) to have a negative sign but sometimes you don't. But there is only 1 signal name. So, for example, if you had the system
--->0 ---> C(s) ---> P(s) ------> ^ - | | | -------------------------|then the output from P needs to be positive at the output of the close loop system but negative at the input to C.
Makes sense & i agree that method would have a problem in a situation like you describe. the sign mioght have to be a property of the connection rather than the signal. one fallback is to just rely on negative unity feedthroigh systems when necessary, but not as appealing because it would require more names.
Another solution I just thought of is to use something like
sumblkfrom issue #493. If this was there, then you could doP = ct.tf2io(ct.tf(1, [1, 0]), inputs='u', outputs='y') C = ct.tf2io(ct.tf(10, [1, 1]), inputs='e', outputs='u') sumblk = ct.summation_block(inputs=['r', '-y'], output='e') T = ct.interconnect((P, C, sumblk), inplist='r', outlist='y')Code above works in PR #517
- linked a pull request that will close this issueadd summing junction + implicit signal interconnection #517
on Jan 23, 2021
Trying to get the hang of creating interconnected systems, and hoping that
interconnectcan provide a more human-readable form ofconnect.This is my question: If I'd like to create a simple feedback system like this:
the following code gives the same system for both systems:
Is there any chance you could just, by correctly assigning names that match between systems as I have done here, interconnect automatically without needing the "connections" argument? Here, that doesnt seem to work (systems don't match anymore), but for some reason I had in my mind that it was possible. Am I just missing something? Thanks!