Skip to content

Result of the damp function for discrete time systems #646

@vincentchoqueuse

Description

@vincentchoqueuse

Hi,

This is my first contribution on GitHub ;)

Problem

The method damp() seems to return a wrong result for discrete systems with negative poles

import control as ctl
H = ctl.tf([1],[1,0.2],1)
H.damp()

Result : RuntimeWarning: invalid value encountered in log

Investigation

The problem seems to come from the type of the poles variable in the dampmethod of the LTI object

if isdtime(self, strict=True):
     splane_poles = np.log(poles)/self.dt
else:
      splane_poles = poles
wn = absolute(splane_poles)
Z = -real(splane_poles)/wn
return wn, Z, poles

Solution

The poles variable must be cast to a numpy complex type as follows

if isdtime(self, strict=True)
      splane_poles = np.log(poles.astype(complex))/self.dt
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy