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 — Implement missing type conversions for block diagram algebra · Issue #513 · python-control/python-control

Implement missing type conversions for block diagram algebra #513

New issue
Copy link
New issue
Copy link
Open
Open
Implement missing type conversions for block diagram algebra#513
Copy link

Description

@murrayrm
murrayrm
opened on Jan 18, 2021
Issue body actions

As described in issue #459 and PR #498, there are a number of type conversions for various overloaded operators that are not yet implemented. A table of the current and desired operations can be found in control/tests/type_conversion_test.py.

A few of the more useful ones:

  • SISO StateSpace objects should be allowed to serve as a quotient under appropriate circumstances (so that you can write things like T = P*C/(1 + P*C) with state space objects, as you currently can with transfer functions.
  • FrequencyResponseData and InputOutputSystem objects should be able to interact with floats and arrays.
  • InputOutputSystem objects should be able to interact with LTI systems by converting the LTI system into a LinearIOSystem.
  • FrequencyResponseData systems should be able to be combined with StateSpace and TransferFunction options by evaluating the state space system or transfer function at the FRD frequencies.
Reacted by Sawyer Fuller and Ben Greiner

Activity

  1. murrayrm
    added this to the 0.9.x milestone on Jan 18, 2021
  2. sawyerbfuller commented on Feb 11, 2021

    @sawyerbfuller
    sawyerbfuller
    on Feb 11, 2021
    Contributor
    More actions

    (this was originally its own issue, #541, but I copied the comment into here and closed that issue to keep discussion about its possible implementation in this more general thread.)

    The following code causes a bug when it tries to raise an error:

    import control as ct
    import control.iosys as io
    2*io.ss2io(ct.ss(1,1,1,1))

    raise NotImplemented("Scalar multiplication not yet implemented")

    This is because InputOutputSystems define various methods, e.g. __mul__ that override those in StateSpace and some are not implemented yet.

    Options that come to mind if we want this to work better:

    1. Test for instances of StateSpace correctly and dispatch. This seems to be onerous and at odds with how inheritance ought to make things easier.
    2. In the __init__ method of LinearIOSystem, delete those methods
    3. move those operations to NonLinearIOSystem (and override as necessary in LinearIOSystem when it makes sense to create a new LinearICSystem)

    Related: many of the methods like __mul__ don't act on self and other but rather sys1 and sys2. This might still work, but I think the first argument should be self according to Python convention.

  3. murrayrm commented on Dec 30, 2021

    @murrayrm
    murrayrm
    on Dec 30, 2021
    MemberAuthor
    More actions

    A number of these conversions have been implemented in #672. Leaving this issue open since there are still a few cases that aren't handled (see table in tests/type_conversion_test.py).

  4. murrayrm
    removed this from the 0.9.1 milestone on Dec 30, 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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      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.