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 — control.iosys.NonlinearIOSystem generates "Algebraic loop" Error · Issue #461 · python-control/python-control

control.iosys.NonlinearIOSystem generates "Algebraic loop" Error #461

New issue
Copy link
New issue
Copy link
Closed
Closed
control.iosys.NonlinearIOSystem generates "Algebraic loop" Error#461
Copy link

Description

@Arch111
Arch111
opened on Oct 1, 2020
Issue body actions

Hi,

Issue Definition:

  1. Define a nonlinear system with an output function and NO update function
  2. In the output function, define the output as a random number (or any random output)
  3. After running the simulation You get "RuntimeError: Algebraic loop detected.".

I think it should be possible to define any "input-output" system as long as you can define it properly
as a black box which maps an input to an output, during the simulation

How to generate the issue:

  1. Take the example code at https://python-control.readthedocs.io/en/0.8.3/steering-gainsched.html
  2. At line 113, modify the statement "return np.array([vref * t, yref, 0, vref, 0])" to "return np.array([vref * t, yref, 0, vref*np.random.rand(), 0])"
  3. Run the code

I get the same error whenever I define my custom black box function. If this is an expected behavior for control.iosys.NonlinearIOSystem, is there a way to define and insert a black box system to the control.iosys.InterconnectedSystem so that it can cooperate with other NonlinearIOSystem type systems?

Thanks

Activity

  1. Arch111
    changed the title [-]control.iosys.NonlinearIOSystem generates "Algebraic loop"[/-] [+]control.iosys.NonlinearIOSystem generates "Algebraic loop" Error[/+] on Oct 3, 2020
  2. murrayrm commented on Dec 26, 2020

    @murrayrm
    murrayrm
    on Dec 26, 2020
    Member
    More actions

    The I/O system functionality only works for deterministic systems and the behavior you are illustrating is non-deterministic.

    The specific problem with the example that you provide is that every call to the trajgen block (which is the one that you modified) generates a different random number. So when the simulator runs and tries to make sure that any feedthrough terms have been properly processed, the algorithm can't conference.

    Here's the comment in the code describing what the algorithm does (from iosys.py, line 1062):

    # To allow for feedthrough terms, iterate multiple times to allow
    # feedthrough elements to propagate.  For n systems, we could need to
    # cycle through n+1 times before reaching steady state
    # TODO (later): see if there is a more efficient way to compute
    

    I don't think this is an issue that can be addressed in the current way that the I/O simulation runs. I'm closing this issue, but re-open if I have not interpreted what you are trying to do correctly.

  3. murrayrm
    closed this as completedon Dec 26, 2020
  4. SoundsSerious commented on Jan 21, 2024

    @SoundsSerious
    SoundsSerious
    on Jan 21, 2024
    More actions

    @murrayrm

    Hi, I am currently encountering this problem and still trying to understand exactly what it is doing, I'm gathering it is a convergence check of some kind.

    Additionaly i see the note for a more efficient solution and think you might be interested in this dynamics / control library built around openMDAO which is a tool for converging large complex systems. Many of the underlying solvers are still scipy so I think it would fit with the python controls library, but provide better convergence.

    https://openmdao.github.io/dymos/index.html

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.