8000 Scaling for control.impulse_response discrete time is not correct · Issue #974 · python-control/python-control · GitHub
[go: up one dir, main page]

Skip to content
Scaling for control.impulse_response discrete time is not correct #974
Closed
@cdboschen

Description

@cdboschen

Tested on control 0.9.2 and again on 0.9.4

The resulting impulse response (unit sample response) for the following transfer function (accumulator scaled by 0.1) is not properly scaled:

$$H(z) = \frac{Tz}{z-1}$$

With the sample duration set to $T=0.1$ is being scaled again by $1/T$ such that the result is a step with every output sample set to 1. This is not correct as the result should be 0.1 for every output sample.

To further clarify below is the implementation diagram:

image

If we pass a unit sample into this, it would scale by $T$ to be $0.1$ per the transfer function and block diagram shown and then the output would go to $0.1$ and then repeat for every subsequent sample. I confirmed with Octave that the result is as I expect. Further if I use con.step_response on the same transfer function, the result is also what I expect for that case (the output increments by 0.1).

Code to repeat problem:

import control as con
dt=0.1
accum = con.tf([dt, 0], [1, -1], dt)
t1, y1 = con.impulse_response(accum)     # doesn't scale properly
t2, y2 = con.step_response(accum)           # scales properly

I do see in the docs "For continuous time systems, the initial condition is altered to account for the initial impulse. For discrete-time systems, the impulse is sized so that it has unit area", but would argue that it should not be rescaled especially if Octave and MATLAB are not doing that (I haven't confirmed MATLAB) and should represent the output of the discrete time system described by $H(z)$ alone without modification when a unit sample is applied to the input.

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

      0