Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

add summing junction + implicit signal interconnection#517

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

murrayrm
Copy link
Member

This PR addresses the enhancement describe in issue#516 where signals with the same name are automatically interconnected by theinterconnect function. It also defines a new functionsummation_block that addresses the request in issue#493. Together, these capabilities allow the following code to work for setting up a simple feedback system:

P = ct.ss2io(    ct.rss(2, 1, 1, strictly_proper=True),    inputs='u', outputs='y', name='P')kp = ct.tf(random.uniform(1, 10), [1])ki = ct.tf(random.uniform(1, 10), [1, 0])C = ct.tf2io(kp + ki, inputs='e', outputs='u', name='C')sumblk = ct.summation_block(inputs=['r', '-y'], output='e', name="sum")Tio_sum = ct.interconnect(    (C, P, sumblk), inplist=['r'], outlist=['y'])

Other minor changes:

  • Added code to allow theiosys.feedback function to accept a float_like for the feedback system (so thatfeedback(P * C, 1) now works.

@murrayrmmurrayrm changed the titledd summation_block and implicit signal interconnectionadd summation_block + implicit signal interconnectionJan 23, 2021
@coveralls
Copy link

coveralls commentedJan 23, 2021
edited
Loading

Coverage Status

Coverage increased (+0.1%) to 87.754% when pulling791f7a6 on murrayrm:sumblk_implicit_interconnect into1502d38 on python-control:master.

@sawyerbfuller
Copy link
Contributor

sawyerbfuller commentedJan 23, 2021
edited
Loading

Very cool!

I particularly like that it appears possible with this to leave out the ‘name’ keyword for the constitutive systems for simple interconnections like this. Am I correct in that? Nice to have that option because thst keyword is somewhat redundant and prone to errors when code gets modified.

If you give the sumblock more input names (eg 3 instead of 2), does it sum those three signals?

@murrayrm
Copy link
MemberAuthor

murrayrm commentedJan 24, 2021
edited
Loading

it appears possible with this to leave out the ‘name’ keyword for the constitutive systems for simple interconnections like this. Am I correct in that?

Correct. The following works just fine (from#516):

P = 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')

(P,C, andsumblk all have names automatically assigned, but not needed here).

If you give the sumblock more input names (eg 3 instead of 2), does it sum those three signals?

Yup. Any number of inputs can be summed together. Thesummation_block function does not require named signals, so you can also doct.summation_block(7) if you want aLinearIOSystem that has 7 inputs and 1 output (sum of the inputs), for example).

Some possible tweaks:

  • I think I may use the termsumming_junction (instead ofsummation_block) to line up with the term we use in FBS.
  • I will add a bit more documentation, both in docstrings and in the manual
  • I want to switch all examples usingInterconnectedSystem to useinterconnect since using the class constructor since the function provides a slightly higher level interface (eg, the class constructor still requires the explicit signal name).

@sawyerbfuller
Copy link
Contributor

Awesome.

New name for summer sounds better.

Hoping this will make creating simulink-like interconnected system simulations much easier. I will let you know how it goes once it’s been merged in.

@bnavigator
Copy link
Contributor

Very nice!

(Now we will have users demanding a graphical editor next 😁. Implemented as jupyter notebook widget or the like.)

@sawyerbfuller
Copy link
Contributor

sawyerbfuller commentedJan 24, 2021 via email

I think the first step in that direction might be to add an option ininterconnect to draw a block diagram. This could be done using matplotlibspretty good capabilities for this.
-- Sawyer FullerAssistant Professor of Mechanical EngineeringAdjunct, Paul G Allen School of Computer ScienceUniversity of Washingtonhttp://faculty.washington.edu/~minster/(Typed with my thumbs)
bnavigator reacted with thumbs up emoji

interconneciton map by connecting all signals with the same base names
(ignoring the system name). Specifically, for each input signal name
in the list of systems, if that signal name corresponds to the output
signal in any of the systems, it will be connected to that input (with
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Nice that this summation effect is stated explicitly.

@murrayrmmurrayrm changed the titleadd summation_block + implicit signal interconnectionadd summing junction + implicit signal interconnectionJan 26, 2021
@murrayrmmurrayrm merged commit122672a intopython-control:masterJan 26, 2021
@murrayrmmurrayrm deleted the sumblk_implicit_interconnect branchJanuary 31, 2021 00:13
@murrayrmmurrayrm added this to the0.9.0 milestoneMar 20, 2021
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@sawyerbfullersawyerbfullersawyerbfuller approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
0.9.0
Development

Successfully merging this pull request may close these issues.

Using interconnect/interconnected system sumblk doesnt exists for connection in matlab compatibility module
4 participants
@murrayrm@coveralls@sawyerbfuller@bnavigator

[8]ページ先頭

©2009-2025 Movatter.jp