Skip to content

Step response output matrix not consistent between continuous-time and discrete-time #142

Description

@gpannocchia

Dear Python-control developers,

When I use the step response function (control.step) on a continuous-time multivariable system the output response matrix has dimension (nsteps, noutputs), whereas the same function used on discrete-time multivariable system returns an output response matrix of dimension (noutputs, nsteps).

Here is a sample code, which highlights the behavior.

*********************** STARTS HERE
import control as cnt
import numpy as np

Continuous-time system matrices

A = [[-1., 0.5],[0,-2.]]
B = np.eye(2)
C = np.eye(2)
D = np.zeros([2,2])
sysc = cnt.ss(A,B,C,D)

Discretization

ts = 0.1
sysd = cnt.sample_system(sysc,ts)

Step responses

tfin = 10.
Time = np.linspace(0,10,int(tfin/ts)+1)
YoutC, TimeC = cnt.step(sysc, T=Time)
YoutD, TimeD = cnt.step(sysd, T=Time)

print "Version of python-control", cnt.version
print "Output response matrix dimension (Continuous-Time) =", YoutC.shape
print "Output response matrix dimension (Discrete-Time) =", YoutD.shape
*********************** ENDS HERE

It returns (I am using python 2.7 under mac-osx):

Version of python-control 0.7.0
Output response matrix dimension (Continuous-Time) = (101, 2)
Output response matrix dimension (Discrete-Time) = (2, 101)

Thank you. Best regards,

Gabriele

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions