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 — Different impulse responses for zpk vs tf · Issue #1062 · python-control/python-control

Different impulse responses for zpk vs tf #1062

New issue
Copy link
New issue
Copy link
Closed
#1064
Closed
Different impulse responses for zpk vs tf#1062
#1064
Copy link
Assignees
murrayrm
Labels
bug

Description

@murrayrm
murrayrm
opened on Nov 20, 2024
Issue body actions

Discussed in #1061

Originally posted by MEnzmann November 19, 2024
Hi all!

I am little puzzled about the declaration of transfer-functions with control.zpk. The step-responses / impulse-responses of a transfer-function declared with control.zpk seem to unstable, although the poles are in the left-half plane and a bode plot does not show unstable poles. Am I missing something in the following MME?

Help would be appreciated! TIA!

_import control as ct
import control.matlab as ml
import matplotlib.pyplot as pl

Declare stable system as zpk

Gzp = ct.zpk([-5],[-1,-10], gain=4)
print(Gzp)

Declare same system as tf

Gtf = ct.tf([4,20], [1,11, 10])
print(Gtf)

Both systems share the same poles and zeros, the difference of both systems is 0.

Yet: the Gzp system is instable in simulations while Gtf is stable (as expected)

[Tzp, Yzp] = ct.impulse_response(Gzp)
pl.plot(Tzp, Yzp)
pl.show()
[Ttf, Ytf] = ct.impulse_response(Gtf)
pl.plot(Ttf, Ytf)
pl.show()__

Activity

  1. murrayrm
    self-assigned this
    on Nov 20, 2024
  2. murrayrm
    added
    bug
    on Nov 20, 2024
  3. murrayrm commented on Nov 20, 2024

    @murrayrm
    murrayrm
    on Nov 20, 2024
    MemberAuthor
    More actions

    I took a quick look and confirmed that I am getting the same results (and that something is wrong).

    The issue appears to be that Gzp above has timebase None while Gtf has timebase 0. In the forced_response function (which is called by impulse_response), the logic is set up so that a timebase of None gets interpreted as a discrete time system. This means that the system is now unstable (since the magnitude of one of the poles is greater than 1).

    I'll need to think through how to fix this in the right way. As a very short term fix, if you set the timebase explicitly, the problem goes away:

    Gzp = ct.zpk([-5],[-1,-10], gain=4, dt=0)
    
  4. murrayrm
    linked a pull request that will close this issuefix timebase processing in frd, zpk #1064on Nov 23, 2024
  5. bnavigator
    closed this as completedin #1064on Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @murrayrm
    murrayrm

Labels

bug

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.