GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — sumblk doesnt exists for connection in matlab compatibility module · Issue #493 · python-control/python-control

sumblk doesnt exists for connection in matlab compatibility module #493

New issue
Copy link
New issue
Copy link
Closed
#517
Closed
sumblk doesnt exists for connection in matlab compatibility module#493
#517
Copy link
Labels
enhancement
Milestone
0.9.1

Description

@k10blogger
k10blogger
opened on Dec 31, 2020
Issue body actions

From upgrading from 0.7.0 to 0.8.0 of python control library. I cannot find the sumblk function in matlab compatibility module in the version 0.8.0

Here is a link to documentation of previous release.
https://python-control.readthedocs.io/en/0.7.0/matlab_strings.html#system-interconnections

I cannot seem to find this in new release.
I am also not able see the reason for this exclusion.

Activity

  1. sawyerbfuller commented on Dec 31, 2020

    @sawyerbfuller
    sawyerbfuller
    on Dec 31, 2020
    Contributor
    More actions

    Hi siddarth, that feature did not have an asterisk (*) next to it, indicating that it wasn’t yet implemented.

    I agree it would be a very nice feature to have and have I have used it myself, created as follows:

    sumblk = control.ss([[0,0.],[0,0]], [[0,0.],[0,0]], [[0,0.],[0,0]], [[1, 0],[1, 1]])

  2. bnavigator
    added this to the 0.9.x milestone on Dec 31, 2020
  3. bnavigator
    added
    enhancement
    on Dec 31, 2020
  4. murrayrm commented on Jan 9, 2021

    @murrayrm
    murrayrm
    on Jan 9, 2021
    Member
    More actions

    A few comments on this:

    • A less "stateful" version of @sawyerbfuller's subblk function would be sumblk = control.ss([], [], [], [[1, 0], [1, 1]]) which avoids the creation of any additional states. Note that this creates an "unnamed" system, since StateSpace systems do not have signal names associated with that.

    • For systems with named signals (InputOutputSystem's), this functionality is also available in the interconnect function "for free" by simply interconnecting multiple signals to the input of another block (they are automatically summed together and can also have optional gains assigned to them). For example, the following code will create a feedback loop (without creating an explicit summing block for creating of the error term):

    P = ct.LinearIOSystem(ct.tf2ss(ct.tf([1], [1, 1])), name='P')
    C = ct.LinearIOSystem(ct.tf2ss(ct.tf([2], [1, 0])), name='C')
    S = ct.interconnect([P, C],
        connections = [ ['P.u[0]', 'C.y[0]'], ['C.u[0]', '-P.y[0]'] ],
        inplist=['C.u[0]'], outlist=['P.y[0]'])
    

    It would be possible to create a function that looks more like the MATLAB sumblk function, but if the only usage is for InputOutputSystem's, then I am not sure whether it is needed (?).

    Reacted by Siddharth Kaul
  5. k10blogger commented on Jan 10, 2021

    @k10blogger
    k10blogger
    on Jan 10, 2021
    Author
    More actions

    For named system, usage of sumblk as below is something that i feel is better readable:

     S1.InputName = 'r'
     S1.OutputName = 'ug1'
     S2.InputName = 'e'
     S2.OutputName = 'ug2'
     S3.InputName = 'ym'
     S3.OutputName = 'y'
     S4.InputName = 'u'
     S4.OutputName = 'ym'
    
     sum1 = sumblk('e','r','y','+-') % e = r - y
     sum2 = sumblk('u','ug1','ug2') % u = ug1 + ug2
    
    connect(S1,S2,S4,S3,sum1,sum2,'r','ym')
    

    It clarifies which systems shares input and which systems outputs is summed with what.

    If it is possible to create a look alike sumblk with InputOutputSystems internal, that would work on provided named input formula then it would ease up the code a lot(?).
    Or if there is some other alternative where a formula can be used to depict system IO would be great to know as well.

  6. murrayrm commented on Jan 10, 2021

    @murrayrm
    murrayrm
    on Jan 10, 2021
    Member
    More actions

    It's definitely possible to create a lookalike function for sumblk and would probably only take a few lines of code. If you'd like to take a crack at it and submit a PR, I would encourage you to do so. Rather than naming the function sumblk, we should probably call summing_junction to be more Pythonic about naming. Then in the matlab module, we could set up an alias for sumblk.

    An additional requirement (and interesting idea) would be to add an option in interconnect that automatically connects all signals that have the same name. Combined with summing junction it could accomplish what you are describing.

  7. murrayrm
    linked a pull request that will close this issueadd summing junction + implicit signal interconnection #517on Jan 23, 2021
  8. murrayrm
    closed this as completedin #517on Jan 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      • 0.9.1

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.