Skip to content

Inconsistent evaluation of tf/ss systems with pole at the origin #532

@murrayrm

Description

@murrayrm

Systems that have a pole at the origin return inconsistent values:

import control as ct
sys_tf = ct.tf([1], [1, 0])
sys_ss = ct.tf2ss(sys_tf)

sys_tf(0)        # returns (inf+0j) with divide by zero warning
sys_tf(0j)       # returns (inf+nanj) with divide by zero warning
sys_ss(0)        # LinAlgError: Singular matrix
sys_tf.dcgain()  # returns array(inf)
sys_ss.dcgain()  # returns array(nan)

I think all of these should return inf (or array(inf)).

If you have a pole and zero at the origin, you get nan or 1:

sys_tf = ct.tf([1, 0], [1, 0])
sys_ss = ct.tf2ss(sys_tf)

sys_tf(0)        # returns (nan+0j) with invalid value warning
sys_ss(0)        # returns (1+0j) [state space system is empty]
sys_tf.dcgain()  # returns array(nan)
sys_ss.dcgain()  # returns (1+0j) [state space system is empty]

I think all of these cases should produce nan.

I have a partial fix in a branch, but want to see what people think the "right" answer is before committing it.

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

      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